mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1 mysql-test/t/disabled.def: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: 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 1548 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
|
||||
|
@ -605,6 +605,7 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
|
||||
DROP DATABASE IF EXISTS `db_17876`;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
select CONNECTION_ID() into @thread_id;
|
||||
truncate table mysql.general_log;
|
||||
set @old_general_log_state = @@global.general_log;
|
||||
set global general_log = on;
|
||||
@ -711,7 +712,7 @@ set @lparam = "000 001 002 003 004 005 006 007 008 009"
|
||||
prepare long_query from "select ? as long_query";
|
||||
execute long_query using @lparam;
|
||||
set global general_log = off;
|
||||
select command_type, argument from mysql.general_log;
|
||||
select command_type, argument from mysql.general_log where thread_id = @thread_id;
|
||||
command_type argument
|
||||
Query set @lparam = "000 001 002 003 004 005 006 007 008 009"
|
||||
"010 011 012 013 014 015 016 017 018 019"
|
||||
|
@ -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
|
||||
|
@ -484,3 +484,46 @@ select atan(10, 20 "p2");
|
||||
ERROR 42000: Incorrect parameters in the call to native function 'atan'
|
||||
select atan(10 AS p1, 20 AS p2);
|
||||
ERROR 42000: Incorrect parameters in the call to native function 'atan'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
|
||||
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
|
||||
NULL
|
||||
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
|
||||
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
|
||||
NULL
|
||||
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
|
||||
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
|
||||
1998-01-01 00:00:00
|
||||
SELECT 1 + INTERVAL(1,0,1,2) + 1;
|
||||
1 + INTERVAL(1,0,1,2) + 1
|
||||
4
|
||||
SELECT INTERVAL(1^1,0,1,2) + 1;
|
||||
INTERVAL(1^1,0,1,2) + 1
|
||||
2
|
||||
SELECT INTERVAL(1,0+1,2,3) * 5.5;
|
||||
INTERVAL(1,0+1,2,3) * 5.5
|
||||
5.5
|
||||
SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
|
||||
INTERVAL(3,3,1+3,4+4) / 0.5
|
||||
2.0000
|
||||
SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
|
||||
(INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2
|
||||
50.0000
|
||||
SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
|
||||
INTERVAL(1,0,1,2) + 1 5 * INTERVAL(1,0,1,2)
|
||||
3 10
|
||||
SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
|
||||
INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3)
|
||||
2
|
||||
SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
|
||||
1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND
|
||||
NULL
|
||||
SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
|
||||
1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND
|
||||
NULL
|
||||
CREATE TABLE t1 (a INT, b DATETIME);
|
||||
INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
|
||||
SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
|
||||
a b
|
||||
3 1998-01-01 00:00:00
|
||||
DROP TABLE t1;
|
||||
|
@ -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
|
||||
|
@ -1981,4 +1981,39 @@ drop table table_25411_b;
|
||||
DROP TRIGGER IF EXISTS trg;
|
||||
SHOW CREATE TRIGGER trg;
|
||||
ERROR HY000: Trigger does not exist
|
||||
drop table if exists t1;
|
||||
create table t1 (i int, j int);
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
||||
drop trigger t1_bi;
|
||||
drop trigger t1_bi;
|
||||
ERROR HY000: Trigger does not exist
|
||||
lock tables t1 read;
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
drop trigger t1_bi;
|
||||
ERROR HY000: Trigger does not exist
|
||||
unlock tables;
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
lock tables t1 read;
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
drop trigger t1_bi;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
unlock tables;
|
||||
drop trigger t1_bi;
|
||||
lock tables t1 write;
|
||||
create trigger b1_bi before insert on t1 for each row set new.i = new.i + 10;
|
||||
insert into t1 values (10, 10);
|
||||
drop trigger b1_bi;
|
||||
insert into t1 values (10, 10);
|
||||
select * from t1;
|
||||
i j
|
||||
20 10
|
||||
10 10
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
End of 5.1 tests.
|
||||
|
@ -448,3 +448,4 @@ DROP TABLE t1;
|
||||
DROP DATABASE mysqltest_db1;
|
||||
USE test;
|
||||
End of 5.0 tests.
|
||||
End of 5.1 tests.
|
@ -3617,4 +3617,47 @@ DROP TABLE `t-2`;
|
||||
DROP VIEW `v-2`;
|
||||
DROP DATABASE `d-1`;
|
||||
USE test;
|
||||
|
||||
#
|
||||
# Bug#26676: VIEW using old table schema in a session.
|
||||
#
|
||||
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(c1 INT, c2 INT);
|
||||
INSERT INTO t1 VALUES (1, 2), (3, 4);
|
||||
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 2
|
||||
3 4
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
|
||||
SELECT * FROM v1;
|
||||
c1 c2
|
||||
1 2
|
||||
3 4
|
||||
|
||||
ALTER TABLE t1 ADD COLUMN c3 INT AFTER c2;
|
||||
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
1 2 NULL
|
||||
3 4 NULL
|
||||
|
||||
SELECT * FROM v1;
|
||||
c1 c2
|
||||
1 2
|
||||
3 4
|
||||
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c1` AS `c1`,`t1`.`c2` AS `c2` from `t1` latin1 latin1_swedish_ci
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of test case for Bug#26676.
|
||||
|
||||
End of 5.1 tests.
|
||||
|
@ -19,7 +19,8 @@ events : Bug#32664 events.test fails randomly
|
||||
events_scheduling : Bug#29830 Test case 'events_scheduling' fails on Mac OS X and Windows
|
||||
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
|
||||
kill : Bug#29149: Test "kill" fails on Windows
|
||||
grant3 : Bug#32723: grant3.test fails
|
||||
innodb_mysql : Bug#32724: innodb_mysql.test fails randomly
|
||||
wait_timeout : Bug#32801 wait_timeout.test fails randomly
|
||||
kill : Bug#29149 Test "kill" fails on Windows
|
||||
ctype_create : Bug#32965 main.ctype_create fails
|
||||
status : Bug#32966 main.status fails
|
||||
|
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;
|
||||
|
@ -811,6 +811,7 @@ SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
# Bug#21557 entries in the general query log truncated at 1000 characters.
|
||||
#
|
||||
|
||||
select CONNECTION_ID() into @thread_id;
|
||||
truncate table mysql.general_log;
|
||||
set @old_general_log_state = @@global.general_log;
|
||||
set global general_log = on;
|
||||
@ -921,7 +922,7 @@ prepare long_query from "select ? as long_query";
|
||||
execute long_query using @lparam;
|
||||
--enable_result_log
|
||||
set global general_log = off;
|
||||
select command_type, argument from mysql.general_log;
|
||||
select command_type, argument from mysql.general_log where thread_id = @thread_id;
|
||||
deallocate prepare long_query;
|
||||
set global general_log = @old_general_log_state;
|
||||
|
||||
|
@ -3,3 +3,4 @@
|
||||
#
|
||||
select 1+1;
|
||||
select 1+2;
|
||||
SHOW GLOBAL VARIABLES LIKE 'thread_handling';
|
||||
|
@ -629,3 +629,31 @@ select atan(10, 20 "p2");
|
||||
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
|
||||
select atan(10 AS p1, 20 AS p2);
|
||||
|
||||
#
|
||||
# Bug#22312 Syntax error in expression with INTERVAL()
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
|
||||
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
|
||||
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
|
||||
SELECT 1 + INTERVAL(1,0,1,2) + 1;
|
||||
SELECT INTERVAL(1^1,0,1,2) + 1;
|
||||
SELECT INTERVAL(1,0+1,2,3) * 5.5;
|
||||
SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
|
||||
SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
|
||||
SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
|
||||
SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
|
||||
|
||||
--disable_warnings
|
||||
SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
|
||||
SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT, b DATETIME);
|
||||
INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
|
||||
SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
|
||||
DROP TABLE t1;
|
||||
|
@ -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
|
||||
|
@ -2257,4 +2257,51 @@ DROP TRIGGER IF EXISTS trg;
|
||||
--error ER_TRG_DOES_NOT_EXIST
|
||||
SHOW CREATE TRIGGER trg;
|
||||
|
||||
#
|
||||
# Bug#23713 LOCK TABLES + CREATE TRIGGER + FLUSH TABLES WITH READ LOCK = deadlock
|
||||
#
|
||||
# Test of trigger creation and removal under LOCK TABLES
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (i int, j int);
|
||||
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
drop trigger t1_bi;
|
||||
--error ER_TRG_DOES_NOT_EXIST
|
||||
drop trigger t1_bi;
|
||||
|
||||
lock tables t1 read;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
--error ER_TRG_DOES_NOT_EXIST
|
||||
drop trigger t1_bi;
|
||||
unlock tables;
|
||||
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
lock tables t1 read;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
drop trigger t1_bi;
|
||||
unlock tables;
|
||||
drop trigger t1_bi;
|
||||
|
||||
lock tables t1 write;
|
||||
create trigger b1_bi before insert on t1 for each row set new.i = new.i + 10;
|
||||
insert into t1 values (10, 10);
|
||||
drop trigger b1_bi;
|
||||
insert into t1 values (10, 10);
|
||||
select * from t1;
|
||||
unlock tables;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests.
|
||||
|
@ -875,3 +875,37 @@ DROP DATABASE mysqltest_db1;
|
||||
USE test;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
# Bug#23713 LOCK TABLES + CREATE TRIGGER + FLUSH TABLES WITH READ LOCK = deadlock
|
||||
#
|
||||
|
||||
# Test temporarily disable due to Bug#32395
|
||||
--disable_parsing
|
||||
create table t1 (i int);
|
||||
connect (flush,localhost,root,,test,,);
|
||||
connection default;
|
||||
--echo connection: default
|
||||
lock tables t1 write;
|
||||
connection flush;
|
||||
--echo connection: flush
|
||||
--send flush tables with read lock;
|
||||
connection default;
|
||||
--echo connection: default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Flushing tables";
|
||||
--source include/wait_condition.inc
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
unlock tables;
|
||||
connection flush;
|
||||
--echo connection: flush
|
||||
--reap
|
||||
unlock tables;
|
||||
connection default;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
disconnect flush;
|
||||
--enable_parsing
|
||||
|
||||
--echo End of 5.1 tests.
|
@ -3475,4 +3475,55 @@ DROP VIEW `v-2`;
|
||||
DROP DATABASE `d-1`;
|
||||
USE test;
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # Bug#26676: VIEW using old table schema in a session.
|
||||
--echo #
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(c1 INT, c2 INT);
|
||||
INSERT INTO t1 VALUES (1, 2), (3, 4);
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM v1;
|
||||
|
||||
--echo
|
||||
|
||||
ALTER TABLE t1 ADD COLUMN c3 INT AFTER c2;
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM v1;
|
||||
|
||||
--echo
|
||||
|
||||
SHOW CREATE VIEW v1;
|
||||
|
||||
--echo
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # End of test case for Bug#26676.
|
||||
--echo
|
||||
|
||||
--echo End of 5.1 tests.
|
||||
|
Reference in New Issue
Block a user