2021-01-20 05:27:42 +00:00
|
|
|
DROP TABLE IF EXISTS mt_01451;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
CREATE TABLE mt_01451 (v UInt8) ENGINE = MergeTree() order by tuple();
|
|
|
|
SYSTEM STOP MERGES mt_01451;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
INSERT INTO mt_01451 VALUES (0);
|
|
|
|
INSERT INTO mt_01451 VALUES (1);
|
|
|
|
INSERT INTO mt_01451 VALUES (2);
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 DETACH PART 'all_100_100_0'; -- { serverError 232 }
|
2020-11-03 09:24:10 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 DETACH PART 'all_2_2_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT name FROM system.detached_parts WHERE table = 'mt_01451';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 ATTACH PART 'all_2_2_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT name FROM system.detached_parts WHERE table = 'mt_01451';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
|
|
|
SELECT '-- drop part --';
|
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 DROP PART 'all_4_4_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 ATTACH PART 'all_4_4_0'; -- { serverError 233 }
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT '-- resume merges --';
|
2021-01-20 05:27:42 +00:00
|
|
|
SYSTEM START MERGES mt_01451;
|
|
|
|
OPTIMIZE TABLE mt_01451 FINAL;
|
2020-09-07 16:23:59 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 16:23:59 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT name FROM system.parts WHERE table = 'mt_01451' AND active;
|
2020-09-07 16:23:59 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
DROP TABLE mt_01451;
|