1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-16708: fixed issue with handling of the directive --enable-prepared-warnings in mysqltest

This commit is contained in:
Dmitry Shulga
2021-06-07 00:39:15 +07:00
committed by Sergei Golubchik
parent fc71746a6a
commit b126c3f3fa
50 changed files with 141 additions and 7 deletions

View File

@ -8293,7 +8293,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
Get the warnings from mysql_stmt_prepare and keep them in a
separate string
*/
if (!disable_warnings)
if (!disable_warnings && prepare_warnings_enabled)
append_warnings(&ds_prepare_warnings, mysql);
/*

View File

@ -1043,7 +1043,7 @@ update t1 set a= a + 0.1;
select a, hex(a) from t1;
drop table t1;
--enable_prepare_warnings
#
# Columns
#
@ -1203,7 +1203,6 @@ create table t2 as select concat(a) from t1;
show create table t2;
drop table t1, t2;
#
# create view with string functions with numeric input
#
@ -1517,6 +1516,7 @@ select hex(a) from v1;
drop table t1;
drop view v1;
--disable_prepare_warnings
#
# User defined function returning numeric result
#

View File

@ -28,9 +28,11 @@
--echo #
if ($select) {
--enable_prepare_warnings
--disable_query_log
--eval $select INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/before_explain.txt'
--enable_query_log
--disable_prepare_warnings
}
if ($innodb) {
@ -122,7 +124,9 @@ if ($validation) {
--disable_query_log
if ($select) {
--enable_prepare_warnings
--eval $select INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/after_explain.txt'
--disable_prepare_warnings
--diff_files '$MYSQLTEST_VARDIR/tmp/before_explain.txt' '$MYSQLTEST_VARDIR/tmp/after_explain.txt'
--remove_file '$MYSQLTEST_VARDIR/tmp/before_explain.txt'
--remove_file '$MYSQLTEST_VARDIR/tmp/after_explain.txt'

View File

@ -21,6 +21,7 @@ create table t10 (c1 int);
--enable_warnings
# Query PS to know initial read count for frm file.
--enable_prepare_warnings
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_before;
@ -45,6 +46,7 @@ into @count_read_after;
select @count_read_after-@count_read_before;
--disable_prepare_warnings
--disable_warnings
drop table t1;
drop database show_table_lw_db;

View File

@ -29,6 +29,7 @@ let $typec= BLOB COMPRESSED;
let $typeu= BLOB;
--source column_compression.inc
--enable_prepare_warnings
--error ER_PARSE_ERROR
CREATE TABLE t1(a CHAR(100) COMPRESSED);
--error ER_WRONG_FIELD_SPEC
@ -291,6 +292,7 @@ CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED, FULLTEXT INDEX(a));
--error ER_COMPRESSED_COLUMN_USED_AS_KEY
CREATE TABLE t1 (a TEXT COMPRESSED, FULLTEXT INDEX(a));
--disable_prepare_warnings
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -63,8 +63,10 @@ CREATE TABLE t1(a MEDIUMTEXT CHARACTER SET gbk,
INSERT INTO t1 VALUES
(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
--enable_prepare_warnings
SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
--disable_prepare_warnings
DROP TABLES t1;

View File

@ -75,7 +75,9 @@ DROP TABLE t1;
--echo # Problem # 1 (original report): wrong parsing of ucs2 data
SET character_set_connection=ucs2;
--enable_prepare_warnings
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
--disable_prepare_warnings
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
@ -88,7 +90,9 @@ remove_file $MYSQLD_DATADIR/test/tmpp.txt;
--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
--enable_prepare_warnings
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
--disable_prepare_warnings
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);

View File

@ -636,8 +636,10 @@ insert into t1 values (1,1);
call mtr.add_suppression(" marked as crashed and should be repaired");
call mtr.add_suppression("Checking table");
--enable_prepare_warnings
--replace_result '\\' '/'
insert delayed into t1 values (2,2);
--disable_prepare_warnings
insert delayed into t1 values (3,3);
flush tables t1;
select * from t1;

View File

@ -1070,7 +1070,9 @@ DROP TABLE t1;
--echo #
--echo # Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
--echo #
--enable_prepare_warnings
create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime);
--disable_prepare_warnings
insert into t1 values
(98,1998,19980101,"1998-01-01 00:00:00"),
(00,2000,20000101,"2000-01-01 00:00:01"),

View File

@ -2228,6 +2228,7 @@ SET @sav_slow_query_log= @@session.slow_query_log;
SET @@session.slow_query_log= ON;
SELECT current_timestamp(6),fn_sleep_before_now() INTO @ts_cur, @ts_func;
--enable_prepare_warnings
SELECT a FROM t_ts LIMIT 1 into @ts_func;
SELECT a FROM t_trig LIMIT 1 into @ts_trig;
if (!`SELECT @ts_cur = @ts_func and @ts_func = @ts_trig`)
@ -2243,6 +2244,8 @@ SET @@session.slow_query_log= OFF;
SELECT current_timestamp(6),fn_sleep_before_now() INTO @ts_cur, @func_ts;
SELECT a FROM t_ts LIMIT 1 into @ts_func;
SELECT a FROM t_trig LIMIT 1 into @ts_trig;
--disable_prepare_warnings
if (!`SELECT @ts_cur = @ts_func and @ts_func = @ts_trig`)
{
SELECT @ts_cur, @ts_func, @ts_trig;

View File

@ -1239,12 +1239,14 @@ drop function if exists test_function;
drop view if exists v1;
create table test (col1 varchar(30));
delimiter |;
--enable_prepare_warnings
create function test_function() returns varchar(30)
begin
declare tmp varchar(30);
select col1 from test limit 1 into tmp;
return '1';
end|
--disable_prepare_warnings
delimiter ;|
create view v1 as select test.* from test where test.col1=test_function();
grant update (col1) on v1 to 'greg'@'localhost';

View File

@ -524,8 +524,10 @@ INSERT INTO t2 VALUES (1);
DROP FUNCTION IF EXISTS f2;
--enable_warnings
delimiter //;
--enable_prepare_warnings
CREATE FUNCTION f2 () RETURNS INT
BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
--disable_prepare_warnings
delimiter ;//
SELECT f2();

View File

@ -35,12 +35,14 @@ grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost';
grant all privileges on `mbase`.* to 'mysqltest_1'@'localhost';
create table t1 (f1 int);
delimiter |;
--enable_prepare_warnings
create function func1(curr_int int) returns int
begin
declare ret_val int;
select max(f1) from t1 into ret_val;
return ret_val;
end|
--disable_prepare_warnings
delimiter ;|
create view v1 as select f1 from t1 where f1 = func1(f1);
create function func2() returns int return 1;

View File

@ -71,6 +71,7 @@ insert into t5 values (1);
create view v1 as select i from t1;
create view v2 as select j from t2 where j in (select i from t1);
create procedure p1(k int) insert into t2 values (k);
--enable_prepare_warnings
delimiter |;
create function f1() returns int
begin
@ -192,6 +193,7 @@ begin
set new.l= j + 1;
end|
delimiter ;|
--disable_prepare_warnings
--echo #
--echo # Set common variables to be used by scripts called below.

View File

@ -251,6 +251,7 @@ DROP TABLE t1;
create or replace table t1 (a int, b int invisible);
insert into t1 values (1),(2);
--enable_prepare_warnings
select * from t1 into outfile 'f';
load data infile 'f' into table t1;
select a,b from t1;
@ -277,5 +278,6 @@ drop table t1;
--echo #
create table t1 (a int, b int invisible);
insert delayed into t1 values (1);
--disable_prepare_warnings
# cleanup
drop table t1;

View File

@ -82,6 +82,7 @@ create view v1 as select i from t1;
create view v2 as select j from t2 where j in (select i from t1);
create procedure p1(k int) insert into t2 values (k);
delimiter |;
--enable_prepare_warnings
create function f1() returns int
begin
declare j int;
@ -223,6 +224,8 @@ begin
end|
delimiter ;|
--disable_prepare_warnings
--echo #
--echo # Set common variables to be used by the scripts
--echo # called below.

View File

@ -150,6 +150,7 @@ DROP USER test2@localhost;
--echo # MYSQL 8
--echo #
--enable_prepare_warnings
SELECT 1 FROM DUAL LIMIT 1 INTO @var FOR UPDATE;
SELECT 1 FROM DUAL LIMIT 1 FOR UPDATE INTO @var;
@ -159,3 +160,4 @@ SELECT 1 FROM DUAL LIMIT 1 INTO @var FOR UPDATE INTO @var;
SELECT 1 UNION SELECT 1 FOR UPDATE INTO @var;
SELECT 1 UNION SELECT 1 INTO @var FOR UPDATE;
--disable_prepare_warnings

View File

@ -2200,8 +2200,10 @@ DROP TABLE tm1, t1;
CREATE TABLE t1 (c1 INT) ENGINE=MyISAM;
CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1)
INSERT_METHOD=LAST;
--enable_prepare_warnings
CREATE TRIGGER tm1_ai AFTER INSERT ON tm1
FOR EACH ROW SELECT max(c1) FROM t1 INTO @var;
--disable_prepare_warnings
LOCK TABLE tm1 WRITE, t1 WRITE;
INSERT INTO tm1 VALUES (1);
SELECT * FROM tm1;
@ -2223,8 +2225,10 @@ CREATE TABLE t4 (c1 INT) ENGINE=MyISAM;
CREATE TABLE t5 (c1 INT) ENGINE=MyISAM;
CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2,t3,t4,t5)
INSERT_METHOD=LAST;
--enable_prepare_warnings
CREATE TRIGGER t2_au AFTER UPDATE ON t2
FOR EACH ROW SELECT MAX(c1) FROM t1 INTO @var;
--disable_prepare_warnings
CREATE FUNCTION f1() RETURNS INT
RETURN (SELECT MAX(c1) FROM t4);
LOCK TABLE tm1 WRITE, t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE, t5 WRITE;

View File

@ -48,10 +48,12 @@ let $wait_condition=
INFO = "INSERT INTO t1(id) SELECT id FROM t2";
--source include/wait_condition.inc
--enable_prepare_warnings
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_in_enable_indexes' AND
INFO = "INSERT INTO t1(id) SELECT id FROM t2"
INTO @thread_id;
--disable_prepare_warnings
KILL QUERY @thread_id;
CHECK TABLE t1;

View File

@ -1036,10 +1036,12 @@ begin
return f1;
end //
--enable_prepare_warnings
CREATE PROCEDURE bug9056_proc2(OUT a INT)
BEGIN
select sum(id) from t1 into a;
END //
--disable_prepare_warnings
DELIMITER ;//

View File

@ -318,7 +318,9 @@ SELECT NOT NOT NULLIF(2,3);
--echo #
--echo # MDEV-7146 NULLIF returns unexpected result with a YEAR field
--echo #
--enable_prepare_warnings
CREATE TABLE t1 (a YEAR(2));
--disable_prepare_warnings
INSERT INTO t1 VALUES (0);
SELECT a,NULLIF(a,2000),NULLIF(2000,a) FROM t1;
SELECT a,NULLIF(a,2001),NULLIF(2001,a) FROM t1;

View File

@ -2,6 +2,8 @@
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
--enable_prepare_warnings
--echo #
--echo # Bug#31663 FIELDS TERMINATED BY special character
--echo #
@ -289,6 +291,6 @@ SELECT LENGTH(a) FROM t2;
DROP TABLE t1, t2;
--disable_prepare_warnings
###########################################################################
--echo # End of 5.1 tests.

View File

@ -885,6 +885,7 @@ SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 FOR UPDATE;
--echo # "INTO" clause tests
--enable_prepare_warnings
SELECT 1 FROM t1 INTO @var17727401;
SELECT 1 FROM DUAL INTO @var17727401;
SELECT 1 INTO @var17727401;
@ -924,6 +925,7 @@ SELECT 1 FROM t1 INTO @var17727401 UNION SELECT 1 FROM t1 INTO t1;
SELECT 1 FROM t1 UNION SELECT 1 FROM t1 INTO @var17727401;
--disable_prepare_warnings
--error ER_PARSE_ERROR
SELECT 1 INTO @var17727401 FROM t1 PROCEDURE ANALYSE();

View File

@ -350,10 +350,12 @@ ENGINE=Memory;
ALTER TABLE t1 ENGINE=NonExistentEngine;
# OK to only specify one partitions engine, since it is already assigned at
# table level (after create, it is specified on all levels and all parts).
--enable_prepare_warnings
ALTER TABLE t1
PARTITION BY HASH (a)
(PARTITION p0 ENGINE=Memory,
PARTITION p1 ENGINE=NonExistentEngine);
--disable_prepare_warnings
ALTER TABLE t1 ENGINE=NonExistentEngine;
SHOW CREATE TABLE t1;
DROP TABLE t1;

View File

@ -5,6 +5,7 @@
DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp;
--enable_warnings
--enable_prepare_warnings
--echo #
--echo # Bug#11894100: EXCHANGE PARTITION CAN'T BE EXECUTED IF
--echo # ROW_FORMAT WAS SET EXPLICITLY
@ -536,3 +537,4 @@ ALTER TABLE t2 REMOVE PARTITIONING;
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
DROP TABLE t1, t2;
--disable_prepare_warnings

View File

@ -355,7 +355,9 @@ eval $get_handler_status_counts;
--echo #
SELECT * FROM t1 PARTITION (pNeg, `p10-99`);
FLUSH STATUS;
--enable_prepare_warnings
SELECT * FROM t1 PARTITION (pNeg, `p10-99`) INTO OUTFILE 'loadtest.txt';
--disable_prepare_warnings
eval $get_handler_status_counts;
--echo # 1 commit
--echo # 10 locks (1 ha_partition + 4 ha_innobase) x 2 (lock/unlock)

View File

@ -63,6 +63,7 @@ drop view if exists v1, v2;
TRUNCATE TABLE mysql.general_log;
delimiter |;
--enable_prepare_warnings
create procedure p_verify_reprepare_count(expected int)
begin
declare old_reprepare_count int default @reprepare_count;
@ -80,6 +81,7 @@ begin
select '' as "SUCCESS";
end if;
end|
--disable_prepare_warnings
delimiter ;|
set @reprepare_count= 0;
flush status;
@ -902,14 +904,18 @@ begin
return x;
end|
delimiter ;|
--enable_prepare_warnings
create procedure p1(out x int) select max(a) from t1 into x;
--disable_prepare_warnings
prepare stmt from "select * from v1";
execute stmt;
execute stmt;
call p_verify_reprepare_count(0);
drop procedure p1;
--enable_prepare_warnings
create procedure p1(out x int) select max(a) from t2 into x;
--disable_prepare_warnings
--echo # XXX: used to be a bug. The prelocked list was not invalidated
--echo # and we kept opening table t1, whereas the procedure
--echo # is now referring to table t2

View File

@ -30,6 +30,7 @@ drop view if exists t1;
drop schema if exists mysqltest;
--enable_warnings
--enable_prepare_warnings
delimiter |;
create procedure p_verify_reprepare_count(expected int)
begin
@ -48,6 +49,7 @@ begin
select '' as "SUCCESS";
end if;
end|
--disable_prepare_warnings
delimiter ;|
set @reprepare_count= 0;
flush status;

View File

@ -432,10 +432,12 @@ drop table t1;
create table t1 (a int);
insert into t1 values (1),(2),(3);
show status like "Qcache_queries_in_cache";
--enable_prepare_warnings
select * from t1 into outfile "query_cache.out.file";
--error ER_FILE_EXISTS_ERROR
select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
--disable_prepare_warnings
show status like "Qcache_queries_in_cache";
drop table t1;
let $datadir=`select @@datadir`;
@ -812,12 +814,14 @@ end//
call p1()//
drop procedure p1//
--enable_prepare_warnings
create function f1() returns int
begin
Declare var1 int;
select max(a) from t1 into var1;
return var1;
end//
--disable_prepare_warnings
create procedure `p1`()
begin
select a, f1() from t1;

View File

@ -3525,7 +3525,9 @@ CREATE VIEW v1 AS SELECT 1 AS ` `;
--error 1166
CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `);
--enable_prepare_warnings
CREATE VIEW v1 AS SELECT 1 AS ` x`;
--disable_prepare_warnings
SELECT `x` FROM v1;
--error 1166

View File

@ -67,6 +67,8 @@ delimiter $$;
--echo # Schema integrity enforcement
--echo #
--enable_prepare_warnings
create procedure check_pk_person(in person_type char, in id integer)
begin
declare x integer;
@ -158,6 +160,8 @@ begin
end
$$
--disable_prepare_warnings
create trigger po_order_bi before insert on po_order
for each row
begin

View File

@ -1006,6 +1006,7 @@ DROP TABLE t1;
--echo # SELECT INTO + cursor ROW TYPE variable with a wrong column count
--echo #
--enable_prepare_warnings
CREATE TABLE t1 (a INT, b VARCHAR(32));
INSERT INTO t1 VALUES (10,'b10');
DELIMITER $$;
@ -1068,6 +1069,8 @@ CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
--disable_prepare_warnings
--echo #
--echo # End of MDEV-12461 TYPE OF and ROW TYPE OF anchored data types
--echo #

View File

@ -11,6 +11,8 @@
--echo # Referring to a table in a non-existing database
--echo #
--enable_prepare_warnings
DELIMITER $$;
CREATE PROCEDURE p1()
BEGIN
@ -881,3 +883,4 @@ END;
$$
DELIMITER ;$$
DROP TABLE t1;
--disable_prepare_warnings

View File

@ -659,6 +659,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, b VARCHAR(10),c DATETIME(3));
INSERT INTO t1 VALUES (1,'b1','2001-01-01 10:20:30.123');
DELIMITER $$;
--enable_prepare_warnings
CREATE PROCEDURE p1()
BEGIN
DECLARE v_a TYPE OF t1.a;
@ -669,6 +670,7 @@ BEGIN
END;
$$
DELIMITER ;$$
--disable_prepare_warnings
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;

View File

@ -8,6 +8,7 @@ insert into t1 values (1),(2),(3);
let $body=`select repeat('select count(*) into out1 from t1;\n', 3072)`;
--enable_prepare_warnings
delimiter //;
--disable_query_log
eval select length('$body') as length//
@ -16,6 +17,7 @@ begin
$body
end//
--enable_query_log
--disable_prepare_warnings
delimiter ;//
@ -98,6 +100,7 @@ create table t1 (
) default collate=latin1_bin;
delimiter //;
--enable_prepare_warnings
create procedure select_test()
begin
declare id1_cond int;
@ -107,6 +110,7 @@ begin
set id1_cond = id1_cond + 1;
end while;
end//
--disable_prepare_warnings
delimiter ;//
insert t1 select seq, seq, 1, 1, seq, seq, seq from seq_1_to_2000;

View File

@ -9,9 +9,10 @@ drop table if exists t1, t2;
--enable_warnings
# Backup the mysql.proc table
--enable_prepare_warnings
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval SELECT * FROM mysql.proc INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/proc.txt';
--disable_prepare_warnings
# Make sure we don't have any procedures left.
delete from mysql.proc;
@ -42,8 +43,10 @@ drop table if exists t3|
create table t3 ( x int )|
insert into t3 values (2), (3)|
--enable_prepare_warnings
create procedure bad_into(out param int)
select x from t3 into param|
--disable_prepare_warnings
--error 1172
call bad_into(@x)|
@ -3797,12 +3800,14 @@ delimiter |;
--echo # because SIGNAL would raise SQL-error in that case.
--echo
--enable_prepare_warnings
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE v VARCHAR(5) DEFAULT -1;
SELECT b FROM t1 WHERE a = 2 INTO v;
RETURN v;
END|
--disable_prepare_warnings
--echo
--echo # Here we check that the NOT_FOUND condition raised in f1()

View File

@ -12,6 +12,8 @@ drop function if exists x;
drop function if exists y;
--enable_warnings
--enable_prepare_warnings
create function a() returns int
return 1;
@ -97,6 +99,8 @@ SELECT geometrycollection();
--enable_warnings
DROP FUNCTION geometrycollection;
--disable_prepare_warnings
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -522,6 +522,7 @@ select @@session.max_heap_table_size|
--disable_warnings
create table t3 (a char(255)) engine=InnoDB|
--enable_warnings
--enable_prepare_warnings
create procedure bug14210_fill_table()
begin
declare table_size, max_table_size int default 0;
@ -533,6 +534,7 @@ begin
select count(*)*255 from t3 into table_size;
until table_size > max_table_size*2 end repeat;
end|
--disable_prepare_warnings
--disable_warnings
call bug14210_fill_table()|
--enable_warnings

View File

@ -22,6 +22,7 @@ CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=
insert into t2 values (1,1)|
--enable_prepare_warnings
create function bug23333()
RETURNS int(11)
DETERMINISTIC
@ -31,6 +32,7 @@ begin
return @a;
end|
delimiter ;|
--disable_prepare_warnings
reset master;
--error ER_DUP_ENTRY

View File

@ -47,7 +47,9 @@ create index Language on CountryLanguage(Language);
create index CityName on City(Name);
alter table City change population population int(11) null default 0;
--enable_prepare_warnings
select max(id) from City into @max_city_id;
--disable_prepare_warnings
insert into City values (@max_city_id + 1,'Kilifarevo','BGR',NULL);

View File

@ -53,7 +53,9 @@ create index Language on CountryLanguage(Language);
create index CityName on City(Name);
alter table City change population population int(11) null default 0;
--enable_prepare_warnings
select max(id) from City into @max_city_id;
--disable_prepare_warnings
insert into City values (@max_city_id + 1,'Kilifarevo','BGR',NULL);

View File

@ -243,7 +243,9 @@ SELECT TIMESTAMP('2001-01-01 10:10:10.123456xyz');
SELECT TIMESTAMP('2001-01-01 10:10:10.1234567xyz');
CREATE TABLE t1 (a TIME(6));
--enable_prepare_warnings
INSERT INTO t1 VALUES (TIME'10:20:30.1234567');
--disable_prepare_warnings
INSERT INTO t1 VALUES (TIME('10:20:30.1234567'));
SELECT * FROM t1;
DROP TABLE t1;

View File

@ -761,6 +761,7 @@ drop table t1;
create table t1 (id int, data int, username varchar(16));
insert into t1 (id, data) values (1, 0);
--enable_prepare_warnings
delimiter |;
create trigger t1_whoupdated before update on t1 for each row
begin
@ -771,6 +772,7 @@ begin
select count(*) from ((select 1) union (select 2)) as d1 into i;
end|
delimiter ;|
--disable_prepare_warnings
update t1 set data = 1;
connection addconroot1;
@ -2343,6 +2345,7 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (b VARCHAR(50) NOT NULL);
CREATE TABLE t2 (a VARCHAR(10) NOT NULL DEFAULT '');
--enable_prepare_warnings
delimiter //;
CREATE TRIGGER trg1 AFTER INSERT ON t2
FOR EACH ROW BEGIN
@ -2350,6 +2353,7 @@ FOR EACH ROW BEGIN
(@bug51650 IS NULL OR @bug51650 != c.b) AND c.b = NEW.a LIMIT 1 INTO @foo;
END//
delimiter ;//
--disable_prepare_warnings
SET @bug51650 = 1;
INSERT IGNORE INTO t2 VALUES();

View File

@ -526,14 +526,18 @@ CREATE TABLE b15776 (a char(4294967296));
## When we complain about it, we say that the max is 255. We may be
## talking about different things. It's confusing.
--replace_result 4294967295 ? 0 ?
--enable_prepare_warnings
CREATE TABLE b15776 (a year(4294967295));
--disable_prepare_warnings
INSERT INTO b15776 VALUES (42);
SELECT * FROM b15776;
DROP TABLE b15776;
CREATE TABLE b15776 (a year(4294967296));
SHOW CREATE TABLE b15776;
DROP TABLE b15776;
--enable_prepare_warnings
CREATE TABLE b15776 (a year(0)); # 0 is special case, means default size
--disable_prepare_warnings
DROP TABLE b15776;
--error ER_PARSE_ERROR
CREATE TABLE b15776 (a year(-2));

View File

@ -1339,9 +1339,11 @@ DESC t1;
SELECT * FROM t1;
DROP TABLE t1;
--enable_prepare_warnings
CREATE TABLE t1 SELECT
/* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001
AS c1;
--disable_prepare_warnings
DESC t1;
SELECT * FROM t1;
DROP TABLE t1;

View File

@ -2,6 +2,8 @@
# Test year
#
--enable_prepare_warnings
create table t1 (y year,y2 year(2));
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1;
@ -372,7 +374,7 @@ SELECT MAX(NULLIF(a, 1970)) AS f FROM t1;
--enable_ps_protocol
DROP TABLE t1;
--disable_prepare_warnings
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -987,7 +987,9 @@ DROP TABLE t1;
(select 1) union (select 1 into @var);
--error ER_PARSE_ERROR
(select 2) union (select 1 into @var);
--enable_prepare_warnings
(select 1) union (select 1) into @var;
--disable_prepare_warnings
--error ER_TOO_MANY_ROWS
(select 2) union (select 1) into @var;
@ -1115,9 +1117,11 @@ SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
--error ER_PARSE_ERROR
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
--enable_prepare_warnings
SELECT a FROM t1 UNION SELECT a FROM t1 INTO @v ;
SELECT a FROM t1 UNION SELECT a FROM t1 INTO OUTFILE 'union.out.file5';
SELECT a FROM t1 UNION SELECT a FROM t1 INTO OUTFILE 'union.out.file6';
--disable_prepare_warnings
--error ER_PARSE_ERROR
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
--error ER_PARSE_ERROR

View File

@ -7,7 +7,9 @@
-- source include/have_log_bin.inc
-- source include/have_perfschema.inc
--enable_prepare_warnings
select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key;
--disable_prepare_warnings
show columns from information_schema.client_statistics;
show columns from information_schema.user_statistics;
show columns from information_schema.index_statistics;

View File

@ -2292,6 +2292,7 @@ CREATE VIEW v1 AS SELECT 42 AS Meaning;
DROP FUNCTION IF EXISTS f1;
--enable_warnings
DELIMITER //;
--enable_prepare_warnings
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE retn INTEGER;
@ -2300,6 +2301,7 @@ BEGIN
END
//
DELIMITER ;//
--disable_prepare_warnings
CREATE VIEW v2 AS SELECT f1();
select * from v2;
drop view v2,v1;
@ -2476,6 +2478,7 @@ drop view t1, v1;
# using SP function
create table t1 (a int);
delimiter //;
--enable_prepare_warnings
create function f1() returns int
begin
declare mx int;
@ -2483,6 +2486,7 @@ begin
return mx;
end//
delimiter ;//
--disable_prepare_warnings
create view v1 as select f1() as a;
create view v2 as select * from v1;
drop table t1;
@ -3117,12 +3121,13 @@ DROP VIEW IF EXISTS v1;
let $query = SELECT * FROM (SELECT 1) AS t into @w;
--enable_prepare_warnings
eval $query;
--error ER_PARSE_ERROR
eval CREATE VIEW v1 AS $query;
--echo # Previously the following would fail.
eval $query;
--disable_prepare_warnings
#
# Bug#24532 The return data type of IS TRUE is different from similar operations
@ -3885,11 +3890,13 @@ CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
delimiter //;
--enable_prepare_warnings
CREATE FUNCTION f1() RETURNS INT
BEGIN
SELECT a FROM v2 INTO @a;
RETURN @a;
END//
--disable_prepare_warnings
delimiter ;//
--echo # Trigger pre-locking when opening v2.

View File

@ -494,10 +494,12 @@ create table t2 (s1 int);
--disable_warnings
drop function if exists f2;
--enable_warnings
--enable_prepare_warnings
delimiter //;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
delimiter ;//
--disable_prepare_warnings
create algorithm=TEMPTABLE view v1 as select f2() from t1;
create algorithm=MERGE view v2 as select f2() from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
@ -548,10 +550,12 @@ create table t2 (s1 int);
--disable_warnings
drop function if exists f2;
--enable_warnings
--enable_prepare_warnings
delimiter //;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
delimiter ;//
--disable_prepare_warnings
create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant execute on function f2 to mysqltest_1@localhost;