mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk@192.168.21.1:mysql-5.1-new into mysql.com:/home/hf/work/5.1.emb
mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged sql/mysqld.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged
This commit is contained in:
@ -712,6 +712,8 @@ sub command_line_setup () {
|
||||
$glob_use_embedded_server= 1;
|
||||
push(@glob_test_mode, "embedded");
|
||||
$opt_skip_rpl= 1; # We never run replication with embedded
|
||||
$opt_skip_ndbcluster= 1; # Avoid auto detection
|
||||
$opt_skip_ssl= 1;
|
||||
|
||||
if ( $opt_extern )
|
||||
{
|
||||
|
@ -318,6 +318,8 @@ while test $# -gt 0; do
|
||||
USE_EMBEDDED_SERVER=1
|
||||
USE_MANAGER=0 NO_SLAVE=1
|
||||
USE_RUNNING_SERVER=0
|
||||
USE_NDBCLUSTER=""
|
||||
USE_NDBCLUSTER_SLAVE=""
|
||||
TEST_MODE="$TEST_MODE embedded" ;;
|
||||
--purify)
|
||||
USE_PURIFY=1
|
||||
|
17
mysql-test/r/ctype_cp932_notembedded.result
Normal file
17
mysql-test/r/ctype_cp932_notembedded.result
Normal file
@ -0,0 +1,17 @@
|
||||
drop table if exists t1;
|
||||
set names cp932;
|
||||
set character_set_database = cp932;
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1(f1 blob);
|
||||
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
|
||||
SET @var1= x'8300';
|
||||
EXECUTE stmt1 USING @var1;
|
||||
SHOW BINLOG EVENTS FROM 102;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob)
|
||||
master-bin.000001 # Table_map 1 # test.t1
|
||||
master-bin.000001 # Write_rows 1 #
|
||||
SELECT HEX(f1) FROM t1;
|
||||
HEX(f1)
|
||||
8300
|
||||
DROP table t1;
|
@ -2635,25 +2635,6 @@ checksum table t1;
|
||||
Table Checksum
|
||||
test.t1 2050879373
|
||||
drop table t1;
|
||||
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
|
||||
insert t1 values (1,100);
|
||||
create function f1 () returns integer begin
|
||||
declare var1 int;
|
||||
select col2 into var1 from t1 where col1=1 for update;
|
||||
return var1;
|
||||
end|
|
||||
start transaction;
|
||||
select f1();
|
||||
f1()
|
||||
100
|
||||
update t1 set col2=0 where col1=1;
|
||||
select * from t1;
|
||||
col1 col2
|
||||
1 100
|
||||
rollback;
|
||||
rollback;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
create table t1 (
|
||||
a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
|
||||
) character set utf8 engine = innodb;
|
||||
|
19
mysql-test/r/innodb_notembedded.result
Normal file
19
mysql-test/r/innodb_notembedded.result
Normal file
@ -0,0 +1,19 @@
|
||||
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
|
||||
insert t1 values (1,100);
|
||||
create function f1 () returns integer begin
|
||||
declare var1 int;
|
||||
select col2 into var1 from t1 where col1=1 for update;
|
||||
return var1;
|
||||
end|
|
||||
start transaction;
|
||||
select f1();
|
||||
f1()
|
||||
100
|
||||
update t1 set col2=0 where col1=1;
|
||||
select * from t1;
|
||||
col1 col2
|
||||
1 100
|
||||
rollback;
|
||||
rollback;
|
||||
drop table t1;
|
||||
drop function f1;
|
@ -1,6 +1,6 @@
|
||||
select -1 as "before_use_test" ;
|
||||
select 0 as "before_use_test" ;
|
||||
before_use_test
|
||||
-1
|
||||
0
|
||||
select otto from (select 1 as otto) as t1;
|
||||
otto
|
||||
1
|
||||
|
@ -1105,56 +1105,20 @@ call f1();
|
||||
s1
|
||||
s1
|
||||
s1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
call f1();
|
||||
s1
|
||||
s1
|
||||
s1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 3
|
||||
call f1();
|
||||
s1
|
||||
s1
|
||||
s1
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 4
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 4
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 6
|
||||
insert into t1 values (1);
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 5
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 6
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
@ -1172,15 +1136,6 @@ s1
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 4
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 8
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 10
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
|
@ -94,4 +94,224 @@ a
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
drop table t1;
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
create table t1 (s1 int)//
|
||||
create procedure f1 () begin
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1;
|
||||
end;//
|
||||
create procedure f2 () begin
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1;
|
||||
end;//
|
||||
create procedure f3 () begin
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
end;//
|
||||
create procedure f4 () begin
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
end;//
|
||||
call f1();
|
||||
s1
|
||||
s1
|
||||
s1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
call f1();
|
||||
s1
|
||||
s1
|
||||
s1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 3
|
||||
call f1();
|
||||
s1
|
||||
s1
|
||||
s1
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 4
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 4
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 6
|
||||
insert into t1 values (1);
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 5
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 6
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 4
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 8
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 10
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
1
|
||||
select sql_cache * from t1 where s1=1;
|
||||
s1
|
||||
1
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f2();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f3();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f4();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f4();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f3();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
call f2();
|
||||
s1
|
||||
1
|
||||
s1
|
||||
1
|
||||
select sql_cache * from t1 where s1=1;
|
||||
s1
|
||||
1
|
||||
insert into t1 values (2);
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
2
|
||||
select sql_cache * from t1 where s1=1;
|
||||
s1
|
||||
1
|
||||
select sql_cache * from t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
2
|
||||
call f3();
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
call f3();
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
call f1();
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
2
|
||||
s1
|
||||
1
|
||||
2
|
||||
drop procedure f1;
|
||||
drop procedure f2;
|
||||
drop procedure f3;
|
||||
drop procedure f4;
|
||||
drop table t1;
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
@ -464,19 +464,6 @@ create table t5 (x int)|
|
||||
call bug3294()|
|
||||
ERROR 42S02: Unknown table 't5'
|
||||
drop procedure bug3294|
|
||||
drop procedure if exists bug6807|
|
||||
create procedure bug6807()
|
||||
begin
|
||||
declare id int;
|
||||
set id = connection_id();
|
||||
kill query id;
|
||||
select 'Not reached';
|
||||
end|
|
||||
call bug6807()|
|
||||
ERROR 70100: Query execution was interrupted
|
||||
call bug6807()|
|
||||
ERROR 70100: Query execution was interrupted
|
||||
drop procedure bug6807|
|
||||
drop procedure if exists bug8776_1|
|
||||
drop procedure if exists bug8776_2|
|
||||
drop procedure if exists bug8776_3|
|
||||
|
@ -2142,7 +2142,6 @@ show create database test;
|
||||
show databases like 'foo';
|
||||
show errors;
|
||||
show columns from t1;
|
||||
show grants for 'root'@'localhost';
|
||||
show keys from t1;
|
||||
show open tables like 'foo';
|
||||
show privileges;
|
||||
@ -2169,8 +2168,6 @@ Level Code Message
|
||||
Field Type Null Key Default Extra
|
||||
id char(16) NO
|
||||
data int(11) NO
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
Database Table In_use Name_locked
|
||||
Privilege Context Comment
|
||||
@ -2224,8 +2221,6 @@ Level Code Message
|
||||
Field Type Null Key Default Extra
|
||||
id char(16) NO
|
||||
data int(11) NO
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
Database Table In_use Name_locked
|
||||
Privilege Context Comment
|
||||
@ -2262,18 +2257,6 @@ Tables_in_test (foo)
|
||||
Variable_name Value
|
||||
Level Code Message
|
||||
drop procedure bug4902|
|
||||
drop procedure if exists bug4902_2|
|
||||
create procedure bug4902_2()
|
||||
begin
|
||||
show processlist;
|
||||
end|
|
||||
call bug4902_2()|
|
||||
Id User Host db Command Time State Info
|
||||
# root localhost test Query # NULL show processlist
|
||||
call bug4902_2()|
|
||||
Id User Host db Command Time State Info
|
||||
# root localhost test Query # NULL show processlist
|
||||
drop procedure bug4902_2|
|
||||
drop procedure if exists bug4904|
|
||||
create procedure bug4904()
|
||||
begin
|
||||
@ -2416,52 +2399,6 @@ select @x|
|
||||
NULL
|
||||
delete from t1|
|
||||
drop procedure bug4941|
|
||||
drop procedure if exists bug3583|
|
||||
drop procedure if exists bug3583|
|
||||
create procedure bug3583()
|
||||
begin
|
||||
declare c int;
|
||||
select * from t1;
|
||||
select count(*) into c from t1;
|
||||
select c;
|
||||
end|
|
||||
insert into t1 values ("x", 3), ("y", 5)|
|
||||
set @x = @@query_cache_size|
|
||||
set global query_cache_size = 10*1024*1024|
|
||||
flush status|
|
||||
flush query cache|
|
||||
show status like 'Qcache_hits'|
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
call bug3583()|
|
||||
id data
|
||||
x 3
|
||||
y 5
|
||||
c
|
||||
2
|
||||
show status like 'Qcache_hits'|
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
call bug3583()|
|
||||
id data
|
||||
x 3
|
||||
y 5
|
||||
c
|
||||
2
|
||||
call bug3583()|
|
||||
id data
|
||||
x 3
|
||||
y 5
|
||||
c
|
||||
2
|
||||
show status like 'Qcache_hits'|
|
||||
Variable_name Value
|
||||
Qcache_hits 2
|
||||
set global query_cache_size = @x|
|
||||
flush status|
|
||||
flush query cache|
|
||||
delete from t1|
|
||||
drop procedure bug3583|
|
||||
drop procedure if exists bug4905|
|
||||
create table t3 (s1 int,primary key (s1))|
|
||||
drop procedure if exists bug4905|
|
||||
@ -2677,17 +2614,6 @@ select id, bug5240() from t1|
|
||||
id bug5240()
|
||||
answer 42
|
||||
drop function bug5240|
|
||||
drop function if exists bug5278|
|
||||
create function bug5278 () returns char
|
||||
begin
|
||||
SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
|
||||
return 'okay';
|
||||
end|
|
||||
select bug5278()|
|
||||
ERROR 42000: Can't find any matching row in the user table
|
||||
select bug5278()|
|
||||
ERROR 42000: Can't find any matching row in the user table
|
||||
drop function bug5278|
|
||||
drop procedure if exists p1|
|
||||
create table t3(id int)|
|
||||
insert into t3 values(1)|
|
||||
@ -4052,14 +3978,6 @@ select bug10100f(5)|
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
call bug10100t(5)|
|
||||
ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine bug10100p
|
||||
set @@max_sp_recursion_depth=255|
|
||||
set @var=1|
|
||||
call bug10100p(255, @var)|
|
||||
call bug10100pt(1,255)|
|
||||
call bug10100pv(1,255)|
|
||||
call bug10100pd(1,255)|
|
||||
call bug10100pc(1,255)|
|
||||
set @@max_sp_recursion_depth=0|
|
||||
deallocate prepare stmt2|
|
||||
drop function bug10100f|
|
||||
drop procedure bug10100p|
|
||||
|
206
mysql-test/r/sp_notembedded.result
Normal file
206
mysql-test/r/sp_notembedded.result
Normal file
@ -0,0 +1,206 @@
|
||||
drop procedure if exists bug4902|
|
||||
create procedure bug4902()
|
||||
begin
|
||||
show grants for 'root'@'localhost';
|
||||
end|
|
||||
call bug4902()|
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
call bug4902()|
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
drop procedure bug4902|
|
||||
drop procedure if exists bug4902_2|
|
||||
create procedure bug4902_2()
|
||||
begin
|
||||
show processlist;
|
||||
end|
|
||||
call bug4902_2()|
|
||||
Id User Host db Command Time State Info
|
||||
# root localhost test Query # NULL show processlist
|
||||
call bug4902_2()|
|
||||
Id User Host db Command Time State Info
|
||||
# root localhost test Query # NULL show processlist
|
||||
drop procedure bug4902_2|
|
||||
drop function if exists bug5278|
|
||||
create function bug5278 () returns char
|
||||
begin
|
||||
SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
|
||||
return 'okay';
|
||||
end|
|
||||
select bug5278()|
|
||||
ERROR 42000: Can't find any matching row in the user table
|
||||
select bug5278()|
|
||||
ERROR 42000: Can't find any matching row in the user table
|
||||
drop function bug5278|
|
||||
drop table if exists t1|
|
||||
create table t1 (
|
||||
id char(16) not null default '',
|
||||
data int not null
|
||||
)|
|
||||
drop procedure if exists bug3583|
|
||||
drop procedure if exists bug3583|
|
||||
create procedure bug3583()
|
||||
begin
|
||||
declare c int;
|
||||
select * from t1;
|
||||
select count(*) into c from t1;
|
||||
select c;
|
||||
end|
|
||||
insert into t1 values ("x", 3), ("y", 5)|
|
||||
set @x = @@query_cache_size|
|
||||
set global query_cache_size = 10*1024*1024|
|
||||
flush status|
|
||||
flush query cache|
|
||||
show status like 'Qcache_hits'|
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
call bug3583()|
|
||||
id data
|
||||
x 3
|
||||
y 5
|
||||
c
|
||||
2
|
||||
show status like 'Qcache_hits'|
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
call bug3583()|
|
||||
id data
|
||||
x 3
|
||||
y 5
|
||||
c
|
||||
2
|
||||
call bug3583()|
|
||||
id data
|
||||
x 3
|
||||
y 5
|
||||
c
|
||||
2
|
||||
show status like 'Qcache_hits'|
|
||||
Variable_name Value
|
||||
Qcache_hits 2
|
||||
set global query_cache_size = @x|
|
||||
flush status|
|
||||
flush query cache|
|
||||
delete from t1|
|
||||
drop procedure bug3583|
|
||||
drop table t1;
|
||||
#|
|
||||
drop procedure if exists bug6807|
|
||||
create procedure bug6807()
|
||||
begin
|
||||
declare id int;
|
||||
set id = connection_id();
|
||||
kill query id;
|
||||
select 'Not reached';
|
||||
end|
|
||||
call bug6807()|
|
||||
ERROR 70100: Query execution was interrupted
|
||||
call bug6807()|
|
||||
ERROR 70100: Query execution was interrupted
|
||||
drop procedure bug6807|
|
||||
drop function if exists bug10100f|
|
||||
drop procedure if exists bug10100p|
|
||||
drop procedure if exists bug10100t|
|
||||
drop procedure if exists bug10100pt|
|
||||
drop procedure if exists bug10100pv|
|
||||
drop procedure if exists bug10100pd|
|
||||
drop procedure if exists bug10100pc|
|
||||
create function bug10100f(prm int) returns int
|
||||
begin
|
||||
if prm > 1 then
|
||||
return prm * bug10100f(prm - 1);
|
||||
end if;
|
||||
return 1;
|
||||
end|
|
||||
create procedure bug10100p(prm int, inout res int)
|
||||
begin
|
||||
set res = res * prm;
|
||||
if prm > 1 then
|
||||
call bug10100p(prm - 1, res);
|
||||
end if;
|
||||
end|
|
||||
create procedure bug10100t(prm int)
|
||||
begin
|
||||
declare res int;
|
||||
set res = 1;
|
||||
call bug10100p(prm, res);
|
||||
select res;
|
||||
end|
|
||||
create table t3 (a int)|
|
||||
insert into t3 values (0)|
|
||||
create view v1 as select a from t3;
|
||||
create procedure bug10100pt(level int, lim int)
|
||||
begin
|
||||
if level < lim then
|
||||
update t3 set a=level;
|
||||
FLUSH TABLES;
|
||||
call bug10100pt(level+1, lim);
|
||||
else
|
||||
select * from t3;
|
||||
end if;
|
||||
end|
|
||||
create procedure bug10100pv(level int, lim int)
|
||||
begin
|
||||
if level < lim then
|
||||
update v1 set a=level;
|
||||
FLUSH TABLES;
|
||||
call bug10100pv(level+1, lim);
|
||||
else
|
||||
select * from v1;
|
||||
end if;
|
||||
end|
|
||||
prepare stmt2 from "select * from t3;";
|
||||
create procedure bug10100pd(level int, lim int)
|
||||
begin
|
||||
if level < lim then
|
||||
select level;
|
||||
prepare stmt1 from "update t3 set a=a+2";
|
||||
execute stmt1;
|
||||
FLUSH TABLES;
|
||||
execute stmt1;
|
||||
FLUSH TABLES;
|
||||
execute stmt1;
|
||||
FLUSH TABLES;
|
||||
deallocate prepare stmt1;
|
||||
execute stmt2;
|
||||
select * from t3;
|
||||
call bug10100pd(level+1, lim);
|
||||
else
|
||||
execute stmt2;
|
||||
end if;
|
||||
end|
|
||||
create procedure bug10100pc(level int, lim int)
|
||||
begin
|
||||
declare lv int;
|
||||
declare c cursor for select a from t3;
|
||||
open c;
|
||||
if level < lim then
|
||||
select level;
|
||||
fetch c into lv;
|
||||
select lv;
|
||||
update t3 set a=level+lv;
|
||||
FLUSH TABLES;
|
||||
call bug10100pc(level+1, lim);
|
||||
else
|
||||
select * from t3;
|
||||
end if;
|
||||
close c;
|
||||
end|
|
||||
set @@max_sp_recursion_depth=255|
|
||||
set @var=1|
|
||||
call bug10100p(255, @var)|
|
||||
call bug10100pt(1,255)|
|
||||
call bug10100pv(1,255)|
|
||||
call bug10100pd(1,255)|
|
||||
call bug10100pc(1,255)|
|
||||
set @@max_sp_recursion_depth=0|
|
||||
deallocate prepare stmt2|
|
||||
drop function bug10100f|
|
||||
drop procedure bug10100p|
|
||||
drop procedure bug10100t|
|
||||
drop procedure bug10100pt|
|
||||
drop procedure bug10100pv|
|
||||
drop procedure bug10100pd|
|
||||
drop procedure bug10100pc|
|
||||
drop view v1|
|
1
mysql-test/r/subselect_notembedded.result
Normal file
1
mysql-test/r/subselect_notembedded.result
Normal file
@ -0,0 +1 @@
|
||||
purge master logs before (select adddate(current_timestamp(), interval -4 day));
|
@ -2213,15 +2213,6 @@ r_object_id users_names
|
||||
120001a080000542 guser02
|
||||
drop view v1, v2;
|
||||
drop table t1, t2;
|
||||
create definer=some_user@`` sql security invoker view v1 as select 1;
|
||||
ERROR HY000: Definer is not fully qualified
|
||||
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
||||
Warnings:
|
||||
Note 1449 There is no 'some_user'@'localhost' registered
|
||||
show create view v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
|
||||
drop view v1;
|
||||
create table t1 (s1 int);
|
||||
create view abc as select * from t1 as abc;
|
||||
drop table t1;
|
||||
|
@ -520,3 +520,12 @@ use test;
|
||||
use test;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop database mysqltest;
|
||||
create definer=some_user@`` sql security invoker view v1 as select 1;
|
||||
ERROR HY000: Definer is not fully qualified
|
||||
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
||||
Warnings:
|
||||
Note 1449 There is no 'some_user'@'localhost' registered
|
||||
show create view v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
|
||||
drop view v1;
|
||||
|
@ -1,3 +1,6 @@
|
||||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# This test is a bit tricky as we can't use backup table to overwrite an old
|
||||
# table
|
||||
|
@ -1,5 +1,6 @@
|
||||
# This is a wrapper for binlog.test so that the same test case can be used
|
||||
# For both statement and row based bin logs 9/19/2005 [jbm]
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
-- source extra/binlog_tests/binlog.test
|
||||
|
@ -1,5 +1,6 @@
|
||||
# This is a wrapper for binlog.test so that the same test case can be used
|
||||
# For both statement and row based bin logs 9/19/2005 [jbm]
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
-- source extra/binlog_tests/blackhole.test
|
||||
|
@ -1,5 +1,6 @@
|
||||
# This is a wrapper for binlog.test so that the same test case can be used
|
||||
# For both statement and row based bin logs 9/19/2005 [jbm]
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
-- source extra/binlog_tests/ctype_cp932.test
|
||||
|
@ -1,6 +1,9 @@
|
||||
# Turn on compression between the client and server
|
||||
# and run a number of tests
|
||||
|
||||
# Can't test with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
-- source include/have_compress.inc
|
||||
|
||||
connect (comp_con,localhost,root,,,,,COMPRESS);
|
||||
|
@ -3,6 +3,9 @@
|
||||
# (Can't be tested with purify :( )
|
||||
#
|
||||
|
||||
# This tests not performed with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
@ -1,3 +1,5 @@
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
source include/federated.inc;
|
||||
|
||||
connection slave;
|
||||
|
@ -1,3 +1,5 @@
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
source include/have_archive.inc;
|
||||
source include/federated.inc;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
source include/federated.inc;
|
||||
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
source include/have_bdb.inc;
|
||||
source include/federated.inc;
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
# Test of flush table
|
||||
#
|
||||
|
||||
# Should work in embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
@ -2,6 +2,9 @@
|
||||
# test of HANDLER ...
|
||||
#
|
||||
|
||||
# should work in embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t3,t4,t5;
|
||||
--enable_warnings
|
||||
|
@ -2,6 +2,8 @@
|
||||
# Test of init_connect variable
|
||||
#
|
||||
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
connect (con0,localhost,root,,);
|
||||
connection con0;
|
||||
select hex(@a);
|
||||
|
@ -1576,33 +1576,7 @@ connection a;
|
||||
checksum table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
|
||||
# non-blocking SELECT
|
||||
#
|
||||
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
|
||||
insert t1 values (1,100);
|
||||
delimiter |;
|
||||
create function f1 () returns integer begin
|
||||
declare var1 int;
|
||||
select col2 into var1 from t1 where col1=1 for update;
|
||||
return var1;
|
||||
end|
|
||||
delimiter ;|
|
||||
start transaction;
|
||||
select f1();
|
||||
connection b;
|
||||
send update t1 set col2=0 where col1=1;
|
||||
connection default;
|
||||
select * from t1;
|
||||
connection a;
|
||||
rollback;
|
||||
connection b;
|
||||
reap;
|
||||
rollback;
|
||||
connection default;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
disconnect a;
|
||||
disconnect b;
|
||||
|
||||
|
36
mysql-test/t/innodb_notembedded.test
Normal file
36
mysql-test/t/innodb_notembedded.test
Normal file
@ -0,0 +1,36 @@
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
connect (a,localhost,root,,);
|
||||
connect (b,localhost,root,,);
|
||||
|
||||
|
||||
#
|
||||
# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
|
||||
# non-blocking SELECT
|
||||
#
|
||||
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
|
||||
insert t1 values (1,100);
|
||||
delimiter |;
|
||||
create function f1 () returns integer begin
|
||||
declare var1 int;
|
||||
select col2 into var1 from t1 where col1=1 for update;
|
||||
return var1;
|
||||
end|
|
||||
delimiter ;|
|
||||
start transaction;
|
||||
select f1();
|
||||
connection b;
|
||||
send update t1 set col2=0 where col1=1;
|
||||
connection default;
|
||||
select * from t1;
|
||||
connection a;
|
||||
rollback;
|
||||
connection b;
|
||||
reap;
|
||||
rollback;
|
||||
connection default;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
disconnect a;
|
||||
disconnect b;
|
@ -1,3 +1,5 @@
|
||||
# this test needs multithreaded mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
#
|
||||
# Basic log tables test
|
||||
#
|
||||
|
@ -1,3 +1,5 @@
|
||||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
#
|
||||
# Testing the MySQL command line client(mysql)
|
||||
#
|
||||
|
@ -1,3 +1,6 @@
|
||||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# We run with different binaries for normal and --embedded-server
|
||||
#
|
||||
# If this test fails with "command "$MYSQL_CLIENT_TEST" failed",
|
||||
|
@ -1,3 +1,5 @@
|
||||
# This test should work in embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# ============================================================================
|
||||
#
|
||||
|
@ -822,29 +822,14 @@ select sql_cache * from t1 where s1=1;
|
||||
end;//
|
||||
delimiter ;//
|
||||
call f1();
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
call f1();
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
call f1();
|
||||
select sql_cache * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
insert into t1 values (1);
|
||||
select sql_cache * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
call f1();
|
||||
call f1();
|
||||
select sql_cache * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
|
@ -97,4 +97,88 @@ connection root;
|
||||
SELECT * FROM t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# query in QC from normal execution and SP (BUG#6897)
|
||||
# improved to also test BUG#3583 and BUG#12990
|
||||
#
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
delimiter //;
|
||||
create table t1 (s1 int)//
|
||||
create procedure f1 () begin
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1;
|
||||
end;//
|
||||
create procedure f2 () begin
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1;
|
||||
end;//
|
||||
create procedure f3 () begin
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
end;//
|
||||
create procedure f4 () begin
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
end;//
|
||||
delimiter ;//
|
||||
call f1();
|
||||
--replace_result 1 3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
call f1();
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
call f1();
|
||||
select sql_cache * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
insert into t1 values (1);
|
||||
select sql_cache * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
call f1();
|
||||
call f1();
|
||||
select sql_cache * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_inserts";
|
||||
show status like "Qcache_hits";
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
flush status;
|
||||
select sql_cache * from t1;
|
||||
select sql_cache * from t1 where s1=1;
|
||||
call f1();
|
||||
call f2();
|
||||
call f3();
|
||||
call f4();
|
||||
call f4();
|
||||
call f3();
|
||||
call f2();
|
||||
select sql_cache * from t1 where s1=1;
|
||||
insert into t1 values (2);
|
||||
call f1();
|
||||
select sql_cache * from t1 where s1=1;
|
||||
select sql_cache * from t1;
|
||||
call f1();
|
||||
call f3();
|
||||
call f3();
|
||||
call f1();
|
||||
|
||||
drop procedure f1;
|
||||
drop procedure f2;
|
||||
drop procedure f3;
|
||||
drop procedure f4;
|
||||
drop table t1;
|
||||
|
||||
|
||||
set GLOBAL query_cache_size=0;
|
||||
|
@ -1,6 +1,9 @@
|
||||
# Test of the READ_ONLY global variable:
|
||||
# check that it blocks updates unless they are only on temporary tables.
|
||||
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
--enable_warnings
|
||||
|
@ -1,3 +1,6 @@
|
||||
# This tests not performed with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,v1;
|
||||
drop view if exists t1,v1;
|
||||
|
@ -7,6 +7,11 @@
|
||||
# In the case of trouble you might want to skip this.
|
||||
#
|
||||
|
||||
# embedded server returns different paths in error messages
|
||||
# in lines like 'call bug14233();'
|
||||
# mysqltest should be fixed to allow REPLACE_RESULT in error message
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# We're using --system things that probably doesn't work on Windows.
|
||||
--source include/not_windows.inc
|
||||
|
||||
@ -35,10 +40,13 @@ create trigger t1_ai after insert on t1 for each row call bug14233();
|
||||
|
||||
# Unsupported tampering with the mysql.proc definition
|
||||
alter table mysql.proc drop type;
|
||||
--replace_result $MYSQL_TEST_DIR .
|
||||
--error ER_SP_PROC_TABLE_CORRUPT
|
||||
call bug14233();
|
||||
--replace_result $MYSQL_TEST_DIR .
|
||||
--error ER_SP_PROC_TABLE_CORRUPT
|
||||
create view v1 as select bug14233_f();
|
||||
--replace_result $MYSQL_TEST_DIR .
|
||||
--error ER_SP_PROC_TABLE_CORRUPT
|
||||
insert into t1 values (0);
|
||||
|
||||
|
@ -647,28 +647,6 @@ create table t5 (x int)|
|
||||
call bug3294()|
|
||||
drop procedure bug3294|
|
||||
|
||||
#
|
||||
# BUG#6807: Stored procedure crash if CREATE PROCEDURE ... KILL QUERY
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug6807|
|
||||
--enable_warnings
|
||||
create procedure bug6807()
|
||||
begin
|
||||
declare id int;
|
||||
|
||||
set id = connection_id();
|
||||
kill query id;
|
||||
select 'Not reached';
|
||||
end|
|
||||
|
||||
--error 1317
|
||||
call bug6807()|
|
||||
--error 1317
|
||||
call bug6807()|
|
||||
|
||||
drop procedure bug6807|
|
||||
|
||||
#
|
||||
# BUG#876: Stored Procedures: Invalid SQLSTATE is allowed in
|
||||
# a DECLARE ? HANDLER FOR stmt.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# This test should work in embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
#
|
||||
# Testing stored procedures with multiple connections,
|
||||
# except security/privilege tests, they go to sp-security.test
|
||||
|
@ -1444,11 +1444,11 @@ end|
|
||||
call ifac(20)|
|
||||
select * from fac|
|
||||
drop table fac|
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show function status like '%f%'|
|
||||
drop procedure ifac|
|
||||
drop function fac|
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show function status like '%f%'|
|
||||
|
||||
|
||||
@ -1531,7 +1531,7 @@ begin
|
||||
end while;
|
||||
end|
|
||||
show create procedure opp|
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show procedure status like '%p%'|
|
||||
|
||||
# This isn't the fastest way in the world to compute prime numbers, so
|
||||
@ -1549,7 +1549,7 @@ select * from primes where i=45 or i=100 or i=199|
|
||||
drop table primes|
|
||||
drop procedure opp|
|
||||
drop procedure ip|
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show procedure status like '%p%'|
|
||||
|
||||
|
||||
@ -1617,13 +1617,13 @@ drop procedure if exists bar|
|
||||
create procedure bar(x char(16), y int)
|
||||
comment "111111111111" sql security invoker
|
||||
insert into test.t1 values (x, y)|
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show procedure status like 'bar'|
|
||||
alter procedure bar comment "2222222222" sql security definer|
|
||||
alter procedure bar comment "3333333333"|
|
||||
alter procedure bar|
|
||||
show create procedure bar|
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
--replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
show procedure status like 'bar'|
|
||||
drop procedure bar|
|
||||
|
||||
@ -2573,7 +2573,6 @@ begin
|
||||
show databases like 'foo';
|
||||
show errors;
|
||||
show columns from t1;
|
||||
show grants for 'root'@'localhost';
|
||||
show keys from t1;
|
||||
show open tables like 'foo';
|
||||
show privileges;
|
||||
@ -2595,20 +2594,6 @@ call bug4902()|
|
||||
|
||||
drop procedure bug4902|
|
||||
|
||||
# We need separate SP for SHOW PROCESSLIST since we want use replace_column
|
||||
--disable_warnings
|
||||
drop procedure if exists bug4902_2|
|
||||
--enable_warnings
|
||||
create procedure bug4902_2()
|
||||
begin
|
||||
show processlist;
|
||||
end|
|
||||
--replace_column 1 # 6 # 3 localhost
|
||||
call bug4902_2()|
|
||||
--replace_column 1 # 6 # 3 localhost
|
||||
call bug4902_2()|
|
||||
drop procedure bug4902_2|
|
||||
|
||||
#
|
||||
# BUG#4904
|
||||
#
|
||||
@ -2823,44 +2808,6 @@ select @x|
|
||||
delete from t1|
|
||||
drop procedure bug4941|
|
||||
|
||||
|
||||
#
|
||||
# BUG#3583: query cache doesn't work for stored procedures
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug3583|
|
||||
--enable_warnings
|
||||
--disable_warnings
|
||||
drop procedure if exists bug3583|
|
||||
--enable_warnings
|
||||
create procedure bug3583()
|
||||
begin
|
||||
declare c int;
|
||||
|
||||
select * from t1;
|
||||
select count(*) into c from t1;
|
||||
select c;
|
||||
end|
|
||||
|
||||
insert into t1 values ("x", 3), ("y", 5)|
|
||||
set @x = @@query_cache_size|
|
||||
set global query_cache_size = 10*1024*1024|
|
||||
|
||||
flush status|
|
||||
flush query cache|
|
||||
show status like 'Qcache_hits'|
|
||||
call bug3583()|
|
||||
show status like 'Qcache_hits'|
|
||||
call bug3583()|
|
||||
call bug3583()|
|
||||
show status like 'Qcache_hits'|
|
||||
|
||||
set global query_cache_size = @x|
|
||||
flush status|
|
||||
flush query cache|
|
||||
delete from t1|
|
||||
drop procedure bug3583|
|
||||
|
||||
#
|
||||
# BUG#4905: Stored procedure doesn't clear for "Rows affected"
|
||||
#
|
||||
@ -3169,24 +3116,6 @@ insert into t1 values ("answer", 42)|
|
||||
select id, bug5240() from t1|
|
||||
drop function bug5240|
|
||||
|
||||
#
|
||||
# BUG#5278: Stored procedure packets out of order if SET PASSWORD.
|
||||
#
|
||||
--disable_warnings
|
||||
drop function if exists bug5278|
|
||||
--enable_warnings
|
||||
create function bug5278 () returns char
|
||||
begin
|
||||
SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
|
||||
return 'okay';
|
||||
end|
|
||||
|
||||
--error 1133
|
||||
select bug5278()|
|
||||
--error 1133
|
||||
select bug5278()|
|
||||
drop function bug5278|
|
||||
|
||||
#
|
||||
# BUG#7992: rolling back temporary Item tree changes in SP
|
||||
#
|
||||
@ -4809,24 +4738,6 @@ select bug10100f(5)|
|
||||
call bug10100t(5)|
|
||||
|
||||
#end of the stack checking
|
||||
set @@max_sp_recursion_depth=255|
|
||||
set @var=1|
|
||||
#disable log because error about stack overrun contains numbers which
|
||||
#depend on a system
|
||||
-- disable_result_log
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100p(255, @var)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pt(1,255)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pv(1,255)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pd(1,255)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pc(1,255)|
|
||||
-- enable_result_log
|
||||
set @@max_sp_recursion_depth=0|
|
||||
|
||||
deallocate prepare stmt2|
|
||||
|
||||
drop function bug10100f|
|
||||
|
261
mysql-test/t/sp_notembedded.test
Normal file
261
mysql-test/t/sp_notembedded.test
Normal file
@ -0,0 +1,261 @@
|
||||
# Can't test with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
delimiter |;
|
||||
|
||||
#
|
||||
# BUG#4902: Stored procedure with SHOW WARNINGS leads to packet error
|
||||
#
|
||||
# Added tests for show grants command
|
||||
--disable_warnings
|
||||
drop procedure if exists bug4902|
|
||||
--enable_warnings
|
||||
create procedure bug4902()
|
||||
begin
|
||||
show grants for 'root'@'localhost';
|
||||
end|
|
||||
--disable_parsing
|
||||
show binlog events;
|
||||
show storage engines;
|
||||
show master status;
|
||||
show slave hosts;
|
||||
show slave status;
|
||||
--enable_parsing
|
||||
|
||||
call bug4902()|
|
||||
call bug4902()|
|
||||
|
||||
drop procedure bug4902|
|
||||
|
||||
# We need separate SP for SHOW PROCESSLIST since we want use replace_column
|
||||
--disable_warnings
|
||||
drop procedure if exists bug4902_2|
|
||||
--enable_warnings
|
||||
create procedure bug4902_2()
|
||||
begin
|
||||
show processlist;
|
||||
end|
|
||||
--replace_column 1 # 6 # 3 localhost
|
||||
call bug4902_2()|
|
||||
--replace_column 1 # 6 # 3 localhost
|
||||
call bug4902_2()|
|
||||
drop procedure bug4902_2|
|
||||
|
||||
|
||||
#
|
||||
# BUG#5278: Stored procedure packets out of order if SET PASSWORD.
|
||||
#
|
||||
--disable_warnings
|
||||
drop function if exists bug5278|
|
||||
--enable_warnings
|
||||
create function bug5278 () returns char
|
||||
begin
|
||||
SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
|
||||
return 'okay';
|
||||
end|
|
||||
|
||||
--error 1133
|
||||
select bug5278()|
|
||||
--error 1133
|
||||
select bug5278()|
|
||||
drop function bug5278|
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1|
|
||||
--enable_warnings
|
||||
create table t1 (
|
||||
id char(16) not null default '',
|
||||
data int not null
|
||||
)|
|
||||
#
|
||||
# BUG#3583: query cache doesn't work for stored procedures
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug3583|
|
||||
--enable_warnings
|
||||
--disable_warnings
|
||||
drop procedure if exists bug3583|
|
||||
--enable_warnings
|
||||
create procedure bug3583()
|
||||
begin
|
||||
declare c int;
|
||||
|
||||
select * from t1;
|
||||
select count(*) into c from t1;
|
||||
select c;
|
||||
end|
|
||||
|
||||
insert into t1 values ("x", 3), ("y", 5)|
|
||||
set @x = @@query_cache_size|
|
||||
set global query_cache_size = 10*1024*1024|
|
||||
|
||||
flush status|
|
||||
flush query cache|
|
||||
show status like 'Qcache_hits'|
|
||||
call bug3583()|
|
||||
show status like 'Qcache_hits'|
|
||||
call bug3583()|
|
||||
call bug3583()|
|
||||
show status like 'Qcache_hits'|
|
||||
|
||||
set global query_cache_size = @x|
|
||||
flush status|
|
||||
flush query cache|
|
||||
delete from t1|
|
||||
drop procedure bug3583|
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#6807: Stored procedure crash if CREATE PROCEDURE ... KILL QUERY
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug6807|
|
||||
--enable_warnings
|
||||
create procedure bug6807()
|
||||
begin
|
||||
declare id int;
|
||||
|
||||
set id = connection_id();
|
||||
kill query id;
|
||||
select 'Not reached';
|
||||
end|
|
||||
|
||||
--error 1317
|
||||
call bug6807()|
|
||||
--error 1317
|
||||
call bug6807()|
|
||||
|
||||
drop procedure bug6807|
|
||||
|
||||
#
|
||||
# BUG#10100: function (and stored procedure?) recursivity problem
|
||||
#
|
||||
--disable_warnings
|
||||
drop function if exists bug10100f|
|
||||
drop procedure if exists bug10100p|
|
||||
drop procedure if exists bug10100t|
|
||||
drop procedure if exists bug10100pt|
|
||||
drop procedure if exists bug10100pv|
|
||||
drop procedure if exists bug10100pd|
|
||||
drop procedure if exists bug10100pc|
|
||||
--enable_warnings
|
||||
# routines with simple recursion
|
||||
create function bug10100f(prm int) returns int
|
||||
begin
|
||||
if prm > 1 then
|
||||
return prm * bug10100f(prm - 1);
|
||||
end if;
|
||||
return 1;
|
||||
end|
|
||||
create procedure bug10100p(prm int, inout res int)
|
||||
begin
|
||||
set res = res * prm;
|
||||
if prm > 1 then
|
||||
call bug10100p(prm - 1, res);
|
||||
end if;
|
||||
end|
|
||||
create procedure bug10100t(prm int)
|
||||
begin
|
||||
declare res int;
|
||||
set res = 1;
|
||||
call bug10100p(prm, res);
|
||||
select res;
|
||||
end|
|
||||
|
||||
# a procedure which use tables and recursion
|
||||
create table t3 (a int)|
|
||||
insert into t3 values (0)|
|
||||
create view v1 as select a from t3;
|
||||
create procedure bug10100pt(level int, lim int)
|
||||
begin
|
||||
if level < lim then
|
||||
update t3 set a=level;
|
||||
FLUSH TABLES;
|
||||
call bug10100pt(level+1, lim);
|
||||
else
|
||||
select * from t3;
|
||||
end if;
|
||||
end|
|
||||
# view & recursion
|
||||
create procedure bug10100pv(level int, lim int)
|
||||
begin
|
||||
if level < lim then
|
||||
update v1 set a=level;
|
||||
FLUSH TABLES;
|
||||
call bug10100pv(level+1, lim);
|
||||
else
|
||||
select * from v1;
|
||||
end if;
|
||||
end|
|
||||
# dynamic sql & recursion
|
||||
prepare stmt2 from "select * from t3;";
|
||||
create procedure bug10100pd(level int, lim int)
|
||||
begin
|
||||
if level < lim then
|
||||
select level;
|
||||
prepare stmt1 from "update t3 set a=a+2";
|
||||
execute stmt1;
|
||||
FLUSH TABLES;
|
||||
execute stmt1;
|
||||
FLUSH TABLES;
|
||||
execute stmt1;
|
||||
FLUSH TABLES;
|
||||
deallocate prepare stmt1;
|
||||
execute stmt2;
|
||||
select * from t3;
|
||||
call bug10100pd(level+1, lim);
|
||||
else
|
||||
execute stmt2;
|
||||
end if;
|
||||
end|
|
||||
# cursor & recursion
|
||||
create procedure bug10100pc(level int, lim int)
|
||||
begin
|
||||
declare lv int;
|
||||
declare c cursor for select a from t3;
|
||||
open c;
|
||||
if level < lim then
|
||||
select level;
|
||||
fetch c into lv;
|
||||
select lv;
|
||||
update t3 set a=level+lv;
|
||||
FLUSH TABLES;
|
||||
call bug10100pc(level+1, lim);
|
||||
else
|
||||
select * from t3;
|
||||
end if;
|
||||
close c;
|
||||
end|
|
||||
|
||||
#end of the stack checking
|
||||
set @@max_sp_recursion_depth=255|
|
||||
set @var=1|
|
||||
#disable log because error about stack overrun contains numbers which
|
||||
#depend on a system
|
||||
-- disable_result_log
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100p(255, @var)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pt(1,255)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pv(1,255)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pd(1,255)|
|
||||
-- error ER_STACK_OVERRUN_NEED_MORE
|
||||
call bug10100pc(1,255)|
|
||||
-- enable_result_log
|
||||
set @@max_sp_recursion_depth=0|
|
||||
|
||||
deallocate prepare stmt2|
|
||||
|
||||
drop function bug10100f|
|
||||
drop procedure bug10100p|
|
||||
drop procedure bug10100t|
|
||||
drop procedure bug10100pt|
|
||||
drop procedure bug10100pv|
|
||||
drop procedure bug10100pd|
|
||||
drop procedure bug10100pc|
|
||||
drop view v1|
|
||||
|
||||
delimiter ;|
|
8
mysql-test/t/subselect_notembedded.test
Normal file
8
mysql-test/t/subselect_notembedded.test
Normal file
@ -0,0 +1,8 @@
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# BUG #10308: purge log with subselect
|
||||
#
|
||||
|
||||
purge master logs before (select adddate(current_timestamp(), interval -4 day));
|
||||
|
@ -2079,15 +2079,6 @@ order by users_names;
|
||||
drop view v1, v2;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# DEFINER information check
|
||||
#
|
||||
-- error ER_MALFORMED_DEFINER
|
||||
create definer=some_user@`` sql security invoker view v1 as select 1;
|
||||
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
||||
show create view v1;
|
||||
drop view v1;
|
||||
|
||||
#
|
||||
# Bug #6808 - Views: CREATE VIEW v ... FROM t AS v fails
|
||||
#
|
||||
|
@ -706,3 +706,12 @@ drop database mysqltest;
|
||||
disconnect user1;
|
||||
disconnect root;
|
||||
connection default;
|
||||
|
||||
#
|
||||
# DEFINER information check
|
||||
#
|
||||
-- error ER_MALFORMED_DEFINER
|
||||
create definer=some_user@`` sql security invoker view v1 as select 1;
|
||||
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
||||
show create view v1;
|
||||
drop view v1;
|
||||
|
@ -1,3 +1,6 @@
|
||||
# This tests not performed with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# Bug #8731: wait_timeout does not work on Mac OS X
|
||||
#
|
||||
|
Reference in New Issue
Block a user