summaryrefslogtreecommitdiff
path: root/mysql-test/main/ps.result
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-07-26 22:42:35 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-07-26 22:42:35 +0200
commitd97342b6f2cfdd55eb0f82b390ebc89c5997c382 (patch)
tree238dbb11c51a2352c99de198586b84f260b3aad9 /mysql-test/main/ps.result
parent00a254cc069e77f2088f6fbf8c367f247cfdd0dc (diff)
parent32c6f40a6319d493e5270c72ac5d27dc99d1b242 (diff)
downloadmariadb-git-d97342b6f2cfdd55eb0f82b390ebc89c5997c382.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/main/ps.result')
-rw-r--r--mysql-test/main/ps.result63
1 files changed, 63 insertions, 0 deletions
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index 5145a50d273..e70f8c3aba2 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -4372,6 +4372,69 @@ LINE1 1
LINE2 2
LINE3 3
drop table t1;
+#
+# MDEV-17042: prepared statement does not return error with
+# SQL_MODE STRICT_TRANS_TABLES. (Part 1)
+#
+set @save_sql_mode=@@sql_mode;
+set sql_mode='STRICT_ALL_TABLES';
+CREATE TABLE t1 (id int, count int);
+insert into t1 values (1,1),(0,2);
+update t1 set count = count + 1 where id = '1bad';
+ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
+execute stmt;
+ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+deallocate prepare stmt;
+prepare stmt from 'update t1 set count = count + 1 where id = ?';
+set @a = '1bad';
+execute stmt using @a;
+ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+deallocate prepare stmt;
+drop table t1;
+CREATE TABLE t1 (id decimal(10,5), count int);
+insert into t1 values (1,1),(0,2);
+update t1 set count = count + 1 where id = '1bad';
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
+prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
+execute stmt;
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
+deallocate prepare stmt;
+prepare stmt from 'update t1 set count = count + 1 where id = ?';
+set @a = '1bad';
+execute stmt using @a;
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
+deallocate prepare stmt;
+drop table t1;
+CREATE TABLE t1 (id double, count int);
+insert into t1 values (1,1),(0,2);
+update t1 set count = count + 1 where id = '1bad';
+ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
+execute stmt;
+ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+deallocate prepare stmt;
+prepare stmt from 'update t1 set count = count + 1 where id = ?';
+set @a = '1bad';
+execute stmt using @a;
+ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+deallocate prepare stmt;
+drop table t1;
+CREATE TABLE t1 (id date, count int);
+insert into t1 values ("2019-06-11",1),("2019-06-12",2);
+update t1 set count = count + 1 where id = '1bad';
+ERROR 22007: Incorrect datetime value: '1bad'
+prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
+execute stmt;
+ERROR 22007: Incorrect datetime value: '1bad'
+deallocate prepare stmt;
+prepare stmt from 'update t1 set count = count + 1 where id = ?';
+set @a = '1bad';
+execute stmt using @a;
+ERROR 22007: Incorrect datetime value: '1bad'
+deallocate prepare stmt;
+drop table t1;
+set sql_mode=@save_sql_mode;
# End of 5.5 tests
#
# End of 10.0 tests