Commit e2fb2141 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

merge

parents be93a811 41af8df7
...@@ -76,8 +76,8 @@ extern "C" { ...@@ -76,8 +76,8 @@ extern "C" {
extern void *(*my_str_malloc)(size_t); extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *); extern void (*my_str_free)(void *);
#if MY_GNUC_PREREQ(3, 4) #if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4)
#define strmov(dest, src) __builtin_stpcpy(dest, src) #define strmov(A,B) __builtin_stpcpy((A),(B))
#elif defined(HAVE_STPCPY) #elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B)) #define strmov(A,B) stpcpy((A),(B))
#ifndef stpcpy #ifndef stpcpy
......
...@@ -255,7 +255,11 @@ enum enum_server_command ...@@ -255,7 +255,11 @@ enum enum_server_command
#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ #define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \
SERVER_QUERY_NO_INDEX_USED|\ SERVER_QUERY_NO_INDEX_USED|\
SERVER_MORE_RESULTS_EXISTS|\ SERVER_MORE_RESULTS_EXISTS|\
SERVER_STATUS_METADATA_CHANGED) SERVER_STATUS_METADATA_CHANGED |\
SERVER_QUERY_WAS_SLOW |\
SERVER_STATUS_DB_DROPPED |\
SERVER_STATUS_CURSOR_EXISTS|\
SERVER_STATUS_LAST_ROW_SENT)
#define MYSQL_ERRMSG_SIZE 512 #define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */ #define NET_READ_TIMEOUT 30 /* Timeout on read */
......
#
# SUMMARY
# Check that a statement is compatible with FLUSH TABLES WITH READ LOCK.
#
# PARAMETERS
# $con_aux1 Name of the 1st aux connection to be used by this script.
# $con_aux2 Name of the 2nd aux connection to be used by this script.
# $statement The statement to be checked.
# $cleanup_stmt The statement to be run in order to revert effects of
# the statement to be checked.
# $skip_3rd_chk Skip the 3rd stage of checking. The purpose of the third
# stage is to check that metadata locks taken by this
# statement are compatible with metadata locks taken
# by FTWRL.
#
# EXAMPLE
# flush_read_lock.test
#
--disable_result_log
--disable_query_log
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
#
# First, check that the statement can be run under FTWRL.
#
flush tables with read lock;
--disable_abort_on_error
--eval $statement
--enable_abort_on_error
let $err= $mysql_errno;
if (!$err)
{
--echo Success: Was able to run '$statement' under FTWRL.
unlock tables;
if (`SELECT "$cleanup_stmt" <> ""`)
{
--eval $cleanup_stmt;
}
}
if ($err)
{
--echo Error: Wasn't able to run '$statement' under FTWRL!
unlock tables;
}
#
# Then check that this statement won't be blocked by FTWRL
# that is active in another connection.
#
connection $con_aux1;
flush tables with read lock;
connection default;
--send_eval $statement;
connection $con_aux1;
--enable_result_log
--enable_query_log
let $wait_condition=
select count(*) = 0 from information_schema.processlist
where info = "$statement";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
if ($success)
{
--echo Success: Was able to run '$statement' with FTWRL active in another connection.
connection default;
# Apparently statement was successfully executed and so
# was not blocked by FTWRL.
# To be safe against wait_condition.inc succeeding due to
# races let us first reap the statement being checked to
# ensure that it has been successfully executed.
--reap
connection $con_aux1;
unlock tables;
connection default;
}
if (!$success)
{
--echo Error: Wasn't able to run '$statement' with FTWRL active in another connection!
unlock tables;
connection default;
--reap
}
if (`SELECT "$cleanup_stmt" <> ""`)
{
--eval $cleanup_stmt;
}
if (`SELECT "$skip_3rd_check" = ""`)
{
#
# Finally, let us check that FTWRL will succeed if this statement
# is active but has already closed its tables.
#
connection default;
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send_eval $statement;
connection $con_aux1;
set debug_sync="now WAIT_FOR parked";
--send flush tables with read lock
connection $con_aux2;
--enable_result_log
--enable_query_log
let $wait_condition=
select count(*) = 0 from information_schema.processlist
where info = "flush tables with read lock";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
if ($success)
{
--echo Success: Was able to run FTWRL while '$statement' was active in another connection.
connection $con_aux1;
# Apparently FTWRL was successfully executed and so was not blocked by
# the statement being checked. To be safe against wait_condition.inc
# succeeding due to races let us first reap the FTWRL to ensure that it
# has been successfully executed.
--reap
unlock tables;
set debug_sync="now SIGNAL go";
connection default;
--reap
}
if (!$success)
{
--echo Error: Wasn't able to run FTWRL while '$statement' was active in another connection!
set debug_sync="now SIGNAL go";
connection default;
--reap
connection $con_aux1;
--reap
unlock tables;
connection default;
}
set debug_sync= "RESET";
if (`SELECT "$cleanup_stmt" <> ""`)
{
--eval $cleanup_stmt;
}
}
--enable_result_log
--enable_query_log
#
# SUMMARY
# Check that a statement is incompatible with FLUSH TABLES WITH READ LOCK.
#
# PARAMETERS
# $con_aux1 Name of the 1st aux connection to be used by this script.
# $con_aux2 Name of the 2nd aux connection to be used by this script.
# $statement The statement to be checked.
# $cleanup_stmt1 The 1st statement to be run in order to revert effects
# of statement to be checked.
# $cleanup_stmt2 The 2nd statement to be run in order to revert effects
# of statement to be checked.
# $skip_3rd_chk Skip the 3rd stage of checking. The purpose of the third
# stage is to check that metadata locks taken by this
# statement are incompatible with metadata locks taken
# by FTWRL.
#
# EXAMPLE
# flush_read_lock.test
#
--disable_result_log
--disable_query_log
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
#
# First, check that the statement cannot be run under FTWRL.
#
flush tables with read lock;
--disable_abort_on_error
--eval $statement
--enable_abort_on_error
let $err= $mysql_errno;
if ($err)
{
--echo Success: Was not able to run '$statement' under FTWRL.
unlock tables;
}
if (!$err)
{
--echo Error: Was able to run '$statement' under FTWRL!
unlock tables;
if (`SELECT "$cleanup_stmt1" <> ""`)
{
--eval $cleanup_stmt1;
}
if (`SELECT "$cleanup_stmt2" <> ""`)
{
--eval $cleanup_stmt2;
}
}
#
# Then check that this statement is blocked by FTWRL
# that is active in another connection.
#
connection $con_aux1;
flush tables with read lock;
connection default;
--send_eval $statement;
connection $con_aux1;
--enable_result_log
--enable_query_log
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where (state = "Waiting for global read lock" or
state = "Waiting for commit lock") and
info = "$statement";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
if ($success)
{
--echo Success: '$statement' is blocked by FTWRL active in another connection.
}
if (!$success)
{
--echo Error: '$statement' wasn't blocked by FTWRL active in another connection!
}
unlock tables;
connection default;
--reap
if (`SELECT "$cleanup_stmt1" <> ""`)
{
--eval $cleanup_stmt1;
}
if (`SELECT "$cleanup_stmt2" <> ""`)
{
--eval $cleanup_stmt2;
}
if (`SELECT "$skip_3rd_check" = ""`)
{
#
# Finally, let us check that FTWRL will not succeed if this
# statement is active but has already closed its tables.
#
connection default;
--eval set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send_eval $statement;
connection $con_aux1;
set debug_sync="now WAIT_FOR parked";
--send flush tables with read lock
connection $con_aux2;
--enable_result_log
--enable_query_log
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where (state = "Waiting for global read lock" or
state = "Waiting for commit lock") and
info = "flush tables with read lock";
--source include/wait_condition.inc
--disable_result_log
--disable_query_log
if ($success)
{
--echo Success: FTWRL is blocked when '$statement' is active in another connection.
}
if (!$success)
{
--echo Error: FTWRL isn't blocked when '$statement' is active in another connection!
}
set debug_sync="now SIGNAL go";
connection default;
--reap
connection $con_aux1;
--reap
unlock tables;
connection default;
set debug_sync= "RESET";
if (`SELECT "$cleanup_stmt1" <> ""`)
{
--eval $cleanup_stmt1;
}
if (`SELECT "$cleanup_stmt2" <> ""`)
{
--eval $cleanup_stmt2;
}
}
--enable_result_log
--enable_query_log
...@@ -1545,8 +1545,6 @@ lock table not_exists_write read; ...@@ -1545,8 +1545,6 @@ lock table not_exists_write read;
--echo # We still have the read lock. --echo # We still have the read lock.
--error ER_CANT_UPDATE_WITH_READLOCK --error ER_CANT_UPDATE_WITH_READLOCK
drop table t1; drop table t1;
handler t1 read next;
handler t1 close;
handler t1 open; handler t1 open;
select a from t2; select a from t2;
handler t1 read next; handler t1 read next;
......
...@@ -101,7 +101,7 @@ if (`SELECT '$wait_for_all' = '1'`) ...@@ -101,7 +101,7 @@ if (`SELECT '$wait_for_all' = '1'`)
if (!$found) if (!$found)
{ {
echo # Timeout in include/wait_show_condition.inc for $wait_condition; echo # Timeout in include/wait_show_condition.inc for $condition;
echo # show_statement : $show_statement; echo # show_statement : $show_statement;
echo # field : $field; echo # field : $field;
echo # condition : $condition; echo # condition : $condition;
......
...@@ -418,6 +418,18 @@ COMMIT; ...@@ -418,6 +418,18 @@ COMMIT;
UNLOCK TABLES; UNLOCK TABLES;
# Connection con1 # Connection con1
# Reaping: INSERT DELAYED INTO t1 VALUES (5) # Reaping: INSERT DELAYED INTO t1 VALUES (5)
# Connection default
# Test 5: LOCK TABLES + INSERT DELAYED in one connection.
# This test has triggered some asserts in metadata locking
# subsystem at some point in time..
LOCK TABLE t1 WRITE;
INSERT DELAYED INTO t2 VALUES (7);
UNLOCK TABLES;
SET AUTOCOMMIT= 0;
LOCK TABLE t1 WRITE;
INSERT DELAYED INTO t2 VALUES (8);
UNLOCK TABLES;
SET AUTOCOMMIT= 1;
# Connection con2 # Connection con2
# Connection con1 # Connection con1
# Connection default # Connection default
......
...@@ -133,15 +133,15 @@ select event_name from information_schema.events; ...@@ -133,15 +133,15 @@ select event_name from information_schema.events;
event_name event_name
e1 e1
create event e2 on schedule every 10 hour do select 1; create event e2 on schedule every 10 hour do select 1;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable; alter event e2 disable;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3; alter event e2 rename to e3;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2; drop event e2;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1; drop event e1;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables; unlock tables;
lock table t1 write; lock table t1 write;
show create event e1; show create event e1;
...@@ -151,15 +151,15 @@ select event_name from information_schema.events; ...@@ -151,15 +151,15 @@ select event_name from information_schema.events;
event_name event_name
e1 e1
create event e2 on schedule every 10 hour do select 1; create event e2 on schedule every 10 hour do select 1;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable; alter event e2 disable;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3; alter event e2 rename to e3;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2; drop event e2;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1; drop event e1;
ERROR HY000: Table 'event' was not locked with LOCK TABLES ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables; unlock tables;
lock table t1 read, mysql.event read; lock table t1 read, mysql.event read;
show create event e1; show create event e1;
...@@ -169,15 +169,15 @@ select event_name from information_schema.events; ...@@ -169,15 +169,15 @@ select event_name from information_schema.events;
event_name event_name
e1 e1
create event e2 on schedule every 10 hour do select 1; create event e2 on schedule every 10 hour do select 1;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable; alter event e2 disable;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3; alter event e2 rename to e3;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2; drop event e2;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1; drop event e1;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables; unlock tables;
lock table t1 write, mysql.event read; lock table t1 write, mysql.event read;
show create event e1; show create event e1;
...@@ -187,15 +187,15 @@ select event_name from information_schema.events; ...@@ -187,15 +187,15 @@ select event_name from information_schema.events;
event_name event_name
e1 e1
create event e2 on schedule every 10 hour do select 1; create event e2 on schedule every 10 hour do select 1;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable; alter event e2 disable;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3; alter event e2 rename to e3;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2; drop event e2;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1; drop event e1;
ERROR HY000: Table 'event' was locked with a READ lock and can't be updated ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables; unlock tables;
lock table t1 read, mysql.event write; lock table t1 read, mysql.event write;
ERROR HY000: You can't combine write-locking of system tables with other tables or lock types ERROR HY000: You can't combine write-locking of system tables with other tables or lock types
...@@ -209,11 +209,17 @@ select event_name from information_schema.events; ...@@ -209,11 +209,17 @@ select event_name from information_schema.events;
event_name event_name
e1 e1
create event e2 on schedule every 10 hour do select 1; create event e2 on schedule every 10 hour do select 1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable; alter event e2 disable;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3; alter event e2 rename to e3;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e3; drop event e3;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1; drop event e1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables; unlock tables;
drop event e1;
Make sure we have left no events Make sure we have left no events
select event_name from information_schema.events; select event_name from information_schema.events;
event_name event_name
......
...@@ -423,3 +423,31 @@ i ...@@ -423,3 +423,31 @@ i
4 4
unlock tables; unlock tables;
drop tables tm, t1, t2; drop tables tm, t1, t2;
#
# Test for bug #57006 "Deadlock between HANDLER and
# FLUSH TABLES WITH READ LOCK".
#
drop table if exists t1, t2;
create table t1 (i int);
create table t2 (i int);
handler t1 open;
# Switching to connection 'con1'.
# Sending:
flush tables with read lock;
# Switching to connection 'con2'.
# Wait until FTWRL starts waiting for 't1' to be closed.
# Switching to connection 'default'.
# The below statement should not cause deadlock.
# Sending:
insert into t2 values (1);
# Switching to connection 'con2'.
# Wait until INSERT starts to wait for FTWRL to go away.
# Switching to connection 'con1'.
# FTWRL should be able to continue now.
# Reap FTWRL.
unlock tables;
# Switching to connection 'default'.
# Reap INSERT.
handler t1 close;
# Cleanup.
drop tables t1, t2;
This diff is collapsed.
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (kill_id INT); SET DEBUG_SYNC= 'RESET';
CREATE TABLE t1 (kill_id INT) engine = InnoDB;
INSERT INTO t1 VALUES(connection_id()); INSERT INTO t1 VALUES(connection_id());
# Switching to connection 'default'.
# Start transaction.
BEGIN;
INSERT INTO t1 VALUES(connection_id());
# Ensure that COMMIT will pause once it acquires protection
# against its global read lock.
SET DEBUG_SYNC='ha_commit_trans_after_acquire_commit_lock SIGNAL acquired WAIT_FOR go';
# Sending:
COMMIT;
# Switching to 'con1'.
# Wait till COMMIT acquires protection against global read
# lock and pauses.
SET DEBUG_SYNC='now WAIT_FOR acquired';
# Sending:
FLUSH TABLES WITH READ LOCK; FLUSH TABLES WITH READ LOCK;
SELECT ((@id := kill_id) - kill_id) FROM t1; # Switching to 'con2'.
SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1;
((@id := kill_id) - kill_id) ((@id := kill_id) - kill_id)
0 0
# Wait till FLUSH TABLES WITH READ LOCK blocks due
# to active COMMIT
# Kill connection 'con1'.
KILL CONNECTION @id; KILL CONNECTION @id;
# Switching to 'con1'.
# Try to reap FLUSH TABLES WITH READ LOCK,
# it fail due to killed statement and connection.
Got one of the listed errors
# Switching to 'con2'.
# Resume COMMIT.
SET DEBUG_SYNC='now SIGNAL go';
# Switching to 'default'.
# Reaping COMMIT.
DROP TABLE t1; DROP TABLE t1;
SET @@global.concurrent_insert= @old_concurrent_insert; SET DEBUG_SYNC= 'RESET';
...@@ -607,3 +607,12 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821))) ...@@ -607,3 +607,12 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
as foo; as foo;
foo foo
2 2
#
# Bug #58137 char(0) column cause:
# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
#
CREATE TABLE t1(a char(0));
INSERT INTO t1 (SELECT -pi());
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
DROP TABLE t1;
...@@ -375,4 +375,10 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1)) ...@@ -375,4 +375,10 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1))
3 3
1 1
DROP TABLE t1; DROP TABLE t1;
End of 5.1 tests #
# Bug #58199: name_const in the having clause crashes
#
CREATE TABLE t1 (a INT);
SELECT 1 from t1 HAVING NAME_CONST('', a);
ERROR HY000: Incorrect arguments to NAME_CONST
DROP TABLE t1;
...@@ -1485,10 +1485,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist ...@@ -1485,10 +1485,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist
# We still have the read lock. # We still have the read lock.
drop table t1; drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock ERROR HY000: Can't execute the query because you have a conflicting read lock
handler t1 read next;
a b
1 1
handler t1 close;
handler t1 open; handler t1 open;
select a from t2; select a from t2;
a a
......
...@@ -1481,10 +1481,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist ...@@ -1481,10 +1481,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist
# We still have the read lock. # We still have the read lock.
drop table t1; drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock ERROR HY000: Can't execute the query because you have a conflicting read lock
handler t1 read next;
a b
1 1
handler t1 close;
handler t1 open; handler t1 open;
select a from t2; select a from t2;
a a
......
set @old_concurrent_insert= @@global.concurrent_insert; SET DEBUG_SYNC = 'RESET';
set @@global.concurrent_insert= 0; DROP TABLE IF EXISTS t1, t2, t3;
drop table if exists t1, t2, t3; DROP FUNCTION IF EXISTS MY_KILL;
create table t1 (kill_id int); CREATE FUNCTION MY_KILL(tid INT) RETURNS INT
insert into t1 values(connection_id()); BEGIN
select ((@id := kill_id) - kill_id) from t1; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
((@id := kill_id) - kill_id) KILL tid;
0 RETURN (SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = tid);
kill @id; END|
select ((@id := kill_id) - kill_id) from t1; SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
((@id := kill_id) - kill_id) SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read';
0 SET DEBUG_SYNC='now WAIT_FOR con1_read';
select @id != connection_id(); SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
@id != connection_id() SET DEBUG_SYNC = 'RESET';
SELECT 1;
Got one of the listed errors
SELECT 1;
1
1 1
select 4; SELECT @id != CONNECTION_ID();
@id != CONNECTION_ID()
1
SELECT 4;
4 4
4 4
drop table t1; KILL (SELECT COUNT(*) FROM mysql.user);
kill (select count(*) from mysql.user);
ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement' ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
create table t1 (id int primary key); SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
create table t2 (id int unsigned not null); SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill';
insert into t2 select id from t1; SET DEBUG_SYNC= 'now WAIT_FOR con1_read';
create table t3 (kill_id int); SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
insert into t3 values(connection_id()); SET DEBUG_SYNC = 'RESET';
select id from t1 where id in (select distinct a.id from t2 a, t2 b, t2 c, t2 d group by a.id, b.id, c.id, d.id having a.id between 10 and 20); SELECT 1;
select ((@id := kill_id) - kill_id) from t3;
((@id := kill_id) - kill_id)
0
kill @id;
Got one of the listed errors Got one of the listed errors
drop table t1, t2, t3; SELECT 1;
select get_lock("a", 10); 1
get_lock("a", 10) 1
1 SELECT @id != CONNECTION_ID();
select get_lock("a", 10); @id != CONNECTION_ID()
get_lock("a", 10) 1
NULL SELECT 4;
select 1; 4
1 4
1 CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT);
select RELEASE_LOCK("a"); CREATE TABLE t2 (id INT UNSIGNED NOT NULL);
RELEASE_LOCK("a") INSERT INTO t1 VALUES
1 (0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
create table t1(f1 int); (0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
create function bug27563() returns int(11) (0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
deterministic (0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0);
begin INSERT t1 SELECT 0 FROM t1 AS a1, t1 AS a2 LIMIT 4032;
declare continue handler for sqlstate '70100' set @a:= 'killed'; INSERT INTO t2 SELECT id FROM t1;
declare continue handler for sqlexception set @a:= 'exception'; SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
set @a= get_lock("lock27563", 10); SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync';
return 1; SELECT id FROM t1 WHERE id IN
end| (SELECT DISTINCT a.id FROM t2 a, t2 b, t2 c, t2 d
select get_lock("lock27563",10); GROUP BY ACOS(1/a.id), b.id, c.id, d.id
get_lock("lock27563",10) HAVING a.id BETWEEN 10 AND 20);
1 SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
insert into t1 values (bug27563()); KILL @id;
ERROR 70100: Query execution was interrupted SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
select @a; Got one of the listed errors
@a SELECT 1;
NULL 1
select * from t1; 1
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1, t2;
SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync WAIT_FOR kill';
SELECT ACOS(0);
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
ACOS(0)
1.5707963267948966
SELECT 1;
1
1
SELECT @id = CONNECTION_ID();
@id = CONNECTION_ID()
1
SET DEBUG_SYNC = 'RESET';
CREATE TABLE t1 (f1 INT);
CREATE FUNCTION bug27563() RETURNS INT(11)
DETERMINISTIC
BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE '70100' SET @a:= 'killed';
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
RETURN 1;
END|
INSERT INTO t1 VALUES (bug27563());
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1 f1
insert into t1 values(0); SET DEBUG_SYNC = 'RESET';
update t1 set f1= bug27563(); INSERT INTO t1 VALUES(0);
UPDATE t1 SET f1= bug27563();
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
ERROR 70100: Query execution was interrupted ERROR 70100: Query execution was interrupted
select @a; SELECT * FROM t1;
@a
NULL
select * from t1;
f1 f1
0 0
insert into t1 values(1); SET DEBUG_SYNC = 'RESET';
delete from t1 where bug27563() is null; INSERT INTO t1 VALUES(1);
DELETE FROM t1 WHERE bug27563() IS NULL;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
ERROR 70100: Query execution was interrupted ERROR 70100: Query execution was interrupted
select @a; SELECT * FROM t1;
@a
NULL
select * from t1;
f1 f1
0 0
1 1
select * from t1 where f1= bug27563(); SET DEBUG_SYNC = 'RESET';
ERROR 70100: Query execution was interrupted SELECT * FROM t1 WHERE f1= bug27563();
select @a; SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
@a KILL QUERY @id;
NULL ERROR 70100: Query execution was interrupted
create procedure proc27563() SELECT * FROM t1;
begin
declare continue handler for sqlstate '70100' set @a:= 'killed';
declare continue handler for sqlexception set @a:= 'exception';
select get_lock("lock27563",10);
select "shouldn't be selected";
end|
call proc27563();
get_lock("lock27563",10)
NULL
ERROR 70100: Query execution was interrupted
select @a;
@a
NULL
create table t2 (f2 int);
create trigger trg27563 before insert on t1 for each row
begin
declare continue handler for sqlstate '70100' set @a:= 'killed';
declare continue handler for sqlexception set @a:= 'exception';
set @a:= get_lock("lock27563",10);
insert into t2 values(1);
end|
insert into t1 values(2),(3);
ERROR 70100: Query execution was interrupted
select @a;
@a
NULL
select * from t1;
f1 f1
0 0
1 1
select * from t2; SET DEBUG_SYNC = 'RESET';
f2 DROP FUNCTION bug27563;
select release_lock("lock27563"); CREATE TABLE t2 (f2 INT);
release_lock("lock27563") CREATE TRIGGER trg27563 BEFORE INSERT ON t1 FOR EACH ROW
BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE '70100' SET @a:= 'killed';
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
INSERT INTO t2 VALUES(0);
SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
INSERT INTO t2 VALUES(1);
END|
INSERT INTO t1 VALUES(2),(3);
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1
0
1 1
drop table t1, t2; SELECT * FROM t2;
drop function bug27563; f2
drop procedure proc27563; 0
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1, t2;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
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 '; 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; EXECUTE stmt;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
ERROR 70100: Query execution was interrupted
SET DEBUG_SYNC = 'RESET';
# #
# Bug#19723: kill of active connection yields different error code # Bug#19723: kill of active connection yields different error code
# depending on platform. # depending on platform.
# #
# Connection: con2. # Connection: con1.
KILL CONNECTION_ID(); SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
# CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing KILL @id;
# of close of the connection socket ERROR 70100: Query execution was interrupted
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
# ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST,
# depending on the timing of close of the connection socket
SELECT 1; SELECT 1;
Got one of the listed errors Got one of the listed errors
SELECT 1;
1
1
SELECT @id != CONNECTION_ID();
@id != CONNECTION_ID()
1
SET DEBUG_SYNC = 'RESET';
# #
# Additional test for WL#3726 "DDL locking for all metadata objects" # Additional test for WL#3726 "DDL locking for all metadata objects"
# Check that DDL and DML statements waiting for metadata locks can # Check that DDL and DML statements waiting for metadata locks can
...@@ -208,13 +243,11 @@ ERROR 70100: Query execution was interrupted ...@@ -208,13 +243,11 @@ ERROR 70100: Query execution was interrupted
# Test for DML waiting for meta-data lock # Test for DML waiting for meta-data lock
# Switching to connection 'blocker' # Switching to connection 'blocker'
unlock tables; unlock tables;
drop table t2;
create table t2 (k int);
lock tables t1 read; lock tables t1 read;
# Switching to connection 'ddl' # Switching to connection 'ddl'
rename tables t1 to t3, t2 to t1; truncate table t1;
# Switching to connection 'dml' # Switching to connection 'dml'
insert into t2 values (1); insert into t1 values (1);
# Switching to connection 'default' # Switching to connection 'default'
kill query ID2; kill query ID2;
# Switching to connection 'dml' # Switching to connection 'dml'
...@@ -239,6 +272,7 @@ unlock tables; ...@@ -239,6 +272,7 @@ unlock tables;
# Switching to connection 'ddl' # Switching to connection 'ddl'
# Cleanup. # Cleanup.
# Switching to connection 'default' # Switching to connection 'default'
drop table t3;
drop table t1; drop table t1;
set @@global.concurrent_insert= @old_concurrent_insert; drop table t2;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
...@@ -2471,7 +2471,7 @@ CREATE PROCEDURE p1() SELECT 1; ...@@ -2471,7 +2471,7 @@ CREATE PROCEDURE p1() SELECT 1;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened'; SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
# Check that FLUSH must wait to get the GRL # Check that FLUSH must wait to get the GRL
# and let CREATE PROCEDURE continue # and let CREATE PROCEDURE continue
SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait'; SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK; FLUSH TABLES WITH READ LOCK;
# Connection 1 # Connection 1
# Connection 2 # Connection 2
...@@ -2486,10 +2486,17 @@ DROP PROCEDURE p1; ...@@ -2486,10 +2486,17 @@ DROP PROCEDURE p1;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened'; SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
# Check that FLUSH must wait to get the GRL # Check that FLUSH must wait to get the GRL
# and let DROP PROCEDURE continue # and let DROP PROCEDURE continue
SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait'; SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK; FLUSH TABLES WITH READ LOCK;
# Connection 1 # Connection 1
# Once FLUSH TABLES WITH READ LOCK starts waiting
# DROP PROCEDURE will be waked up and will drop
# procedure. Global read lock will be granted after
# this statement ends.
#
# Reaping DROP PROCEDURE.
# Connection 2 # Connection 2
# Reaping FTWRL.
UNLOCK TABLES; UNLOCK TABLES;
# Connection 1 # Connection 1
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
......
...@@ -25,7 +25,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; ...@@ -25,7 +25,7 @@ ALTER TABLE t1 REMOVE PARTITIONING;
# Con default # Con default
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning'; SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter'; SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed'; SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed';
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
# Con 1 # Con 1
SET SESSION debug= "-d,sleep_before_create_table_no_lock"; SET SESSION debug= "-d,sleep_before_create_table_no_lock";
...@@ -51,12 +51,12 @@ SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_ ...@@ -51,12 +51,12 @@ SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_
SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done'; SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
ALTER TABLE t2 REMOVE PARTITIONING; ALTER TABLE t2 REMOVE PARTITIONING;
# Con default # Con default
SET SESSION debug= "+d,sleep_before_part2_delete_table"; SET SESSION debug= "+d,sleep_before_no_locks_delete_table";
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions'; SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
SET DEBUG_SYNC= 'rm_table_part2_before_delete_table SIGNAL waiting_for_alter'; SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done'; SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t2;
SET SESSION debug= "-d,sleep_before_part2_delete_table"; SET SESSION debug= "-d,sleep_before_no_locks_delete_table";
# Con 1 # Con 1
ERROR 42S02: Table 'test.t2' doesn't exist ERROR 42S02: Table 'test.t2' doesn't exist
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
......
...@@ -489,3 +489,31 @@ Warning 1265 Data truncated for column 'b' at row 1 ...@@ -489,3 +489,31 @@ Warning 1265 Data truncated for column 'b' at row 1
Error 1067 Invalid default value for 'b' Error 1067 Invalid default value for 'b'
SET SESSION sql_mode = @old_mode; SET SESSION sql_mode = @old_mode;
DROP TABLE t1; DROP TABLE t1;
#
# Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the
# table unusable".
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a))
ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2;
INSERT INTO t1 values (0,1), (1,2);
# The below ALTER should fail. It should leave the
# table in its original, non-corrupted, usable state.
ALTER TABLE t1 ADD UNIQUE KEY (b);
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
# The below statements should succeed, as ALTER should
# have left table intact.
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) NOT NULL,
`b` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 2 */
SELECT * FROM t1;
a b
1 2
0 1
DROP TABLE t1;
...@@ -1514,3 +1514,27 @@ ALTER TABLE t1 CHARACTER SET = utf8; ...@@ -1514,3 +1514,27 @@ ALTER TABLE t1 CHARACTER SET = utf8;
COMMIT; COMMIT;
DROP TRIGGER t1_bi; DROP TRIGGER t1_bi;
DROP TABLE t1; DROP TABLE t1;
#
# Bug#57306 SHOW PROCESSLIST does not display string literals well.
#
SET NAMES latin1;
SELECT GET_LOCK('t', 1000);
GET_LOCK('t', 1000)
1
SET NAMES latin1;
SELECT GET_LOCK('t',1000) AS 'óóóó';;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
### root ### test Query ### ### SHOW PROCESSLIST
### root ### test Query ### ### SELECT GET_LOCK('t',1000) AS 'óóóó'
SET NAMES utf8;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
### root ### test Query ### ### SHOW PROCESSLIST
### root ### test Query ### ### SELECT GET_LOCK('t',1000) AS 'óóóó'
SELECT RELEASE_LOCK('t');
RELEASE_LOCK('t')
1
óóóó
1
SET NAMES latin1;
...@@ -735,5 +735,96 @@ END latin1 latin1_swedish_ci latin1_swedish_ci ...@@ -735,5 +735,96 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
# Connection default; # Connection default;
DROP PROCEDURE p1; DROP PROCEDURE p1;
# #
# Bug#57663 Concurrent statement using stored function and DROP DATABASE
# breaks SBR
#
DROP DATABASE IF EXISTS db1;
DROP FUNCTION IF EXISTS f1;
# Test 1: Check that DROP DATABASE block if a function is used
# by an active transaction.
# Connection default
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
START TRANSACTION;
SELECT db1.f1();
db1.f1()
1
# Connection con1
# Sending:
DROP DATABASE db1;
# Connection default
# Waiting for DROP DATABASE to be blocked by the lock on f1()
COMMIT;
# Connection con1
# Reaping: DROP DATABASE db1
# Test 2: Check that DROP DATABASE blocks if a procedure is
# used by an active transaction.
# Connection default
CREATE DATABASE db1;
CREATE PROCEDURE db1.p1() BEGIN END;
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
CALL db1.p1();
RETURN 1;
END|
START TRANSACTION;
SELECT f1();
f1()
1
# Connection con1
# Sending:
DROP DATABASE db1;
# Connection default
# Waiting for DROP DATABASE to be blocked by the lock on p1()
COMMIT;
# Connection con1
# Reaping: DROP DATABASE db1
# Test 3: Check that DROP DATABASE is not selected as a victim if a
# deadlock is discovered with DML statements.
# Connection default
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
START TRANSACTION;
SELECT db1.f1();
db1.f1()
1
# Connection con1
# Sending:
DROP DATABASE db1;
# Connection default
# Waiting for DROP DATABASE to be blocked by the lock on f1()
SELECT * FROM db1.t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
# Connection con1
# Reaping: DROP DATABASE db1
# Test 4: Check that active DROP DATABASE blocks stored routine DDL.
# Connection default
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
CREATE FUNCTION db1.f2() RETURNS INTEGER RETURN 2;
START TRANSACTION;
SELECT db1.f2();
db1.f2()
2
# Connection con1
# Sending:
DROP DATABASE db1;
# Connection con2
# Waiting for DROP DATABASE to be blocked by the lock on f2()
# Sending:
ALTER FUNCTION db1.f1 COMMENT "test";
# Connection default
# Waiting for ALTER FUNCTION to be blocked by the schema lock on db1
COMMIT;
# Connection con1
# Reaping: DROP DATABASE db1
# Connection con2
# Reaping: ALTER FUNCTION f1 COMMENT 'test'
ERROR 42000: FUNCTION db1.f1 does not exist
# Connection default
DROP FUNCTION f1;
#
# End of 5.5 tests # End of 5.5 tests
# #
...@@ -1093,4 +1093,11 @@ Warnings: ...@@ -1093,4 +1093,11 @@ Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT' Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT' Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
DROP TABLE t1; DROP TABLE t1;
#
# Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
#
SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
End of 5.1 tests End of 5.1 tests
This diff is collapsed.
...@@ -84,8 +84,6 @@ test t8 Compact ...@@ -84,8 +84,6 @@ test t8 Compact
test t9 Compact test t9 Compact
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14; drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0; alter table t1 key_block_size=0;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
alter table t1 row_format=dynamic; alter table t1 row_format=dynamic;
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
...@@ -191,16 +189,9 @@ set global innodb_file_per_table = on; ...@@ -191,16 +189,9 @@ set global innodb_file_per_table = on;
set global innodb_file_format = `1`; set global innodb_file_format = `1`;
set innodb_strict_mode = off; set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0; create table t1 (id int primary key) engine = innodb key_block_size = 0;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
drop table t1; drop table t1;
set innodb_strict_mode = on; set innodb_strict_mode = on;
create table t1 (id int primary key) engine = innodb key_block_size = 0; create table t1 (id int primary key) engine = innodb key_block_size = 0;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show warnings;
Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 9; create table t2 (id int primary key) engine = innodb key_block_size = 9;
ERROR HY000: Can't create table 'test.t2' (errno: 1478) ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show warnings; show warnings;
...@@ -219,6 +210,7 @@ create table t11(id int primary key) engine = innodb row_format = redundant; ...@@ -219,6 +210,7 @@ create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format table_schema table_name row_format
test t1 Compact
test t10 Compact test t10 Compact
test t11 Redundant test t11 Redundant
test t3 Compressed test t3 Compressed
...@@ -228,7 +220,7 @@ test t6 Compressed ...@@ -228,7 +220,7 @@ test t6 Compressed
test t7 Compressed test t7 Compressed
test t8 Compressed test t8 Compressed
test t9 Dynamic test t9 Dynamic
drop table t3, t4, t5, t6, t7, t8, t9, t10, t11; drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed; key_block_size = 8 row_format = compressed;
create table t2 (id int primary key) engine = innodb create table t2 (id int primary key) engine = innodb
...@@ -254,16 +246,12 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. ...@@ -254,16 +246,12 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478) Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default; key_block_size = 8 row_format = default;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show warnings;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t5' (errno: 1478)
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format table_schema table_name row_format
test t1 Compressed test t1 Compressed
drop table t1; test t5 Compressed
drop table t1, t5;
create table t1 (id int primary key) engine = innodb create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant; key_block_size = 9 row_format = redundant;
ERROR HY000: Can't create table 'test.t1' (errno: 1478) ERROR HY000: Can't create table 'test.t1' (errno: 1478)
......
CREATE TABLE bug53046_1 (c1 INT PRIMARY KEY) ENGINE=INNODB;
CREATE TABLE bug53046_2 (c2 INT PRIMARY KEY,
FOREIGN KEY (c2) REFERENCES bug53046_1(c1)
ON UPDATE CASCADE ON DELETE CASCADE) ENGINE=INNODB;
INSERT INTO bug53046_1 VALUES (1);
INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
FROM bug53046_1;
INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
FROM bug53046_1;
INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
FROM bug53046_1;
INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
FROM bug53046_1;
INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
FROM bug53046_1;
INSERT INTO bug53046_2 VALUES (1), (2);
ANALYZE TABLE bug53046_1;
Table Op Msg_type Msg_text
test.bug53046_1 analyze status OK
SHOW TABLE STATUS LIKE 'bug53046_1';
UPDATE bug53046_1 SET c1 = c1 - 1;
DELETE FROM bug53046_1;
INSERT INTO bug53046_1 VALUES (1);
INSERT INTO bug53046_2 VALUES (1);
TRUNCATE TABLE bug53046_2;
DROP TABLE bug53046_2;
DROP TABLE bug53046_1;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
SET innodb_strict_mode=ON;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
bug54679 Compressed row_format=COMPRESSED
ALTER TABLE bug54679 ADD COLUMN b INT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
bug54679 Compressed row_format=COMPRESSED
DROP TABLE bug54679;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
bug54679 Compact
ALTER TABLE bug54679 KEY_BLOCK_SIZE=1;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
bug54679 Compressed KEY_BLOCK_SIZE=1
ALTER TABLE bug54679 ROW_FORMAT=REDUNDANT;
ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table '#sql-temporary' (errno: 1478)
DROP TABLE bug54679;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
bug54679 Redundant row_format=REDUNDANT
ALTER TABLE bug54679 KEY_BLOCK_SIZE=2;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
bug54679 Compressed row_format=REDUNDANT KEY_BLOCK_SIZE=2
SET GLOBAL innodb_file_format=Antelope;
ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table '#sql-temporary' (errno: 1478)
ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table '#sql-temporary' (errno: 1478)
DROP TABLE bug54679;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table 'test.bug54679' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.bug54679' (errno: 1478)
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=OFF;
ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table '#sql-temporary' (errno: 1478)
ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table '#sql-temporary' (errno: 1478)
DROP TABLE bug54679;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
ERROR HY000: Can't create table 'test.bug54679' (errno: 1478)
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.bug54679' (errno: 1478)
SET GLOBAL innodb_file_per_table=ON;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
DROP TABLE bug54679;
This diff is collapsed.
CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,
price DECIMAL, PRIMARY KEY(category, id)) ENGINE=INNODB;
CREATE TABLE customer (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,
product_category INT NOT NULL,
product_id INT NOT NULL,
customer_id INT NOT NULL,
PRIMARY KEY(no),
INDEX (product_category, product_id),
FOREIGN KEY (product_category, product_id)
REFERENCES product(category, id) ON UPDATE CASCADE ON DELETE RESTRICT,
INDEX (customer_id),
FOREIGN KEY (customer_id)
REFERENCES customer(id)
) ENGINE=INNODB;
SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME product_order_ibfk_1
UNIQUE_CONSTRAINT_CATALOG def
UNIQUE_CONSTRAINT_SCHEMA test
UNIQUE_CONSTRAINT_NAME PRIMARY
MATCH_OPTION NONE
UPDATE_RULE CASCADE
DELETE_RULE RESTRICT
TABLE_NAME product_order
REFERENCED_TABLE_NAME product
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME product_order_ibfk_2
UNIQUE_CONSTRAINT_CATALOG def
UNIQUE_CONSTRAINT_SCHEMA test
UNIQUE_CONSTRAINT_NAME PRIMARY
MATCH_OPTION NONE
UPDATE_RULE RESTRICT
DELETE_RULE RESTRICT
TABLE_NAME product_order
REFERENCED_TABLE_NAME customer
DROP TABLE product_order;
DROP TABLE product;
DROP TABLE customer;
This diff is collapsed.
...@@ -176,9 +176,7 @@ set innodb_strict_mode = on; ...@@ -176,9 +176,7 @@ set innodb_strict_mode = on;
#Test different values of KEY_BLOCK_SIZE #Test different values of KEY_BLOCK_SIZE
--error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 0; create table t1 (id int primary key) engine = innodb key_block_size = 0;
show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 9; create table t2 (id int primary key) engine = innodb key_block_size = 9;
...@@ -199,7 +197,7 @@ create table t11(id int primary key) engine = innodb row_format = redundant; ...@@ -199,7 +197,7 @@ create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
drop table t3, t4, t5, t6, t7, t8, t9, t10, t11; drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
#test different values of ROW_FORMAT with KEY_BLOCK_SIZE #test different values of ROW_FORMAT with KEY_BLOCK_SIZE
create table t1 (id int primary key) engine = innodb create table t1 (id int primary key) engine = innodb
...@@ -220,14 +218,12 @@ create table t4 (id int primary key) engine = innodb ...@@ -220,14 +218,12 @@ create table t4 (id int primary key) engine = innodb
key_block_size = 8 row_format = dynamic; key_block_size = 8 row_format = dynamic;
show warnings; show warnings;
--error ER_CANT_CREATE_TABLE
create table t5 (id int primary key) engine = innodb create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default; key_block_size = 8 row_format = default;
show warnings;
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
drop table t1; drop table t1, t5;
#test multiple errors #test multiple errors
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
......
#
# http://bugs.mysql.com/53046
# dict_update_statistics_low can still be run concurrently on same table
#
# This is a symbolic test, it would not fail if the bug is present.
# Rather those SQL commands have been used during manual testing under
# UNIV_DEBUG & UNIV_SYNC_DEBUG to test all changed codepaths for locking
# correctness.
#
-- source include/have_innodb.inc
CREATE TABLE bug53046_1 (c1 INT PRIMARY KEY) ENGINE=INNODB;
CREATE TABLE bug53046_2 (c2 INT PRIMARY KEY,
FOREIGN KEY (c2) REFERENCES bug53046_1(c1)
ON UPDATE CASCADE ON DELETE CASCADE) ENGINE=INNODB;
INSERT INTO bug53046_1 VALUES (1);
let $i = 5;
while ($i) {
eval INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
FROM bug53046_1;
dec $i;
}
INSERT INTO bug53046_2 VALUES (1), (2);
# CREATE TABLE innodb_table_monitor (a int) ENGINE=INNODB;
# wait more than 1 minute and observe the mysqld output
# DROP TABLE innodb_table_monitor;
ANALYZE TABLE bug53046_1;
# this prints create time and other nondeterministic data
-- disable_result_log
SHOW TABLE STATUS LIKE 'bug53046_1';
-- enable_result_log
UPDATE bug53046_1 SET c1 = c1 - 1;
DELETE FROM bug53046_1;
INSERT INTO bug53046_1 VALUES (1);
INSERT INTO bug53046_2 VALUES (1);
TRUNCATE TABLE bug53046_2;
DROP TABLE bug53046_2;
DROP TABLE bug53046_1;
# Test Bug #54679 alter table causes compressed row_format to revert to compact
--source include/have_innodb.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
SET innodb_strict_mode=ON;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
# The ROW_FORMAT of the table should be preserved when it is not specified
# in ALTER TABLE.
ALTER TABLE bug54679 ADD COLUMN b INT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
DROP TABLE bug54679;
# Check that the ROW_FORMAT conversion to/from COMPRESSED works.
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
# KEY_BLOCK_SIZE implies COMPRESSED.
ALTER TABLE bug54679 KEY_BLOCK_SIZE=1;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
ALTER TABLE bug54679 ROW_FORMAT=REDUNDANT;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
DROP TABLE bug54679;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
ALTER TABLE bug54679 KEY_BLOCK_SIZE=2;
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
WHERE TABLE_NAME='bug54679';
# This prevents other than REDUNDANT or COMPACT ROW_FORMAT for new tables.
SET GLOBAL innodb_file_format=Antelope;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
DROP TABLE bug54679;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
SET GLOBAL innodb_file_format=Barracuda;
# This will prevent ROW_FORMAT=COMPRESSED, because the system tablespace
# cannot be compressed.
SET GLOBAL innodb_file_per_table=OFF;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
DROP TABLE bug54679;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_CANT_CREATE_TABLE
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
SHOW WARNINGS;
SET GLOBAL innodb_file_per_table=ON;
CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
DROP TABLE bug54679;
# restore original values, quietly so the test does not fail if those
# defaults are changed
-- disable_query_log
EVAL SET GLOBAL innodb_file_format=$file_format;
EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
-- enable_query_log
This diff is collapsed.
#
# Bug #57904 Missing constraint from information schema REFERENTIAL_CONSTRAINTS table
#
-- source include/have_innodb.inc
CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,
price DECIMAL, PRIMARY KEY(category, id)) ENGINE=INNODB;
CREATE TABLE customer (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,
product_category INT NOT NULL,
product_id INT NOT NULL,
customer_id INT NOT NULL,
PRIMARY KEY(no),
INDEX (product_category, product_id),
FOREIGN KEY (product_category, product_id)
REFERENCES product(category, id) ON UPDATE CASCADE ON DELETE RESTRICT,
INDEX (customer_id),
FOREIGN KEY (customer_id)
REFERENCES customer(id)
) ENGINE=INNODB;
query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
DROP TABLE product_order;
DROP TABLE product;
DROP TABLE customer;
...@@ -37,7 +37,6 @@ where name like 'Wait/Synch/Cond/sql/%' ...@@ -37,7 +37,6 @@ where name like 'Wait/Synch/Cond/sql/%'
order by name limit 10; order by name limit 10;
NAME ENABLED TIMED NAME ENABLED TIMED
wait/synch/cond/sql/COND_flush_thread_cache YES YES wait/synch/cond/sql/COND_flush_thread_cache YES YES
wait/synch/cond/sql/COND_global_read_lock YES YES
wait/synch/cond/sql/COND_manager YES YES wait/synch/cond/sql/COND_manager YES YES
wait/synch/cond/sql/COND_queue_state YES YES wait/synch/cond/sql/COND_queue_state YES YES
wait/synch/cond/sql/COND_rpl_status YES YES wait/synch/cond/sql/COND_rpl_status YES YES
...@@ -46,6 +45,7 @@ wait/synch/cond/sql/COND_thread_cache YES YES ...@@ -46,6 +45,7 @@ wait/synch/cond/sql/COND_thread_cache YES YES
wait/synch/cond/sql/COND_thread_count YES YES wait/synch/cond/sql/COND_thread_count YES YES
wait/synch/cond/sql/Delayed_insert::cond YES YES wait/synch/cond/sql/Delayed_insert::cond YES YES
wait/synch/cond/sql/Delayed_insert::cond_client YES YES wait/synch/cond/sql/Delayed_insert::cond_client YES YES
wait/synch/cond/sql/Event_scheduler::COND_state YES YES
select * from performance_schema.setup_instruments select * from performance_schema.setup_instruments
where name='Wait'; where name='Wait';
select * from performance_schema.setup_instruments select * from performance_schema.setup_instruments
......
...@@ -100,3 +100,4 @@ INNER JOIN performance_schema.threads p USING (THREAD_ID) ...@@ -100,3 +100,4 @@ INNER JOIN performance_schema.threads p USING (THREAD_ID)
WHERE p.PROCESSLIST_ID = 1 WHERE p.PROCESSLIST_ID = 1
GROUP BY h.EVENT_NAME GROUP BY h.EVENT_NAME
HAVING TOTAL_WAIT > 0; HAVING TOTAL_WAIT > 0;
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
...@@ -110,4 +110,5 @@ WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); ...@@ -110,4 +110,5 @@ WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed;
test_fm2_rw_timed test_fm2_rw_timed
Success Success
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1; DROP TABLE t1;
use performance_schema; use performance_schema;
update performance_schema.setup_instruments set enabled='YES';
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges; flush privileges;
connect (con1, localhost, pfsuser, , test); connect (con1, localhost, pfsuser, , test);
...@@ -21,9 +22,9 @@ select event_name, ...@@ -21,9 +22,9 @@ select event_name,
left(source, locate(":", source)) as short_source, left(source, locate(":", source)) as short_source,
timer_end, timer_wait, operation timer_end, timer_wait, operation
from performance_schema.events_waits_current from performance_schema.events_waits_current
where event_name like "wait/synch/cond/sql/COND_global_read_lock"; where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
event_name short_source timer_end timer_wait operation event_name short_source timer_end timer_wait operation
wait/synch/cond/sql/COND_global_read_lock lock.cc: NULL NULL wait wait/synch/cond/sql/MDL_context::COND_wait_status mdl.cc: NULL NULL timed_wait
unlock tables; unlock tables;
update performance_schema.setup_instruments set enabled='NO'; update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES'; update performance_schema.setup_instruments set enabled='YES';
......
...@@ -190,3 +190,6 @@ HAVING TOTAL_WAIT > 0; ...@@ -190,3 +190,6 @@ HAVING TOTAL_WAIT > 0;
## HAVING BYTES > 0 ## HAVING BYTES > 0
## ORDER BY i.user, h.operation; ## ORDER BY i.user, h.operation;
## --enable_result_log ## --enable_result_log
# Clean-up.
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
...@@ -128,4 +128,6 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) ...@@ -128,4 +128,6 @@ SET @after_count = (SELECT SUM(TIMER_WAIT)
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed;
# Clean-up.
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1; DROP TABLE t1;
This diff is collapsed.
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06 ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--loose-debug=+d,make_global_read_lock_block_commit_loop
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment