mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/usr/home/pem/mysql-5.1-new include/my_base.h: Auto merged libmysqld/examples/Makefile.am: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/ndb_alter_table.result: Auto merged mysql-test/r/ndb_basic.result: Auto merged mysql-test/t/ndb_alter_table.test: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql/examples/ha_example.cc: Auto merged storage/myisam/ft_parser.c: Auto merged storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged storage/ndb/src/mgmapi/mgmapi.cpp: Auto merged libmysqld/Makefile.am: Manual merge. sql/ha_ndbcluster.cc: Manual merge. sql/mysqld.cc: Manual merge.
This commit is contained in:
@ -433,4 +433,7 @@ INSERT INTO t1 VALUES('testword\'\'');
|
||||
SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE);
|
||||
a
|
||||
testword''
|
||||
SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE);
|
||||
a
|
||||
testword''
|
||||
DROP TABLE t1;
|
||||
|
@ -594,3 +594,24 @@ flush privileges;
|
||||
set @user123="non-existent";
|
||||
select * from mysql.db where user=@user123;
|
||||
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv
|
||||
set names koi8r;
|
||||
create database <20><>;
|
||||
grant select on <20><>.* to root@localhost;
|
||||
select hex(Db) from mysql.db where Db='<27><>';
|
||||
hex(Db)
|
||||
D0B1D0B4
|
||||
show grants for root@localhost;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `<60><>`.* TO 'root'@'localhost'
|
||||
flush privileges;
|
||||
show grants for root@localhost;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `<60><>`.* TO 'root'@'localhost'
|
||||
drop database <20><>;
|
||||
revoke all privileges on <20><>.* from root@localhost;
|
||||
show grants for root@localhost;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
set names latin1;
|
||||
|
@ -2002,3 +2002,13 @@ a count(a)
|
||||
1 1
|
||||
NULL 1
|
||||
drop table t1;
|
||||
create table t1 (f1 int, f2 char(1), primary key(f1,f2)) engine=innodb;
|
||||
insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
|
||||
alter table t1 drop primary key, add primary key (f2, f1);
|
||||
explain select distinct f1 a, f1 b from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index; Using temporary
|
||||
explain select distinct f1, f2 from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
|
||||
drop table t1;
|
||||
|
@ -1466,4 +1466,4 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t4 ref a a 5 test.t3.b X
|
||||
1 SIMPLE t6 ref a a 5 test.t4.b X
|
||||
1 SIMPLE t5 ref a a 5 test.t3.b X
|
||||
drop table t0, t1, t2, t4, t5, t6;
|
||||
drop table t0, t1, t2, t3, t4, t5, t6, t7;
|
||||
|
@ -179,7 +179,7 @@ a b c
|
||||
2 two two
|
||||
alter table t1 drop index c;
|
||||
select * from t1 where b = 'two';
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
ERROR HY000: Can't lock file (errno: 241)
|
||||
select * from t1 where b = 'two';
|
||||
a b c
|
||||
2 two two
|
||||
|
@ -667,13 +667,13 @@ counter datavalue
|
||||
57 newval
|
||||
58 newval
|
||||
drop table t1;
|
||||
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||
select * from t1;
|
||||
b
|
||||
drop table t1;
|
||||
create table atablewithareallylongandirritatingname (a int);
|
||||
insert into atablewithareallylongandirritatingname values (2);
|
||||
select * from atablewithareallylongandirritatingname;
|
||||
a
|
||||
2
|
||||
drop table atablewithareallylongandirritatingname;
|
||||
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||
select * from t1;
|
||||
b
|
||||
drop table t1;
|
||||
|
@ -806,3 +806,22 @@ execute stmt;
|
||||
@@tx_isolation
|
||||
REPEATABLE-READ
|
||||
deallocate prepare stmt;
|
||||
prepare stmt from "create temporary table t1 (letter enum('','a','b','c')
|
||||
not null)";
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
set names latin1;
|
||||
prepare stmt from "create table t1 (a enum('test') default 'test')
|
||||
character set utf8";
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
set names default;
|
||||
deallocate prepare stmt;
|
||||
|
@ -2708,6 +2708,14 @@ select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
|
||||
count(f2) >0
|
||||
1
|
||||
drop table t1,t2;
|
||||
create table t1 (f1 int,f2 int);
|
||||
insert into t1 values(1,1);
|
||||
create table t2 (f3 int, f4 int, primary key(f3,f4));
|
||||
insert into t2 values(1,1);
|
||||
select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2));
|
||||
f1 f2
|
||||
1 1
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 ( city char(30) );
|
||||
INSERT INTO t1 VALUES ('London');
|
||||
INSERT INTO t1 VALUES ('Paris');
|
||||
@ -3283,3 +3291,49 @@ f1 f2 x1
|
||||
30 1 30
|
||||
drop table t1;
|
||||
drop view v1, v2, v3;
|
||||
CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a));
|
||||
CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a));
|
||||
CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32),
|
||||
PRIMARY KEY(key_a,key_b));
|
||||
INSERT INTO t1 VALUES (0,'');
|
||||
INSERT INTO t1 VALUES (1,'i');
|
||||
INSERT INTO t1 VALUES (2,'j');
|
||||
INSERT INTO t1 VALUES (3,'k');
|
||||
INSERT INTO t2 VALUES (1,'r');
|
||||
INSERT INTO t2 VALUES (2,'s');
|
||||
INSERT INTO t2 VALUES (3,'t');
|
||||
INSERT INTO t3 VALUES (1,5,'x');
|
||||
INSERT INTO t3 VALUES (1,6,'y');
|
||||
INSERT INTO t3 VALUES (2,5,'xx');
|
||||
INSERT INTO t3 VALUES (2,6,'yy');
|
||||
INSERT INTO t3 VALUES (2,7,'zz');
|
||||
INSERT INTO t3 VALUES (3,5,'xxx');
|
||||
SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
key_a foo
|
||||
2 xx
|
||||
EXPLAIN SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
1 SIMPLE t3 const PRIMARY PRIMARY 8 const,const 1
|
||||
SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
key_a foo
|
||||
2 xx
|
||||
EXPLAIN SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
1 SIMPLE t3 const PRIMARY PRIMARY 8 const,const 1
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
@ -988,6 +988,10 @@ end|
|
||||
select f5(1)|
|
||||
f5(1)
|
||||
1
|
||||
select f5(2)|
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
select f5(3)|
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
create function f6() returns int
|
||||
begin
|
||||
declare n int;
|
||||
@ -1035,6 +1039,12 @@ select * from v1|
|
||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
create function f1() returns int
|
||||
return (select sum(data) from t1) + (select sum(data) from v1)|
|
||||
select f1()|
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
select * from v1|
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
select * from v2|
|
||||
ERROR HY000: Recursive stored functions and triggers are not allowed.
|
||||
drop function f1|
|
||||
create function f1() returns int
|
||||
return (select sum(data) from t1)|
|
||||
@ -1053,7 +1063,7 @@ f0()
|
||||
select *, f0() from v0|
|
||||
f0() f0()
|
||||
100 100
|
||||
lock tables t1 read, t1 as t11 read, mysql.proc read|
|
||||
lock tables t1 read, t1 as t11 read|
|
||||
select f3()|
|
||||
f3()
|
||||
1
|
||||
@ -1251,6 +1261,62 @@ drop procedure opp|
|
||||
drop procedure ip|
|
||||
show procedure status like '%p%'|
|
||||
Db Name Type Definer Modified Created Security_type Comment
|
||||
drop table if exists fib|
|
||||
create table fib ( f bigint unsigned not null )|
|
||||
drop procedure if exists fib|
|
||||
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|
|
||||
set @@max_sp_recursion_depth= 20|
|
||||
insert into fib values (0), (1)|
|
||||
call fib(3)|
|
||||
select * from fib order by f asc|
|
||||
f
|
||||
0
|
||||
1
|
||||
1
|
||||
2
|
||||
delete from fib|
|
||||
insert into fib values (0), (1)|
|
||||
call fib(20)|
|
||||
select * from fib order by f asc|
|
||||
f
|
||||
0
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
5
|
||||
8
|
||||
13
|
||||
21
|
||||
34
|
||||
55
|
||||
89
|
||||
144
|
||||
233
|
||||
377
|
||||
610
|
||||
987
|
||||
1597
|
||||
2584
|
||||
4181
|
||||
6765
|
||||
drop table fib|
|
||||
drop procedure fib|
|
||||
set @@max_sp_recursion_depth= 0|
|
||||
drop procedure if exists bar|
|
||||
create procedure bar(x char(16), y int)
|
||||
comment "111111111111" sql security invoker
|
||||
@ -1479,6 +1545,52 @@ select @x2|
|
||||
@x2
|
||||
2
|
||||
drop procedure bug2260|
|
||||
drop procedure if exists bug2267_1|
|
||||
create procedure bug2267_1()
|
||||
begin
|
||||
show procedure status;
|
||||
end|
|
||||
drop procedure if exists bug2267_2|
|
||||
create procedure bug2267_2()
|
||||
begin
|
||||
show function status;
|
||||
end|
|
||||
drop procedure if exists bug2267_3|
|
||||
create procedure bug2267_3()
|
||||
begin
|
||||
show create procedure bug2267_1;
|
||||
end|
|
||||
drop procedure if exists bug2267_4|
|
||||
drop function if exists bug2267_4|
|
||||
create procedure bug2267_4()
|
||||
begin
|
||||
show create function bug2267_4;
|
||||
end|
|
||||
create function bug2267_4() returns int return 100|
|
||||
call bug2267_1()|
|
||||
Db Name Type Definer Modified Created Security_type Comment
|
||||
test bug2267_1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
||||
test bug2267_2 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
||||
test bug2267_3 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
||||
test bug2267_4 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
||||
call bug2267_2()|
|
||||
Db Name Type Definer Modified Created Security_type Comment
|
||||
test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
||||
call bug2267_3()|
|
||||
Procedure sql_mode Create Procedure
|
||||
bug2267_1 CREATE PROCEDURE `bug2267_1`()
|
||||
begin
|
||||
show procedure status;
|
||||
end
|
||||
call bug2267_4()|
|
||||
Function sql_mode Create Function
|
||||
bug2267_4 CREATE FUNCTION `bug2267_4`() RETURNS int(11)
|
||||
return 100
|
||||
drop procedure bug2267_1|
|
||||
drop procedure bug2267_2|
|
||||
drop procedure bug2267_3|
|
||||
drop procedure bug2267_4|
|
||||
drop function bug2267_4|
|
||||
drop procedure if exists bug2227|
|
||||
create procedure bug2227(x int)
|
||||
begin
|
||||
@ -1490,6 +1602,18 @@ call bug2227(9)|
|
||||
1.3 x y 42 z
|
||||
1.3 9 2.6 42 zzz
|
||||
drop procedure bug2227|
|
||||
drop procedure if exists bug2614|
|
||||
create procedure bug2614()
|
||||
begin
|
||||
drop table if exists t3;
|
||||
create table t3 (id int default '0' not null);
|
||||
insert into t3 select 12;
|
||||
insert into t3 select * from t3;
|
||||
end|
|
||||
call bug2614()|
|
||||
call bug2614()|
|
||||
drop table t3|
|
||||
drop procedure bug2614|
|
||||
drop function if exists bug2674|
|
||||
create function bug2674() returns int
|
||||
return @@sort_buffer_size|
|
||||
@ -3868,5 +3992,58 @@ drop procedure bug10100pv|
|
||||
drop procedure bug10100pd|
|
||||
drop procedure bug10100pc|
|
||||
drop view v1|
|
||||
drop procedure if exists bug13729|
|
||||
drop table if exists t3|
|
||||
create table t3 (s1 int, primary key (s1))|
|
||||
insert into t3 values (1),(2)|
|
||||
create procedure bug13729()
|
||||
begin
|
||||
declare continue handler for sqlexception select 55;
|
||||
update t3 set s1 = 1;
|
||||
end|
|
||||
call bug13729()|
|
||||
55
|
||||
55
|
||||
select * from t3|
|
||||
s1
|
||||
1
|
||||
2
|
||||
drop procedure bug13729|
|
||||
drop table t3|
|
||||
drop procedure if exists bug14643_1|
|
||||
drop procedure if exists bug14643_2|
|
||||
create procedure bug14643_1()
|
||||
begin
|
||||
declare continue handler for sqlexception select 'boo' as 'Handler';
|
||||
begin
|
||||
declare v int default x;
|
||||
if v = 1 then
|
||||
select 1;
|
||||
else
|
||||
select 2;
|
||||
end if;
|
||||
end;
|
||||
end|
|
||||
create procedure bug14643_2()
|
||||
begin
|
||||
declare continue handler for sqlexception select 'boo' as 'Handler';
|
||||
case x
|
||||
when 1 then
|
||||
select 1;
|
||||
else
|
||||
select 2;
|
||||
end case;
|
||||
end|
|
||||
call bug14643_1()|
|
||||
Handler
|
||||
boo
|
||||
2
|
||||
2
|
||||
call bug14643_2()|
|
||||
Handler
|
||||
boo
|
||||
2
|
||||
2
|
||||
drop procedure bug14643_1|
|
||||
drop procedure bug14643_2|
|
||||
drop table t1,t2;
|
||||
|
@ -369,3 +369,59 @@ drop procedure bug13825_0|
|
||||
drop procedure bug13825_1|
|
||||
drop procedure bug13825_2|
|
||||
drop table t1, t2|
|
||||
drop table if exists t3|
|
||||
drop procedure if exists bug14840_1|
|
||||
drop procedure if exists bug14840_2|
|
||||
create table t3
|
||||
(
|
||||
x int,
|
||||
y int,
|
||||
primary key (x)
|
||||
) engine=InnoDB|
|
||||
create procedure bug14840_1()
|
||||
begin
|
||||
declare err int default 0;
|
||||
declare continue handler for sqlexception
|
||||
set err = err + 1;
|
||||
start transaction;
|
||||
update t3 set x = 1, y = 42 where x = 2;
|
||||
insert into t3 values (3, 4711);
|
||||
if err > 0 then
|
||||
rollback;
|
||||
else
|
||||
commit;
|
||||
end if;
|
||||
select * from t3;
|
||||
end|
|
||||
create procedure bug14840_2()
|
||||
begin
|
||||
declare err int default 0;
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
set err = err + 1;
|
||||
select err as 'Ping';
|
||||
end;
|
||||
update t3 set x = 1, y = 42 where x = 2;
|
||||
update t3 set x = 1, y = 42 where x = 2;
|
||||
insert into t3 values (3, 4711);
|
||||
select * from t3;
|
||||
end|
|
||||
insert into t3 values (1, 3), (2, 5)|
|
||||
call bug14840_1()|
|
||||
x y
|
||||
1 3
|
||||
2 5
|
||||
delete from t3|
|
||||
insert into t3 values (1, 3), (2, 5)|
|
||||
call bug14840_2()|
|
||||
Ping
|
||||
1
|
||||
Ping
|
||||
2
|
||||
x y
|
||||
1 3
|
||||
2 5
|
||||
3 4711
|
||||
drop procedure bug14840_1|
|
||||
drop procedure bug14840_2|
|
||||
drop table t3|
|
||||
|
@ -354,6 +354,7 @@ SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||
#
|
||||
INSERT INTO t1 VALUES('testword\'\'');
|
||||
SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE);
|
||||
SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@ -487,4 +487,16 @@ flush privileges;
|
||||
set @user123="non-existent";
|
||||
select * from mysql.db where user=@user123;
|
||||
|
||||
set names koi8r;
|
||||
create database <20><>;
|
||||
grant select on <20><>.* to root@localhost;
|
||||
select hex(Db) from mysql.db where Db='<27><>';
|
||||
show grants for root@localhost;
|
||||
flush privileges;
|
||||
show grants for root@localhost;
|
||||
drop database <20><>;
|
||||
revoke all privileges on <20><>.* from root@localhost;
|
||||
show grants for root@localhost;
|
||||
set names latin1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@ -693,3 +693,13 @@ create table t1(a int, key(a)) engine=innodb;
|
||||
insert into t1 values(1);
|
||||
select a, count(a) from t1 group by a with rollup;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #13293 Wrongly used index results in endless loop.
|
||||
#
|
||||
create table t1 (f1 int, f2 char(1), primary key(f1,f2)) engine=innodb;
|
||||
insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
|
||||
alter table t1 drop primary key, add primary key (f2, f1);
|
||||
explain select distinct f1 a, f1 b from t1;
|
||||
explain select distinct f1, f2 from t1;
|
||||
drop table t1;
|
||||
|
@ -899,4 +899,4 @@ explain select * from t2 left join
|
||||
(t3 left join (t4 join t6 on t6.a=t4.b) on t4.a=t3.b
|
||||
join t5 on t5.a=t3.b) on t3.a=t2.b;
|
||||
|
||||
drop table t0, t1, t2, t4, t5, t6;
|
||||
drop table t0, t1, t2, t3, t4, t5, t6, t7;
|
||||
|
@ -153,7 +153,7 @@ connection server1;
|
||||
alter table t1 drop index c;
|
||||
connection server2;
|
||||
# This should fail since index information is not automatically refreshed
|
||||
--error 1412
|
||||
--error 1015
|
||||
select * from t1 where b = 'two';
|
||||
select * from t1 where b = 'two';
|
||||
connection server1;
|
||||
|
@ -606,6 +606,14 @@ select * from t1 order by counter;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#14514 Creating table with packed key fails silently
|
||||
#
|
||||
|
||||
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
@ -615,12 +623,3 @@ create table atablewithareallylongandirritatingname (a int);
|
||||
insert into atablewithareallylongandirritatingname values (2);
|
||||
select * from atablewithareallylongandirritatingname;
|
||||
drop table atablewithareallylongandirritatingname;
|
||||
|
||||
|
||||
#
|
||||
# BUG#14514
|
||||
#
|
||||
|
||||
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
@ -842,4 +842,32 @@ set @@tx_isolation=default;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
#
|
||||
# Bug#14410 "Crash in Enum or Set type in CREATE TABLE and PS/SP"
|
||||
#
|
||||
# Part I. Make sure the typelib for ENUM is created in the statement memory
|
||||
# root.
|
||||
prepare stmt from "create temporary table t1 (letter enum('','a','b','c')
|
||||
not null)";
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
# Part II. Make sure that when the default value is converted to UTF-8,
|
||||
# the new item is # created in the statement memory root.
|
||||
set names latin1;
|
||||
prepare stmt from "create table t1 (a enum('test') default 'test')
|
||||
character set utf8";
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
execute stmt;
|
||||
drop table t1;
|
||||
# Cleanup
|
||||
set names default;
|
||||
deallocate prepare stmt;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@ -2253,6 +2253,17 @@ insert into t1 values (1,1);
|
||||
insert into t2 values (1,1),(1,2);
|
||||
select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug #14482 Server crash when subselecting from the same table
|
||||
#
|
||||
create table t1 (f1 int,f2 int);
|
||||
insert into t1 values(1,1);
|
||||
create table t2 (f3 int, f4 int, primary key(f3,f4));
|
||||
insert into t2 values(1,1);
|
||||
select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2));
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
@ -2749,3 +2760,48 @@ select f1, f2, v2.f1 as x1 from v2 order by v2.f1;
|
||||
select f1, f2, v3.f1 as x1 from v3 order by v3.f1;
|
||||
drop table t1;
|
||||
drop view v1, v2, v3;
|
||||
|
||||
#
|
||||
# Bug #15106: lost equality predicate of the form field=const in a join query
|
||||
#
|
||||
|
||||
CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a));
|
||||
CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a));
|
||||
CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32),
|
||||
PRIMARY KEY(key_a,key_b));
|
||||
|
||||
INSERT INTO t1 VALUES (0,'');
|
||||
INSERT INTO t1 VALUES (1,'i');
|
||||
INSERT INTO t1 VALUES (2,'j');
|
||||
INSERT INTO t1 VALUES (3,'k');
|
||||
|
||||
INSERT INTO t2 VALUES (1,'r');
|
||||
INSERT INTO t2 VALUES (2,'s');
|
||||
INSERT INTO t2 VALUES (3,'t');
|
||||
|
||||
INSERT INTO t3 VALUES (1,5,'x');
|
||||
INSERT INTO t3 VALUES (1,6,'y');
|
||||
INSERT INTO t3 VALUES (2,5,'xx');
|
||||
INSERT INTO t3 VALUES (2,6,'yy');
|
||||
INSERT INTO t3 VALUES (2,7,'zz');
|
||||
INSERT INTO t3 VALUES (3,5,'xxx');
|
||||
|
||||
SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
EXPLAIN SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
|
||||
SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
EXPLAIN SELECT t2.key_a,foo
|
||||
FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
|
||||
INNER JOIN t3 ON t1.key_a = t3.key_a
|
||||
WHERE t2.key_a=2 and key_b=5;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
@ -1211,15 +1211,13 @@ begin
|
||||
end if;
|
||||
end|
|
||||
select f5(1)|
|
||||
# This should generate an error about insuficient number of tables locked
|
||||
# Now this crash server
|
||||
--disable_parsing # until bug#11394 fix
|
||||
--error 1100
|
||||
# Since currently recursive functions are disallowed ER_SP_NO_RECURSION
|
||||
# error will be returned, once we will allow them error about
|
||||
# insufficient number of locked tables will be returned instead.
|
||||
--error ER_SP_NO_RECURSION
|
||||
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...
|
||||
--error ER_SP_NO_RECURSION
|
||||
select f5(3)|
|
||||
--enable_parsing
|
||||
|
||||
# OTOH this should work
|
||||
create function f6() returns int
|
||||
@ -1265,13 +1263,12 @@ select * from v1|
|
||||
# views and functions ?
|
||||
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.
|
||||
--disable_parsing
|
||||
--error ER_SP_NO_RECURSION
|
||||
select f1()|
|
||||
--error ER_SP_NO_RECURSION
|
||||
select * from v1|
|
||||
--error ER_SP_NO_RECURSION
|
||||
select * from v2|
|
||||
--enable_parsing
|
||||
# Back to the normal cases
|
||||
drop function f1|
|
||||
create function f1() returns int
|
||||
@ -1289,9 +1286,7 @@ select *, f0() from v0|
|
||||
#
|
||||
# Let us test how well prelocking works with explicit LOCK TABLES.
|
||||
#
|
||||
# Nowdays we have to lock mysql.proc to be able to read SP definitions.
|
||||
# But Monty was going to fix this.
|
||||
lock tables t1 read, t1 as t11 read, mysql.proc read|
|
||||
lock tables t1 read, t1 as t11 read|
|
||||
# These should work well
|
||||
select f3()|
|
||||
select id, f3() from t1 as t11|
|
||||
@ -1481,9 +1476,6 @@ show procedure status like '%p%'|
|
||||
|
||||
# Fibonacci, for recursion test. (Yet Another Numerical series :)
|
||||
#
|
||||
# This part of test is disabled until we implement support for
|
||||
# recursive stored procedures.
|
||||
--disable_parsing
|
||||
--disable_warnings
|
||||
drop table if exists fib|
|
||||
--enable_warnings
|
||||
@ -1512,6 +1504,9 @@ begin
|
||||
end if;
|
||||
end|
|
||||
|
||||
# Enable recursion
|
||||
set @@max_sp_recursion_depth= 20|
|
||||
|
||||
# Minimum test: recursion of 3 levels
|
||||
|
||||
insert into fib values (0), (1)|
|
||||
@ -1531,7 +1526,7 @@ call fib(20)|
|
||||
select * from fib order by f asc|
|
||||
drop table fib|
|
||||
drop procedure fib|
|
||||
--enable_parsing
|
||||
set @@max_sp_recursion_depth= 0|
|
||||
|
||||
#
|
||||
# Comment & suid
|
||||
@ -1800,16 +1795,8 @@ select @x2|
|
||||
drop procedure bug2260|
|
||||
|
||||
#
|
||||
# BUG#2267
|
||||
# BUG#2267 "Lost connect if stored procedure has SHOW FUNCTION STATUS"
|
||||
#
|
||||
# NOTE: This test case will be fixed as soon as Monty
|
||||
# will allow to open mysql.proc table under LOCK TABLES
|
||||
# without mentioning in lock list.
|
||||
#
|
||||
# FIXME: Other solution would be to use preopened proc table
|
||||
# instead of opening it anew.
|
||||
#
|
||||
--disable_parsing
|
||||
--disable_warnings
|
||||
drop procedure if exists bug2267_1|
|
||||
--enable_warnings
|
||||
@ -1836,11 +1823,13 @@ end|
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists bug2267_4|
|
||||
drop function if exists bug2267_4|
|
||||
--enable_warnings
|
||||
create procedure bug2267_4()
|
||||
begin
|
||||
show create function fac;
|
||||
show create function bug2267_4;
|
||||
end|
|
||||
create function bug2267_4() returns int return 100|
|
||||
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
call bug2267_1()|
|
||||
@ -1853,7 +1842,7 @@ drop procedure bug2267_1|
|
||||
drop procedure bug2267_2|
|
||||
drop procedure bug2267_3|
|
||||
drop procedure bug2267_4|
|
||||
--enable_parsing
|
||||
drop function bug2267_4|
|
||||
|
||||
#
|
||||
# BUG#2227
|
||||
@ -1873,23 +1862,16 @@ call bug2227(9)|
|
||||
drop procedure bug2227|
|
||||
|
||||
#
|
||||
# BUG#2614
|
||||
# BUG#2614 "Stored procedure with INSERT ... SELECT that does not
|
||||
# contain any tables crashes server"
|
||||
#
|
||||
# QQ The second insert doesn't work with temporary tables (it was an
|
||||
# QQ ordinary table before we changed the locking scheme). It results
|
||||
# QQ in an error: 1137: Can't reopen table: 't3'
|
||||
# QQ which is a known limit with temporary tables.
|
||||
# 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_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);
|
||||
drop table if exists t3;
|
||||
create table t3 (id int default '0' not null);
|
||||
insert into t3 select 12;
|
||||
insert into t3 select * from t3;
|
||||
end|
|
||||
@ -1898,9 +1880,8 @@ end|
|
||||
call bug2614()|
|
||||
--enable_warnings
|
||||
call bug2614()|
|
||||
drop temporary table t3|
|
||||
drop table t3|
|
||||
drop procedure bug2614|
|
||||
--enable_parsing
|
||||
|
||||
#
|
||||
# BUG#2674
|
||||
@ -4773,8 +4754,75 @@ drop procedure bug10100pv|
|
||||
drop procedure bug10100pd|
|
||||
drop procedure bug10100pc|
|
||||
drop view v1|
|
||||
|
||||
#
|
||||
# BUG#13729: Stored procedures: packet error after exception handled
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug13729|
|
||||
drop table if exists t3|
|
||||
--enable_warnings
|
||||
|
||||
create table t3 (s1 int, primary key (s1))|
|
||||
|
||||
insert into t3 values (1),(2)|
|
||||
|
||||
create procedure bug13729()
|
||||
begin
|
||||
declare continue handler for sqlexception select 55;
|
||||
|
||||
update t3 set s1 = 1;
|
||||
end|
|
||||
|
||||
call bug13729()|
|
||||
# Used to cause Packets out of order
|
||||
select * from t3|
|
||||
|
||||
drop procedure bug13729|
|
||||
drop table t3|
|
||||
|
||||
#
|
||||
# BUG#14643: Stored Procedure: Continuing after failed var. initialization
|
||||
# crashes server.
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug14643_1|
|
||||
drop procedure if exists bug14643_2|
|
||||
--enable_warnings
|
||||
|
||||
create procedure bug14643_1()
|
||||
begin
|
||||
declare continue handler for sqlexception select 'boo' as 'Handler';
|
||||
|
||||
begin
|
||||
declare v int default x;
|
||||
|
||||
if v = 1 then
|
||||
select 1;
|
||||
else
|
||||
select 2;
|
||||
end if;
|
||||
end;
|
||||
end|
|
||||
|
||||
create procedure bug14643_2()
|
||||
begin
|
||||
declare continue handler for sqlexception select 'boo' as 'Handler';
|
||||
|
||||
case x
|
||||
when 1 then
|
||||
select 1;
|
||||
else
|
||||
select 2;
|
||||
end case;
|
||||
end|
|
||||
|
||||
call bug14643_1()|
|
||||
call bug14643_2()|
|
||||
|
||||
drop procedure bug14643_1|
|
||||
drop procedure bug14643_2|
|
||||
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
|
@ -355,6 +355,70 @@ drop procedure bug13825_2|
|
||||
drop table t1, t2|
|
||||
|
||||
|
||||
#
|
||||
# BUG#14840: CONTINUE handler problem
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t3|
|
||||
drop procedure if exists bug14840_1|
|
||||
drop procedure if exists bug14840_2|
|
||||
--enable_warnings
|
||||
|
||||
create table t3
|
||||
(
|
||||
x int,
|
||||
y int,
|
||||
primary key (x)
|
||||
) engine=InnoDB|
|
||||
|
||||
# This used to hang the client since the insert returned with an
|
||||
# error status (left over from the update) even though it succeeded,
|
||||
# which caused the execution to end at that point.
|
||||
create procedure bug14840_1()
|
||||
begin
|
||||
declare err int default 0;
|
||||
declare continue handler for sqlexception
|
||||
set err = err + 1;
|
||||
|
||||
start transaction;
|
||||
update t3 set x = 1, y = 42 where x = 2;
|
||||
insert into t3 values (3, 4711);
|
||||
if err > 0 then
|
||||
rollback;
|
||||
else
|
||||
commit;
|
||||
end if;
|
||||
select * from t3;
|
||||
end|
|
||||
|
||||
# A simpler (non-transactional) case: insert at select should be done
|
||||
create procedure bug14840_2()
|
||||
begin
|
||||
declare err int default 0;
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
set err = err + 1;
|
||||
select err as 'Ping';
|
||||
end;
|
||||
|
||||
update t3 set x = 1, y = 42 where x = 2;
|
||||
update t3 set x = 1, y = 42 where x = 2;
|
||||
insert into t3 values (3, 4711);
|
||||
select * from t3;
|
||||
end|
|
||||
|
||||
insert into t3 values (1, 3), (2, 5)|
|
||||
call bug14840_1()|
|
||||
|
||||
delete from t3|
|
||||
insert into t3 values (1, 3), (2, 5)|
|
||||
call bug14840_2()|
|
||||
|
||||
drop procedure bug14840_1|
|
||||
drop procedure bug14840_2|
|
||||
drop table t3|
|
||||
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
Reference in New Issue
Block a user