|
| 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_partial_update_case_insensitivity", "p0") { |
| 20 | + String db = context.config.getDbNameByFile(context.file) |
| 21 | + sql "select 1;" // to create database |
| 22 | + |
| 23 | + for (def use_row_store : [false, true]) { |
| 24 | + for (def use_nereids_planner : [false, true]) { |
| 25 | + logger.info("current params: use_row_store: ${use_row_store}, use_nereids_planner: ${use_nereids_planner}") |
| 26 | + connect(user = context.config.jdbcUser, password = context.config.jdbcPassword, url = context.config.jdbcUrl) { |
| 27 | + sql "use ${db};" |
| 28 | + if (use_nereids_planner) { |
| 29 | + sql """ set enable_nereids_dml = true; """ |
| 30 | + sql """ set enable_nereids_planner=true; """ |
| 31 | + sql """ set enable_fallback_to_original_planner=false; """ |
| 32 | + } else { |
| 33 | + sql """ set enable_nereids_dml = false; """ |
| 34 | + sql """ set enable_nereids_planner = false; """ |
| 35 | + } |
| 36 | + |
| 37 | + def tableName = "test_partial_update_case_insensitivity" |
| 38 | + sql """ DROP TABLE IF EXISTS ${tableName} """ |
| 39 | + sql """ CREATE TABLE ${tableName} ( |
| 40 | + name varchar(300), |
| 41 | + status int, |
| 42 | + MY_COLUMN int, |
| 43 | + UpAndDown int |
| 44 | + ) ENGINE=OLAP |
| 45 | + UNIQUE KEY(name) COMMENT 'OLAP' |
| 46 | + DISTRIBUTED BY HASH(name) BUCKETS 1 |
| 47 | + PROPERTIES ( |
| 48 | + "replication_allocation" = "tag.location.default: 1", |
| 49 | + "enable_unique_key_merge_on_write" = "true", |
| 50 | + "store_row_column" = "${use_row_store}");""" |
| 51 | + |
| 52 | + sql "set enable_unique_key_partial_update = true;" |
| 53 | + sql "set enable_insert_strict = false;" |
| 54 | + sql "sync;" |
| 55 | + |
| 56 | + sql """ insert into ${tableName}(name, STATUS) values("t1", 1); """ |
| 57 | + qt_sql "select * from ${tableName} order by name;" |
| 58 | + sql """ insert into ${tableName}(name, my_column) values("t1", 2); """ |
| 59 | + qt_sql "select * from ${tableName} order by name;" |
| 60 | + sql """ insert into ${tableName}(name, My_Column, uPaNddOWN) values("t2", 20, 30); """ |
| 61 | + qt_sql "select * from ${tableName} order by name;" |
| 62 | + sql """ insert into ${tableName}(NAME, StAtUs, upanddown) values("t1", 999, 888); """ |
| 63 | + qt_sql "select * from ${tableName} order by name;" |
| 64 | + sql """ insert into ${tableName}(NaMe, StAtUs, mY_CoLUmN, upAndDoWn) values("t3", 123, 456, 789); """ |
| 65 | + qt_sql "select * from ${tableName} order by name;" |
| 66 | + |
| 67 | + sql """ DROP TABLE IF EXISTS ${tableName} """ |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | +} |
0 commit comments