|
| 1 | + |
| 2 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +// or more contributor license agreements. See the NOTICE file |
| 4 | +// distributed with this work for additional information |
| 5 | +// regarding copyright ownership. The ASF licenses this file |
| 6 | +// to you under the Apache License, Version 2.0 (the |
| 7 | +// "License"); you may not use this file except in compliance |
| 8 | +// with the License. You may obtain a copy of the License at |
| 9 | +// |
| 10 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +// |
| 12 | +// Unless required by applicable law or agreed to in writing, |
| 13 | +// software distributed under the License is distributed on an |
| 14 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +// KIND, either express or implied. See the License for the |
| 16 | +// specific language governing permissions and limitations |
| 17 | +// under the License. |
| 18 | + |
| 19 | +suite("test_non_overlap_seg_heavy_sc", "nonConcurrent") { |
| 20 | + def tblName = "test_non_overlap_seg_heavy_sc" |
| 21 | + sql """ |
| 22 | + DROP TABLE IF EXISTS ${tblName} |
| 23 | + """ |
| 24 | + |
| 25 | + sql """ |
| 26 | + CREATE TABLE IF NOT EXISTS ${tblName} |
| 27 | + ( |
| 28 | + k INT NOT NULL, |
| 29 | + v1 INT NOT NULL, |
| 30 | + v2 INT NOT NULL |
| 31 | + ) |
| 32 | + DUPLICATE KEY(k) |
| 33 | + DISTRIBUTED BY HASH(k) BUCKETS 1 |
| 34 | + PROPERTIES( |
| 35 | + "replication_num" = "1", |
| 36 | + "light_schema_change" = "true" |
| 37 | + ); |
| 38 | + """ |
| 39 | + |
| 40 | + GetDebugPoint().clearDebugPointsForAllBEs(); |
| 41 | + GetDebugPoint().clearDebugPointsForAllBEs(); |
| 42 | + GetDebugPoint().enableDebugPointForAllBEs("MemTable.need_flush"); |
| 43 | + try { |
| 44 | + sql """ INSERT INTO ${tblName} select number, number, number from numbers("number" = "1240959") """ |
| 45 | + |
| 46 | + sql """ DELETE FROM ${tblName} WHERE v2 = 24 """ |
| 47 | + |
| 48 | + sql """ ALTER TABLE ${tblName} DROP COLUMN v2""" |
| 49 | + |
| 50 | + sql """ ALTER TABLE ${tblName} MODIFY COLUMN v1 STRING NOT NULL """ |
| 51 | + |
| 52 | + waitForSchemaChangeDone { |
| 53 | + sql """ SHOW ALTER TABLE COLUMN WHERE TableName='${tblName}' ORDER BY createtime DESC LIMIT 1 """ |
| 54 | + time 600 |
| 55 | + } |
| 56 | + |
| 57 | + qt_sql """ SELECT count(*) FROM ${tblName} """ |
| 58 | + } finally { |
| 59 | + GetDebugPoint().clearDebugPointsForAllBEs(); |
| 60 | + } |
| 61 | +} |
| 62 | + |
0 commit comments