63 changed files with 3192 additions and 114 deletions
-
70mysql-test/extra/binlog_tests/drop_temp_table.test
-
5mysql-test/r/connect_debug.result
-
11mysql-test/r/derived.result
-
59mysql-test/r/derived_view.result
-
2mysql-test/r/func_group.result
-
4mysql-test/r/information_schema_parameters.result
-
1384mysql-test/r/join.result
-
2mysql-test/r/join_outer_innodb.result
-
10mysql-test/r/plugin.result
-
63mysql-test/r/ps.result
-
64mysql-test/r/ps_innodb.result
-
6mysql-test/r/selectivity.result
-
6mysql-test/r/selectivity_innodb.result
-
35mysql-test/r/subselect.result
-
2mysql-test/r/subselect_cache.result
-
8mysql-test/r/subselect_exists2in.result
-
2mysql-test/r/subselect_mat.result
-
41mysql-test/r/subselect_no_exists_to_in.result
-
35mysql-test/r/subselect_no_mat.result
-
35mysql-test/r/subselect_no_opts.result
-
35mysql-test/r/subselect_no_scache.result
-
35mysql-test/r/subselect_no_semijoin.result
-
2mysql-test/r/subselect_sj_mat.result
-
15mysql-test/r/view.result
-
10mysql-test/r/view_alias.result
-
27mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
-
27mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
-
124mysql-test/suite/innodb/r/innodb-autoinc.result
-
60mysql-test/suite/innodb/t/innodb-autoinc.test
-
11mysql-test/t/connect_debug.test
-
4mysql-test/t/derived.test
-
34mysql-test/t/derived_view.test
-
2mysql-test/t/information_schema_parameters.test
-
404mysql-test/t/join.test
-
2mysql-test/t/join_outer_innodb.test
-
15mysql-test/t/plugin.test
-
77mysql-test/t/ps.test
-
80mysql-test/t/ps_innodb.test
-
24mysql-test/t/subselect.test
-
20mysql-test/t/view.test
-
4plugin/win_auth_client/common.cc
-
9scripts/mysql_install_db.sh
-
8sql-common/client_plugin.c
-
13sql/item.cc
-
1sql/item.h
-
1sql/item_func.cc
-
21sql/item_subselect.cc
-
4sql/item_xmlfunc.cc
-
3sql/item_xmlfunc.h
-
1sql/sql_acl.cc
-
5sql/sql_delete.cc
-
6sql/sql_insert.cc
-
5sql/sql_lex.cc
-
25sql/sql_lex.h
-
235sql/sql_parse.cc
-
7sql/sql_plugin.cc
-
9sql/sql_select.cc
-
7sql/sql_table.cc
-
35sql/sql_yacc.yy
-
24sql/table.h
-
2support-files/mysql.server.sh
-
9win/packaging/heidisql.cmake
-
20win/packaging/heidisql.wxi.in
1384
mysql-test/r/join.result
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,64 @@ |
|||
# |
|||
# MDEV-17042: prepared statement does not return error with |
|||
# SQL_MODE STRICT_TRANS_TABLES. (Part 2) |
|||
# |
|||
set @save_sql_mode=@@sql_mode; |
|||
set sql_mode='STRICT_TRANS_TABLES'; |
|||
CREATE TABLE t1 (id int, count int) engine=innodb; |
|||
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) engine=innodb; |
|||
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) engine=innodb; |
|||
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) engine=innodb; |
|||
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 |
|||
@ -0,0 +1,80 @@ |
|||
--source include/have_innodb.inc |
|||
|
|||
--echo # |
|||
--echo # MDEV-17042: prepared statement does not return error with |
|||
--echo # SQL_MODE STRICT_TRANS_TABLES. (Part 2) |
|||
--echo # |
|||
|
|||
set @save_sql_mode=@@sql_mode; |
|||
set sql_mode='STRICT_TRANS_TABLES'; |
|||
|
|||
CREATE TABLE t1 (id int, count int) engine=innodb; |
|||
insert into t1 values (1,1),(0,2); |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
update t1 set count = count + 1 where id = '1bad'; |
|||
|
|||
prepare stmt from "update t1 set count = count + 1 where id = '1bad'"; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt; |
|||
deallocate prepare stmt; |
|||
|
|||
prepare stmt from 'update t1 set count = count + 1 where id = ?'; |
|||
set @a = '1bad'; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt using @a; |
|||
deallocate prepare stmt; |
|||
drop table t1; |
|||
|
|||
CREATE TABLE t1 (id decimal(10,5), count int) engine=innodb; |
|||
insert into t1 values (1,1),(0,2); |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
update t1 set count = count + 1 where id = '1bad'; |
|||
|
|||
prepare stmt from "update t1 set count = count + 1 where id = '1bad'"; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt; |
|||
deallocate prepare stmt; |
|||
|
|||
prepare stmt from 'update t1 set count = count + 1 where id = ?'; |
|||
set @a = '1bad'; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt using @a; |
|||
deallocate prepare stmt; |
|||
drop table t1; |
|||
|
|||
CREATE TABLE t1 (id double, count int) engine=innodb; |
|||
insert into t1 values (1,1),(0,2); |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
update t1 set count = count + 1 where id = '1bad'; |
|||
|
|||
prepare stmt from "update t1 set count = count + 1 where id = '1bad'"; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt; |
|||
deallocate prepare stmt; |
|||
|
|||
prepare stmt from 'update t1 set count = count + 1 where id = ?'; |
|||
set @a = '1bad'; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt using @a; |
|||
deallocate prepare stmt; |
|||
drop table t1; |
|||
|
|||
CREATE TABLE t1 (id date, count int) engine=innodb; |
|||
insert into t1 values ("2019-06-11",1),("2019-06-12",2); |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
update t1 set count = count + 1 where id = '1bad'; |
|||
|
|||
prepare stmt from "update t1 set count = count + 1 where id = '1bad'"; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt; |
|||
deallocate prepare stmt; |
|||
|
|||
prepare stmt from 'update t1 set count = count + 1 where id = ?'; |
|||
set @a = '1bad'; |
|||
--error ER_TRUNCATED_WRONG_VALUE |
|||
execute stmt using @a; |
|||
deallocate prepare stmt; |
|||
drop table t1; |
|||
set sql_mode=@save_sql_mode; |
|||
|
|||
--echo # End of 5.5 tests |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue