diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/lib/init_db.sql | 8 | ||||
-rw-r--r-- | mysql-test/r/mysqltest.result | 2 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 18 | ||||
-rw-r--r-- | mysql-test/t/information_schema.test | 40 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 11 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 294 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 7 | ||||
-rw-r--r-- | mysql-test/t/view.test | 9 |
8 files changed, 209 insertions, 180 deletions
diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index fa02b350425..a71de229ee9 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -504,7 +504,7 @@ comment='Procedure privileges'; CREATE TABLE proc ( - db char(64) binary DEFAULT '' NOT NULL, + db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, @@ -519,7 +519,7 @@ CREATE TABLE proc ( param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, body blob DEFAULT '' NOT NULL, - definer char(77) binary DEFAULT '' NOT NULL, + definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( @@ -554,6 +554,6 @@ CREATE TABLE proc ( 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, - comment char(64) binary DEFAULT '' NOT NULL, + comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) -) comment='Stored Procedures'; +) character set utf8 comment='Stored Procedures'; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 2b171229096..256576704b5 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -164,3 +164,5 @@ root@localhost . - is longer then 80 characters and . - consists of several lines -------------------------------------------------------------------------------- +this will be executed +this will be executed diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 8ab591e18d0..7307f911dbf 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -526,14 +526,14 @@ ERROR HY000: Variable 'warning_count' is a read only variable set @@global.error_count=1; ERROR HY000: Variable 'error_count' is a read only variable set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index a8fc75f8aa4..cfbd86a018f 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -249,25 +249,27 @@ flush privileges; # QQ This results in NULLs instead of the version numbers when # QQ a LOCK TABLES is in effect when selecting from -# QQ information_schema.tables. Until this bug has been fixed, -# QQ this test is disabled /pem -#delimiter //; -#create procedure px5 () -#begin -#declare v int; -#declare c cursor for select version from -#information_schema.tables where table_schema <> 'information_schema'; -#open c; -#fetch c into v; -#select v; -#close c; -#end;// -# -#call px5()// -#call px5()// -#delimiter ;// -#select sql_mode from information_schema.ROUTINES; -#drop procedure px5; +# QQ information_schema.tables. + +--disable_parsing until bug is fixes +delimiter //; +create procedure px5 () +begin +declare v int; +declare c cursor for select version from +information_schema.tables where table_schema <> 'information_schema'; +open c; +fetch c into v; +select v; +close c; +end;// + +call px5()// +call px5()// +delimiter ;// +select sql_mode from information_schema.ROUTINES; +drop procedure px5; +--enable_parsing create table t1 (a int not null auto_increment,b int, primary key (a)); insert into t1 values (1,1),(NULL,3),(NULL,4); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 29588419642..08e51aadc24 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -324,3 +324,14 @@ let $message= . Here comes a very very long message that . - consists of several lines; --source include/show_msg80.inc +# +# Test --enable_parsning / disable_parsning +# +--disable_query_log +--disable_parsing +# The following will not enable query logging +--enable_query_log +select "this will not be executed"; +--enable_parsing +select "this will be executed"; +--enable_query_log diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 1a35df40a17..9e41cd23d4b 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1232,12 +1232,14 @@ begin end| select f5(1)| # This should generate an error about insuficient number of tables locked -# Nuw this crash server, comented until bug#11394 fix -#--error 1100 -#select f5(2)| +# Now this crash server +--disable_parsing until bug#11394 fix +--error 1100 +select f5(2)| # But now it simply miserably fails because we are trying to use the same # lex on the next iteration :/ It should generate some error too... -# select f5(3)| +select f5(3)| +--enable_parsing # OTOH this should work create function f6() returns int @@ -1285,9 +1287,11 @@ create function f1() returns int return (select sum(data) from t1) + (select sum(data) from v1)| # This queries will crash server because we can't use LEX in # reenterable fashion yet. Patch disabling recursion will heal this. -#select f1()| -#select * from v1| -#select * from v2| +--disable_parsing +select f1()| +select * from v1| +select * from v2| +--enable_parsing # Back to the normal cases drop function f1| create function f1() returns int @@ -1499,54 +1503,55 @@ show procedure status like '%p%'| # # This part of test is disabled until we implement support for # recursive stored procedures. -#--disable_warnings -#drop table if exists fib| -#--enable_warnings -#create table fib ( f bigint unsigned not null )| -# -## We deliberately do it the awkward way, fetching the last two -## values from the table, in order to exercise various statements -## and table accesses at each turn. -#--disable_warnings -#drop procedure if exists fib| -#--enable_warnings -#create procedure fib(n int unsigned) -#begin -# if n > 1 then -# begin -# declare x, y bigint unsigned; -# declare c cursor for select f from fib order by f desc limit 2; -# -# open c; -# fetch c into y; -# fetch c into x; -# close c; -# insert into fib values (x+y); -# call fib(n-1); -# end; -# end if; -#end| -# -## Minimum test: recursion of 3 levels -# -#insert into fib values (0), (1)| -# -#call fib(3)| -# -#select * from fib order by f asc| -# -#delete from fib| -# -## Original test: 20 levels (may run into memory limits!) -# -#insert into fib values (0), (1)| -# -#call fib(20)| -# -#select * from fib order by f asc| -#drop table fib| -#drop procedure fib| +--disable_parsing +--disable_warnings +drop table if exists fib| +--enable_warnings +create table fib ( f bigint unsigned not null )| +# We deliberately do it the awkward way, fetching the last two +# values from the table, in order to exercise various statements +# and table accesses at each turn. +--disable_warnings +drop procedure if exists fib| +--enable_warnings +create procedure fib(n int unsigned) +begin + if n > 1 then + begin + declare x, y bigint unsigned; + declare c cursor for select f from fib order by f desc limit 2; + + open c; + fetch c into y; + fetch c into x; + close c; + insert into fib values (x+y); + call fib(n-1); + end; + end if; +end| + +# Minimum test: recursion of 3 levels + +insert into fib values (0), (1)| + +call fib(3)| + +select * from fib order by f asc| + +delete from fib| + +# Original test: 20 levels (may run into memory limits!) + +insert into fib values (0), (1)| + +call fib(20)| + +select * from fib order by f asc| +drop table fib| +drop procedure fib| +--enable_parsing # # Comment & suid @@ -1830,49 +1835,51 @@ drop procedure bug2260| # FIXME: Other solution would be to use preopened proc table # instead of opening it anew. # -#--disable_warnings -#drop procedure if exists bug2267_1| -#--enable_warnings -#create procedure bug2267_1() -#begin -# show procedure status; -#end| -# -#--disable_warnings -#drop procedure if exists bug2267_2| -#--enable_warnings -#create procedure bug2267_2() -#begin -# show function status; -#end| -# -#--disable_warnings -#drop procedure if exists bug2267_3| -#--enable_warnings -#create procedure bug2267_3() -#begin -# show create procedure bug2267_1; -#end| -# -#--disable_warnings -#drop procedure if exists bug2267_4| -#--enable_warnings -#create procedure bug2267_4() -#begin -# show create function fac; -#end| -# -#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' -#call bug2267_1()| -#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' -#call bug2267_2()| -#call bug2267_3()| -#call bug2267_4()| -# -#drop procedure bug2267_1| -#drop procedure bug2267_2| -#drop procedure bug2267_3| -#drop procedure bug2267_4| +--disable_parsing +--disable_warnings +drop procedure if exists bug2267_1| +--enable_warnings +create procedure bug2267_1() +begin + show procedure status; +end| + +--disable_warnings +drop procedure if exists bug2267_2| +--enable_warnings +create procedure bug2267_2() +begin + show function status; +end| + +--disable_warnings +drop procedure if exists bug2267_3| +--enable_warnings +create procedure bug2267_3() +begin + show create procedure bug2267_1; +end| + +--disable_warnings +drop procedure if exists bug2267_4| +--enable_warnings +create procedure bug2267_4() +begin + show create function fac; +end| + +--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' +call bug2267_1()| +--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' +call bug2267_2()| +call bug2267_3()| +call bug2267_4()| + +drop procedure bug2267_1| +drop procedure bug2267_2| +drop procedure bug2267_3| +drop procedure bug2267_4| +--enable_parsing # # BUG#2227 @@ -1901,23 +1908,25 @@ drop procedure bug2227| # QQ For this reason we can't run this test any more (i.e., if we modify # QQ it, it's no longer a test case for the bug), but we keep it here # QQ anyway, for tracability. -#--disable_warnings -#drop procedure if exists bug2614| -#--enable_warnings -#create procedure bug2614() -#begin -# drop temporary table if exists t3; -# create temporary table t3 (id int default '0' not null); -# insert into t3 select 12; -# insert into t3 select * from t3; -#end| -# -#--disable_warnings -#call bug2614()| -#--enable_warnings -#call bug2614()| -#drop temporary table t3| -#drop procedure bug2614| +--disable_parsing +--disable_warnings +drop procedure if exists bug2614| +--enable_warnings +create procedure bug2614() +begin + drop temporary table if exists t3; + create temporary table t3 (id int default '0' not null); + insert into t3 select 12; + insert into t3 select * from t3; +end| + +--disable_warnings +call bug2614()| +--enable_warnings +call bug2614()| +drop temporary table t3| +drop procedure bug2614| +--enable_parsing # # BUG#2674 @@ -2508,27 +2517,29 @@ drop table t3| # BUG#4318 # #QQ Don't know if HANDLER commands can work with SPs, or at all... -#--disable_warnings -#drop table if exists t3| -#--enable_warnings -# -#create table t3 (s1 int)| -#insert into t3 values (3), (4)| -# -#--disable_warnings -#drop procedure if exists bug4318| -#--enable_warnings -#create procedure bug4318() -# handler t3 read next| -# -#handler t3 open| -## Expect no results, as tables are closed, but there shouldn't be any errors -#call bug4318()| -#call bug4318()| -#handler t3 close| -# -#drop procedure bug4318| -#drop table t3| +--disable_parsing +--disable_warnings +drop table if exists t3| +--enable_warnings + +create table t3 (s1 int)| +insert into t3 values (3), (4)| + +--disable_warnings +drop procedure if exists bug4318| +--enable_warnings +create procedure bug4318() + handler t3 read next| + +handler t3 open| +# Expect no results, as tables are closed, but there shouldn't be any errors +call bug4318()| +call bug4318()| +handler t3 close| + +drop procedure bug4318| +drop table t3| +--enable_parsing # # BUG#4902: Stored procedure with SHOW WARNINGS leads to packet error @@ -2563,11 +2574,13 @@ begin show variables like 'foo'; show warnings; end| -#show binlog events; -#show storage engines; -#show master status; -#show slave hosts; -#show slave status; +--disable_parsing +show binlog events; +show storage engines; +show master status; +show slave hosts; +show slave status; +--enable_parsing call bug4902()| call bug4902()| @@ -3912,7 +3925,6 @@ drop table t3| #--enable_warnings #create procedure bugNNNN... - # Add bugs above this line. Use existing tables t1 and t2 when # practical, or create table t3, t4 etc temporarily (and drop them). delimiter ;| diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 1dae1812347..f606d80e317 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -413,8 +413,9 @@ set @@global.error_count=1; # Bug #10351: Setting max_heap_table_size to 4G fails # set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; + diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 5454b3409da..b278383ecef 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -147,10 +147,11 @@ insert into t1 values (1), (2), (3); create view v1 (a) as select a+1 from t1; create view v2 (a) as select a-1 from t1; -# WL #2486 should enable these tests -#select * from t1 natural left join v1; -#select * from v2 natural left join t1; -#select * from v2 natural left join v1; +--disable_parsing WL #2486 should enable these tests +select * from t1 natural left join v1; +select * from v2 natural left join t1; +select * from v2 natural left join v1; +--enable_parsing drop view v1, v2; drop table t1; |