You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/05/30 08:07:59 UTC
[incubator-doris] branch master updated: [test]add update test (#9829)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new dc39a9acc9 [test]add update test (#9829)
dc39a9acc9 is described below
commit dc39a9acc9f2bf351c68b92a7007358e6f768830
Author: zy-kkk <81...@qq.com>
AuthorDate: Mon May 30 16:07:54 2022 +0800
[test]add update test (#9829)
---
regression-test/data/update/test_update_unique.out | 11 +++++++
.../suites/update/test_update_unique.groovy | 38 ++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/regression-test/data/update/test_update_unique.out b/regression-test/data/update/test_update_unique.out
new file mode 100644
index 0000000000..dbe9d2d25f
--- /dev/null
+++ b/regression-test/data/update/test_update_unique.out
@@ -0,0 +1,11 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_uniq_table --
+1 2 1 2000-01-01
+2 2 1 2000-01-01
+
+-- !desc_uniq_table --
+k INT Yes true \N
+value1 INT Yes false \N REPLACE
+value2 INT Yes false \N REPLACE
+date_value DATE Yes false \N REPLACE
+
diff --git a/regression-test/suites/update/test_update_unique.groovy b/regression-test/suites/update/test_update_unique.groovy
new file mode 100644
index 0000000000..df0b2bc186
--- /dev/null
+++ b/regression-test/suites/update/test_update_unique.groovy
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_update_unique", "update") {
+ def tbName = "test_update_unique"
+ sql "DROP TABLE IF EXISTS ${tbName}"
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tbName} (
+ k int,
+ value1 int,
+ value2 int,
+ date_value date
+ )
+ UNIQUE KEY(k)
+ DISTRIBUTED BY HASH(k) BUCKETS 5 properties("replication_num" = "1");
+ """
+ sql "insert into ${tbName} values(1, 1, 1, '2000-01-01');"
+ sql "insert into ${tbName} values(2, 1, 1, '2000-01-01');"
+ sql "UPDATE ${tbName} SET value1 = 2 WHERE k=1;"
+ sql "UPDATE ${tbName} SET value1 = value1+1 WHERE k=2;"
+ qt_select_uniq_table "select * from ${tbName} order by k"
+ qt_desc_uniq_table "desc ${tbName}"
+ sql "DROP TABLE ${tbName}"
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org