mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge sql/mysqld.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@@ -598,3 +598,97 @@ handler a2 read a last;
|
||||
handler a2 read a prev;
|
||||
handler a2 close;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#31397 Inconsistent drop table behavior of handler tables.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
flush tables;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias close;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias read first;
|
||||
drop table t1;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler t1_alias read next;
|
||||
|
||||
# Test that temporary tables associated with handlers are properly dropped.
|
||||
|
||||
create table t1 (a int);
|
||||
create temporary table t2 (a int, key(a));
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a2 read a first;
|
||||
drop table t1, t2;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler a2 read a next;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler a1 close;
|
||||
|
||||
# Alter table drop handlers
|
||||
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 like t1;
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a1 read a first;
|
||||
handler a2 read a first;
|
||||
alter table t1 add b int;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler a1 close;
|
||||
handler a2 close;
|
||||
drop table t1, t2;
|
||||
|
||||
# Rename table drop handlers
|
||||
|
||||
create table t1 (a int, key(a));
|
||||
handler t1 open as a1;
|
||||
handler a1 read a first;
|
||||
rename table t1 to t2;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler a1 read a first;
|
||||
drop table t2;
|
||||
|
||||
# Optimize table drop handlers
|
||||
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 like t1;
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a1 read a first;
|
||||
handler a2 read a first;
|
||||
optimize table t1;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler a1 close;
|
||||
handler a2 close;
|
||||
drop table t1, t2;
|
||||
|
||||
# Flush tables causes handlers reopen
|
||||
|
||||
create table t1 (a int, b char(1), key a(a), key b(a,b));
|
||||
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
|
||||
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
|
||||
handler t1 open;
|
||||
handler t1 read a first;
|
||||
handler t1 read a next;
|
||||
flush tables;
|
||||
handler t1 read a next;
|
||||
handler t1 read a next;
|
||||
flush tables with read lock;
|
||||
handler t1 read a next;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler t1 read a next;
|
||||
|
@@ -3,6 +3,10 @@ drop database if exists mysqltest_db1;
|
||||
drop database if exists mysqltest_db2;
|
||||
create database events_test;
|
||||
use events_test;
|
||||
select * from information_schema.global_variables where variable_name like 'event_scheduler';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
EVENT_SCHEDULER ON
|
||||
SET GLOBAL event_scheduler = 'OFF';
|
||||
CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1;
|
||||
CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2;
|
||||
ERROR HY000: Event 'Lower_case' already exists
|
||||
|
@@ -55,6 +55,23 @@ flush tables with read lock;
|
||||
insert into t2 values(1);
|
||||
unlock tables;
|
||||
drop table t1, t2;
|
||||
drop table if exists t1, t2;
|
||||
set session low_priority_updates=1;
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
lock tables t1 write;
|
||||
flush tables with read lock;
|
||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
unlock tables;
|
||||
lock tables t1 read, t2 write;
|
||||
flush tables with read lock;
|
||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
unlock tables;
|
||||
lock tables t1 read;
|
||||
flush tables with read lock;
|
||||
unlock tables;
|
||||
drop table t1, t2;
|
||||
set session low_priority_updates=default;
|
||||
End of 5.0 tests
|
||||
set @old_general_log= @@general_log;
|
||||
set @old_read_only= @@read_only;
|
||||
|
@@ -1226,3 +1226,22 @@ drop user юзер_юзер@localhost;
|
||||
grant select on test.* to очень_длинный_юзер@localhost;
|
||||
ERROR HY000: String 'очень_длинный_юзер' is too long for user name (should be no longer than 16)
|
||||
set names default;
|
||||
FLUSH PRIVILEGES without procs_priv table.
|
||||
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
|
||||
FLUSH PRIVILEGES;
|
||||
Warnings:
|
||||
Error 1146 Table 'mysql.procs_priv' doesn't exist
|
||||
Error 1547 Cannot load from mysql.mysql.procs_priv. The table is probably corrupted
|
||||
Assigning privileges without procs_priv table.
|
||||
CREATE DATABASE mysqltest1;
|
||||
CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER
|
||||
SELECT 1;
|
||||
GRANT EXECUTE ON FUNCTION mysqltest1.test TO mysqltest_1@localhost;
|
||||
ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
|
||||
GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost;
|
||||
CALL mysqltest1.test();
|
||||
1
|
||||
1
|
||||
DROP DATABASE mysqltest1;
|
||||
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
|
||||
FLUSH PRIVILEGES;
|
||||
|
@@ -637,3 +637,94 @@ a b
|
||||
8 i
|
||||
handler a2 close;
|
||||
drop table t1;
|
||||
drop table if exists t1,t2;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
flush tables;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias close;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias read first;
|
||||
a
|
||||
drop table t1;
|
||||
handler t1_alias read next;
|
||||
ERROR 42S02: Unknown table 't1_alias' in HANDLER
|
||||
create table t1 (a int);
|
||||
create temporary table t2 (a int, key(a));
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a2 read a first;
|
||||
a
|
||||
drop table t1, t2;
|
||||
handler a2 read a next;
|
||||
ERROR 42S02: Unknown table 'a2' in HANDLER
|
||||
handler a1 close;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 like t1;
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a1 read a first;
|
||||
a
|
||||
handler a2 read a first;
|
||||
a
|
||||
alter table t1 add b int;
|
||||
handler a1 close;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
handler a2 close;
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, key(a));
|
||||
handler t1 open as a1;
|
||||
handler a1 read a first;
|
||||
a
|
||||
rename table t1 to t2;
|
||||
handler a1 read a first;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
drop table t2;
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 like t1;
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a1 read a first;
|
||||
a
|
||||
handler a2 read a first;
|
||||
a
|
||||
optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
handler a1 close;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
handler a2 close;
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, b char(1), key a(a), key b(a,b));
|
||||
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
|
||||
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
|
||||
handler t1 open;
|
||||
handler t1 read a first;
|
||||
a b
|
||||
0 a
|
||||
handler t1 read a next;
|
||||
a b
|
||||
1 b
|
||||
flush tables;
|
||||
handler t1 read a next;
|
||||
a b
|
||||
0 a
|
||||
handler t1 read a next;
|
||||
a b
|
||||
1 b
|
||||
flush tables with read lock;
|
||||
handler t1 read a next;
|
||||
a b
|
||||
0 a
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
handler t1 read a next;
|
||||
ERROR 42S02: Unknown table 't1' in HANDLER
|
||||
|
@@ -637,3 +637,94 @@ a b
|
||||
8 i
|
||||
handler a2 close;
|
||||
drop table t1;
|
||||
drop table if exists t1,t2;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
flush tables;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias close;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias read first;
|
||||
a
|
||||
drop table t1;
|
||||
handler t1_alias read next;
|
||||
ERROR 42S02: Unknown table 't1_alias' in HANDLER
|
||||
create table t1 (a int);
|
||||
create temporary table t2 (a int, key(a));
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a2 read a first;
|
||||
a
|
||||
drop table t1, t2;
|
||||
handler a2 read a next;
|
||||
ERROR 42S02: Unknown table 'a2' in HANDLER
|
||||
handler a1 close;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 like t1;
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a1 read a first;
|
||||
a
|
||||
handler a2 read a first;
|
||||
a
|
||||
alter table t1 add b int;
|
||||
handler a1 close;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
handler a2 close;
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, key(a));
|
||||
handler t1 open as a1;
|
||||
handler a1 read a first;
|
||||
a
|
||||
rename table t1 to t2;
|
||||
handler a1 read a first;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
drop table t2;
|
||||
create table t1 (a int, key(a));
|
||||
create table t2 like t1;
|
||||
handler t1 open as a1;
|
||||
handler t2 open as a2;
|
||||
handler a1 read a first;
|
||||
a
|
||||
handler a2 read a first;
|
||||
a
|
||||
optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status Table is already up to date
|
||||
handler a1 close;
|
||||
ERROR 42S02: Unknown table 'a1' in HANDLER
|
||||
handler a2 close;
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, b char(1), key a(a), key b(a,b));
|
||||
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
|
||||
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
|
||||
handler t1 open;
|
||||
handler t1 read a first;
|
||||
a b
|
||||
0 a
|
||||
handler t1 read a next;
|
||||
a b
|
||||
1 b
|
||||
flush tables;
|
||||
handler t1 read a next;
|
||||
a b
|
||||
0 a
|
||||
handler t1 read a next;
|
||||
a b
|
||||
1 b
|
||||
flush tables with read lock;
|
||||
handler t1 read a next;
|
||||
a b
|
||||
0 a
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
handler t1 read a next;
|
||||
ERROR 42S02: Unknown table 't1' in HANDLER
|
||||
|
@@ -125,3 +125,14 @@ drop function bug27563;
|
||||
drop procedure proc27563;
|
||||
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
|
||||
EXECUTE stmt;
|
||||
#
|
||||
# Bug#19723: kill of active connection yields different error code
|
||||
# depending on platform.
|
||||
#
|
||||
|
||||
# Connection: con2.
|
||||
KILL CONNECTION_ID();
|
||||
# CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing
|
||||
# of close of the connection socket
|
||||
SELECT 1;
|
||||
Got one of the listed errors
|
||||
|
@@ -4,3 +4,6 @@ select 1+1;
|
||||
select 1+2;
|
||||
1+2
|
||||
3
|
||||
SHOW GLOBAL VARIABLES LIKE 'thread_handling';
|
||||
Variable_name Value
|
||||
thread_handling no-threads
|
||||
|
@@ -77,3 +77,10 @@ ERROR HY000: Can't initialize function 'a'; UDFs are unavailable with the --skip
|
||||
DROP FUNCTION a;
|
||||
ERROR 42000: FUNCTION test.a does not exist
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug#29817 Queries with UDF fail with non-descriptive error
|
||||
# if mysql.proc is missing
|
||||
#
|
||||
select no_such_function(1);
|
||||
ERROR 42000: FUNCTION test.no_such_function does not exist
|
||||
End of 5.1 tests
|
||||
|
1
mysql-test/t/events_bugs-master.opt
Normal file
1
mysql-test/t/events_bugs-master.opt
Normal file
@@ -0,0 +1 @@
|
||||
--event-scheduler
|
@@ -9,6 +9,21 @@ drop database if exists mysqltest_db2;
|
||||
create database events_test;
|
||||
use events_test;
|
||||
|
||||
#
|
||||
# START: Bug #31332 --event-scheduler option misbehaving
|
||||
#
|
||||
|
||||
# NOTE!! this test must come first! It's testing that the --event-scheduler
|
||||
# option with no argument in events_bugs-master.opt turns the scheduler on.
|
||||
|
||||
select * from information_schema.global_variables where variable_name like 'event_scheduler';
|
||||
|
||||
SET GLOBAL event_scheduler = 'OFF';
|
||||
|
||||
#
|
||||
# END: Bug #31332
|
||||
#
|
||||
|
||||
#
|
||||
# START - 16415: Events: event names are case sensitive
|
||||
#
|
||||
|
@@ -133,6 +133,37 @@ disconnect con3;
|
||||
connection default;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug#32528 Global read lock with a low priority write lock causes a server crash
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
set session low_priority_updates=1;
|
||||
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
|
||||
lock tables t1 write;
|
||||
--error ER_LOCK_OR_ACTIVE_TRANSACTION
|
||||
flush tables with read lock;
|
||||
unlock tables;
|
||||
|
||||
lock tables t1 read, t2 write;
|
||||
--error ER_LOCK_OR_ACTIVE_TRANSACTION
|
||||
flush tables with read lock;
|
||||
unlock tables;
|
||||
|
||||
lock tables t1 read;
|
||||
flush tables with read lock;
|
||||
unlock tables;
|
||||
|
||||
drop table t1, t2;
|
||||
|
||||
set session low_priority_updates=default;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
@@ -1277,3 +1277,23 @@ drop user юзер_юзер@localhost;
|
||||
--error ER_WRONG_STRING_LENGTH
|
||||
grant select on test.* to очень_длинный_юзер@localhost;
|
||||
set names default;
|
||||
|
||||
|
||||
#
|
||||
# Bug #16470 crash on grant if old grant tables
|
||||
#
|
||||
--echo FLUSH PRIVILEGES without procs_priv table.
|
||||
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
|
||||
FLUSH PRIVILEGES;
|
||||
--echo Assigning privileges without procs_priv table.
|
||||
CREATE DATABASE mysqltest1;
|
||||
CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER
|
||||
SELECT 1;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
GRANT EXECUTE ON FUNCTION mysqltest1.test TO mysqltest_1@localhost;
|
||||
GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost;
|
||||
CALL mysqltest1.test();
|
||||
DROP DATABASE mysqltest1;
|
||||
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
|
@@ -1143,6 +1143,7 @@ END$$
|
||||
|
||||
DELIMITER ;$$
|
||||
|
||||
let $wait_timeout= 300;
|
||||
let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
|
@@ -304,3 +304,21 @@ while ($i)
|
||||
dec $i ;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo #
|
||||
--echo # Bug#19723: kill of active connection yields different error code
|
||||
--echo # depending on platform.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo # Connection: con2.
|
||||
--connection con2
|
||||
|
||||
KILL CONNECTION_ID();
|
||||
|
||||
--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing
|
||||
--echo # of close of the connection socket
|
||||
--error 2013, 2006
|
||||
SELECT 1;
|
||||
|
@@ -3,3 +3,4 @@
|
||||
#
|
||||
select 1+1;
|
||||
select 1+2;
|
||||
SHOW GLOBAL VARIABLES LIKE 'thread_handling';
|
||||
|
@@ -122,7 +122,6 @@ select count(*) from information_schema.COLUMN_PRIVILEGES;
|
||||
select count(*) from information_schema.SCHEMA_PRIVILEGES;
|
||||
select count(*) from information_schema.TABLE_PRIVILEGES;
|
||||
select count(*) from information_schema.USER_PRIVILEGES;
|
||||
|
||||
#
|
||||
# Bug #32020: loading udfs while --skip-grant-tables is enabled causes out of
|
||||
# memory errors
|
||||
@@ -134,3 +133,12 @@ CREATE FUNCTION a RETURNS STRING SONAME '';
|
||||
DROP FUNCTION a;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#29817 Queries with UDF fail with non-descriptive error
|
||||
--echo # if mysql.proc is missing
|
||||
--echo #
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
select no_such_function(1);
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@@ -45,27 +45,9 @@ call bug4902_2()|
|
||||
call bug4902_2()|
|
||||
drop procedure bug4902_2|
|
||||
|
||||
|
||||
# Disable until bug#17244 is fixed
|
||||
--disable_parsing
|
||||
#
|
||||
# BUG#5278: Stored procedure packets out of order if SET PASSWORD.
|
||||
# BUG#3583: query cache doesn't work for stored procedures
|
||||
#
|
||||
--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|
|
||||
--enable_parsing
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1|
|
||||
@@ -74,9 +56,6 @@ 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
|
||||
|
Reference in New Issue
Block a user