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/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 55a6649da9 [fix](testcase) fix test case failure of insert null value 
into not null column (#20963)
55a6649da9 is described below

commit 55a6649da962fb170ddb40fea8ef26bdc552a51a
Author: TengJianPing <18241664+jackte...@users.noreply.github.com>
AuthorDate: Tue Jun 20 20:46:07 2023 +0800

    [fix](testcase) fix test case failure of insert null value into not null 
column (#20963)
---
 be/src/vec/functions/function_cast.h                   | 3 ++-
 regression-test/suites/insert_p0/insert_invalid.groovy | 8 ++++----
 regression-test/suites/statistics/test_ddl.groovy      | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/be/src/vec/functions/function_cast.h 
b/be/src/vec/functions/function_cast.h
index 8bab09142b..7f28eae11d 100644
--- a/be/src/vec/functions/function_cast.h
+++ b/be/src/vec/functions/function_cast.h
@@ -1347,10 +1347,11 @@ struct ConvertThroughParsing {
                         if constexpr (is_load_ && is_strict_insert_) {
                             if (string_size != 0 && (*vec_null_map_to)[i]) {
                                 return Status::InternalError(
-                                        "Invalid value in strict mode for 
function {}, source "
+                                        "Invalid value {} in strict mode for 
function {}, source "
                                         "column {}, from "
                                         "type "
                                         "{} to type {}",
+                                        
std::string((char*)&(*chars)[current_offset], string_size),
                                         Name::name, col_from->get_name(), 
FromDataType().get_name(),
                                         ToDataType().get_name());
                             }
diff --git a/regression-test/suites/insert_p0/insert_invalid.groovy 
b/regression-test/suites/insert_p0/insert_invalid.groovy
index 45703d4a50..6b3e99ab35 100644
--- a/regression-test/suites/insert_p0/insert_invalid.groovy
+++ b/regression-test/suites/insert_p0/insert_invalid.groovy
@@ -52,7 +52,7 @@ suite("insert_invalid") {
 
     test {
         sql """ insert into datatype_invalid select * from 
datatype_invalid_base;"""
-        exception "Invalid value in strict mode"
+        exception "Invalid value"
     }
 
     // test insert select: invalid value
@@ -74,7 +74,7 @@ suite("insert_invalid") {
     """
     test {
         sql """ insert into datatype_invalid select * from 
datatype_invalid_base;"""
-        exception "Invalid value in strict mode"
+        exception "Invalid value"
     }
 
     // test insert select: invalid value
@@ -96,7 +96,7 @@ suite("insert_invalid") {
     """
     test {
         sql """ insert into datatype_invalid select * from 
datatype_invalid_base;"""
-        exception "Invalid value in strict mode"
+        exception "Invalid value"
     }
 
     // test insert select: null into not nullable
@@ -148,7 +148,7 @@ suite("insert_invalid") {
     """
     test {
         sql """ insert into datatype_invalid values ('2022-02-29', 'a'); """
-        exception "Invalid value in strict mode"
+        exception "Invalid value"
     }
 
     sql """ set enable_insert_strict=false; """
diff --git a/regression-test/suites/statistics/test_ddl.groovy 
b/regression-test/suites/statistics/test_ddl.groovy
index 06e1c72e16..f5a67d6d55 100644
--- a/regression-test/suites/statistics/test_ddl.groovy
+++ b/regression-test/suites/statistics/test_ddl.groovy
@@ -44,6 +44,7 @@ suite("test_ddl") {
         INSERT INTO `agg_all_for_analyze_test` VALUES 
(-24673,0,-127,-1939606877,-105278987563368327,-257119.385,'bA5rPeM244SovDhOOQ02CmXeM69uhJ8GSHtU','2022-09-28','2022-08-23
 
01:34:09','wrHimKN3w24QvUiplB9HFWdeCCeX0bQbbFima85zhb1kQ0s6lP6ctie2oGuKF',-4060736.642127,NULL,'22bCQDgO6A0FJB22Q9bASB8cHnYqHeKKGsa1e','-6225805734985728798'),(-22254,0,28,702265972,-6301108547516189202,-667430.114,'M0sReWtDXk7zt7AiDCzuqciSo0JuZzNI3Kez','2022-11-24','2022-11-29
 22:52:56','gxsUl9OwrHYuy8Ih0A6XShMYk [...]
     """
 
+    sql "set enable_insert_strict=false"
     sql """
         INSERT INTO __internal_schema.column_statistics    SELECT id, 
catalog_id, db_id, tbl_id, idx_id, col_id,
         part_id, row_count,         ndv, null_count, min, max, data_size, 
update_time


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to