2807 Tomas Ulin 2009-01-20 [merge]
merge
added:
mysql-test/suite/ddl_lock/
mysql-test/suite/ddl_lock/README
mysql-test/suite/ddl_lock/include/
mysql-test/suite/ddl_lock/include/stress_settings.inc
mysql-test/suite/ddl_lock/include/sync_lock.inc
mysql-test/suite/ddl_lock/r/
mysql-test/suite/ddl_lock/r/concurrent_ddl.result
mysql-test/suite/ddl_lock/r/create_stress_tables.result
mysql-test/suite/ddl_lock/r/stress_ddl.result
mysql-test/suite/ddl_lock/r/stress_dml.result
mysql-test/suite/ddl_lock/stress_init.txt
mysql-test/suite/ddl_lock/stress_tests.txt
mysql-test/suite/ddl_lock/t/
mysql-test/suite/ddl_lock/t/concurrent_ddl.test
mysql-test/suite/ddl_lock/t/create_stress_tables.test
mysql-test/suite/ddl_lock/t/stress_ddl.test
mysql-test/suite/ddl_lock/t/stress_dml.test
sql/debug_sync.h
modified:
.bzr-mysql/default.conf
libmysqld/lib_sql.cc
mysql-test/r/alter_table.result
mysql-test/r/implicit_commit.result
mysql-test/r/innodb_mrr.result
mysql-test/r/join_cache.result
mysql-test/r/partition.result
mysql-test/r/ps.result
mysql-test/r/sp-dynamic.result
mysql-test/r/sp-vars.result
mysql-test/r/sp.result
mysql-test/r/sp_notembedded.result
mysql-test/r/subselect3.result
mysql-test/r/subselect3_jcl6.result
mysql-test/r/trigger.result
mysql-test/suite/binlog/r/binlog_unsafe.result
mysql-test/suite/falcon/r/falcon_bug_28049.result
mysql-test/suite/falcon/r/falcon_bug_32833.result
mysql-test/suite/falcon/r/falcon_bugs.result
mysql-test/suite/funcs_1/r/falcon_storedproc_02.result
mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
mysql-test/suite/funcs_1/r/memory_storedproc_02.result
mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
mysql-test/suite/funcs_1/r/storedproc.result
mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
mysql-test/t/alter_table.test
mysql-test/t/innodb_mrr.test
mysql-test/t/join_cache.test
mysql-test/t/sp.test
mysql-test/t/subselect3.test
mysql-test/t/trigger.test
sql/Makefile.am
sql/backup/be_default.cc
sql/backup/be_snapshot.cc
sql/backup/kernel.cc
sql/backup/logger.h
sql/ddl_blocker.cc
sql/debug_sync.cc
sql/ha_ndbcluster.cc
sql/ha_partition.h
sql/handler.cc
sql/handler.h
sql/item_func.cc
sql/lock.cc
sql/mdl.cc
sql/mysql_priv.h
sql/mysqld.cc
sql/protocol.cc
sql/protocol.h
sql/sp_head.cc
sql/sql_base.cc
sql/sql_class.cc
sql/sql_class.h
sql/sql_delete.cc
sql/sql_error.cc
sql/sql_error.h
sql/sql_insert.cc
sql/sql_join_cache.cc
sql/sql_parse.cc
sql/sql_prepare.cc
sql/sql_repl.cc
sql/sql_select.cc
sql/sql_select.h
sql/sql_table.cc
sql/sql_update.cc
storage/innobase/handler/ha_innodb.cc
storage/maria/ha_maria.cc
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.h
storage/myisam/myisam_backup_engine.cc
storage/myisammrg/ha_myisammrg.cc
2806 Tomas Ulin 2009-01-08
Bug #41858 ndb.ndb_discover_db2 fails in pushbuild due to unexpected state
removed:
mysql-test/suite/ndb/r/ndb_discover_db2.result
mysql-test/suite/ndb/t/ndb_discover_db2-master.opt
mysql-test/suite/ndb/t/ndb_discover_db2.test
modified:
mysql-test/suite/ndb/r/ndb_discover_db.result
mysql-test/suite/ndb/t/ndb_discover_db.test
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf 2008-12-31 13:49:36 +0000
+++ b/.bzr-mysql/default.conf 2009-01-14 10:10:00 +0000
@@ -1,5 +1,5 @@
[MYSQL]
-tree_location = bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0
-post_commit_to = "commits@stripped"
-post_push_to = "commits@stripped"
-tree_name = "mysql-6.0"
+tree_location = bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-runtime
+post_commit_to = commits@stripped
+post_push_to = commits@stripped
+tree_name = mysql-6.0-runtime
=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc 2008-12-11 18:04:55 +0000
+++ b/libmysqld/lib_sql.cc 2009-01-13 15:26:20 +0000
@@ -1031,7 +1031,7 @@ bool Protocol_binary::write()
void
net_send_ok(THD *thd,
uint server_status, uint statement_warn_count,
- ha_rows affected_rows, ulonglong id, const char *message)
+ ulonglong affected_rows, ulonglong id, const char *message)
{
DBUG_ENTER("emb_net_send_ok");
MYSQL_DATA *data;
=== modified file 'mysql-test/r/alter_table.result'
--- a/mysql-test/r/alter_table.result 2009-01-08 11:57:59 +0000
+++ b/mysql-test/r/alter_table.result 2009-01-20 10:26:59 +0000
@@ -1253,3 +1253,11 @@ a b
5 a
DROP TABLE t1;
End of 5.1 tests
+CREATE TABLE t1(c CHAR(10),
+i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES('a',2),('b',4),('c',6);
+ALTER TABLE t1
+DROP i,
+ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+AUTO_INCREMENT = 1;
+DROP TABLE t1;
=== modified file 'mysql-test/r/implicit_commit.result'
--- a/mysql-test/r/implicit_commit.result 2008-11-26 12:07:51 +0000
+++ b/mysql-test/r/implicit_commit.result 2008-12-10 21:53:59 +0000
@@ -55,8 +55,6 @@ create temporary table t2 as select * fr
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_DROP_TABLE TEMPORARY
#
@@ -81,8 +79,6 @@ update t2 set a=a+1 where (1) in (select
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_INSERT
#
@@ -91,8 +87,6 @@ insert into t2 set a=((1) in (select * f
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_INSERT_SELECT
#
@@ -101,8 +95,6 @@ insert into t2 select * from t1;
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_REPLACE
#
@@ -111,8 +103,6 @@ replace t2 set a=((1) in (select * from
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_REPLACE_SELECT
#
@@ -121,8 +111,6 @@ replace t2 select * from t1;
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_DELETE
#
@@ -131,8 +119,6 @@ delete from t2 where (1) in (select * fr
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
#
# SQLCOM_DELETE_MULTI
#
@@ -160,8 +146,6 @@ load data infile '../std_data_ln/words.d
CALL db1.test_if_commit();
IMPLICIT COMMIT
NO
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
drop table t4;
#
# SQLCOM_SHOW_DATABASES
=== modified file 'mysql-test/r/innodb_mrr.result'
--- a/mysql-test/r/innodb_mrr.result 2008-09-05 14:36:37 +0000
+++ b/mysql-test/r/innodb_mrr.result 2008-12-29 03:42:30 +0000
@@ -351,3 +351,32 @@ pk
1
5
drop table t1;
+#
+# BUG#39447: Error with NOT NULL condition and LIMIT 1
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL,
+parent_id int(11) DEFAULT NULL,
+name varchar(10) DEFAULT NULL,
+PRIMARY KEY (id),
+KEY ind_parent_id (parent_id)
+) ENGINE=InnoDB;
+insert into t1 (id, parent_id, name) values
+(10,NULL,'A'),
+(20,10,'B'),
+(30,10,'C'),
+(40,NULL,'D'),
+(50,40,'E'),
+(60,40,'F'),
+(70,NULL,'J');
+SELECT id FROM t1 WHERE parent_id IS NOT NULL ORDER BY id DESC LIMIT 1;
+id
+60
+This must show type=index, extra=Using where
+explain SELECT * FROM t1 WHERE parent_id IS NOT NULL ORDER BY id DESC LIMIT 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index ind_parent_id PRIMARY 4 NULL 2 Using where
+SELECT * FROM t1 WHERE parent_id IS NOT NULL ORDER BY id DESC LIMIT 1;
+id parent_id name
+60 40 F
+drop table t1;
=== modified file 'mysql-test/r/join_cache.result'
--- a/mysql-test/r/join_cache.result 2008-12-07 20:44:24 +0000
+++ b/mysql-test/r/join_cache.result 2009-01-08 05:47:10 +0000
@@ -3576,3 +3576,46 @@ AVG(c)
set join_buffer_size=default;
set join_cache_level=default;
DROP TABLE t1, t2;
+#
+# Bug #41894: big join buffer of level 7 used to join records
+# with null values in place of varchar strings
+#
+CREATE TABLE t1 (a int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+b varchar(127) DEFAULT NULL);
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+CREATE TABLE t2 (a int NOT NULL PRIMARY KEY, b varchar(127) DEFAULT NULL);
+INSERT INTO t2 SELECT * FROM t1;
+CREATE TABLE t3 (a int NOT NULL PRIMARY KEY, b varchar(127) DEFAULT NULL);
+INSERT INTO t3 SELECT * FROM t1;
+set join_cache_level=7;
+set join_buffer_size=1024*1024;
+EXPLAIN
+SELECT COUNT(*) FROM t1,t2,t3
+WHERE t1.a=t2.a AND t2.a=t3.a AND
+t1.b IS NULL AND t2.b IS NULL AND t3.b IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 16384 Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using join buffer
+SELECT COUNT(*) FROM t1,t2,t3
+WHERE t1.a=t2.a AND t2.a=t3.a AND
+t1.b IS NULL AND t2.b IS NULL AND t3.b IS NULL;
+COUNT(*)
+16384
+set join_buffer_size=default;
+set join_cache_level=default;
+DROP TABLE t1,t2,t3;
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result 2008-12-17 19:46:23 +0000
+++ b/mysql-test/r/partition.result 2009-01-13 15:26:20 +0000
@@ -1217,7 +1217,6 @@ COMMIT;
END|
CALL test.p1(12);
Warnings:
-Note 1051 Unknown table 't1'
Warning 1196 Some non-transactional changed tables couldn't be rolled back
CALL test.p1(13);
Warnings:
=== modified file 'mysql-test/r/ps.result'
--- a/mysql-test/r/ps.result 2008-08-07 17:52:43 +0000
+++ b/mysql-test/r/ps.result 2008-12-11 01:21:12 +0000
@@ -2746,17 +2746,21 @@ Warnings:
Note 1051 Unknown table 't1'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't1'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't2'
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
drop procedure proc_1;
create function func_1() returns int begin show warnings; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
=== modified file 'mysql-test/r/sp-dynamic.result'
--- a/mysql-test/r/sp-dynamic.result 2007-06-22 13:23:51 +0000
+++ b/mysql-test/r/sp-dynamic.result 2008-12-10 21:53:59 +0000
@@ -97,8 +97,6 @@ end|
call p1()|
a
1
-Warnings:
-Note 1051 Unknown table 't1'
call p1()|
a
1
@@ -371,9 +369,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
select @a|
@a
0
@@ -382,9 +377,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
select @a|
@a
0
=== modified file 'mysql-test/r/sp-vars.result'
--- a/mysql-test/r/sp-vars.result 2008-11-24 09:53:39 +0000
+++ b/mysql-test/r/sp-vars.result 2008-12-10 21:53:59 +0000
@@ -110,24 +110,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Warning 1264 Out of range value for column 'v1' at row 1
-Warning 1264 Out of range value for column 'v1u' at row 1
-Warning 1264 Out of range value for column 'v2' at row 1
-Warning 1264 Out of range value for column 'v2u' at row 1
-Warning 1264 Out of range value for column 'v3' at row 1
-Warning 1264 Out of range value for column 'v3u' at row 1
-Warning 1264 Out of range value for column 'v4' at row 1
-Warning 1264 Out of range value for column 'v4u' at row 1
-Warning 1264 Out of range value for column 'v5' at row 1
-Warning 1264 Out of range value for column 'v5u' at row 1
-Warning 1264 Out of range value for column 'v6' at row 1
-Warning 1264 Out of range value for column 'v6u' at row 1
-Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
-Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
-Warning 1265 Data truncated for column 'v12' at row 1
-Warning 1265 Data truncated for column 'v13' at row 1
-Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
-Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@@ -143,21 +125,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Warning 1264 Out of range value for column 'u3' at row 1
-Warning 1264 Out of range value for column 'u4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@@ -198,24 +165,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Warning 1264 Out of range value for column 'v1' at row 1
-Warning 1264 Out of range value for column 'v1u' at row 1
-Warning 1264 Out of range value for column 'v2' at row 1
-Warning 1264 Out of range value for column 'v2u' at row 1
-Warning 1264 Out of range value for column 'v3' at row 1
-Warning 1264 Out of range value for column 'v3u' at row 1
-Warning 1264 Out of range value for column 'v4' at row 1
-Warning 1264 Out of range value for column 'v4u' at row 1
-Warning 1264 Out of range value for column 'v5' at row 1
-Warning 1264 Out of range value for column 'v5u' at row 1
-Warning 1264 Out of range value for column 'v6' at row 1
-Warning 1264 Out of range value for column 'v6u' at row 1
-Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
-Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
-Warning 1265 Data truncated for column 'v12' at row 1
-Warning 1265 Data truncated for column 'v13' at row 1
-Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
-Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@@ -231,21 +180,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Warning 1264 Out of range value for column 'u3' at row 1
-Warning 1264 Out of range value for column 'u4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@@ -451,10 +385,6 @@ FF
HEX(v10)
FF
Warnings:
-Warning 1264 Out of range value for column 'v8' at row 1
-Warning 1264 Out of range value for column 'v9' at row 1
-Warning 1264 Out of range value for column 'v10' at row 1
-Warning 1264 Out of range value for column 'v1' at row 1
Warning 1264 Out of range value for column 'v5' at row 1
DROP PROCEDURE p1;
=== modified file 'mysql-test/r/sp.result'
--- a/mysql-test/r/sp.result 2009-01-08 11:57:59 +0000
+++ b/mysql-test/r/sp.result 2009-01-20 10:26:59 +0000
@@ -526,8 +526,6 @@ end|
delete from t1|
create table t3 ( s char(16), d int)|
call into_test4()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
select * from t3|
s d
into4 NULL
@@ -1118,8 +1116,6 @@ end|
select f9()|
f9()
6
-Warnings:
-Note 1051 Unknown table 't3'
select f9() from t1 limit 1|
f9()
6
@@ -1160,8 +1156,6 @@ drop temporary table t3|
select f12_1()|
f12_1()
3
-Warnings:
-Note 1051 Unknown table 't3'
select f12_1() from t1 limit 1|
f12_1()
3
@@ -2113,12 +2107,7 @@ end if;
insert into t4 values (2, rc, t3);
end|
call bug1863(10)|
-Warnings:
-Note 1051 Unknown table 'temp_t1'
-Warning 1329 No data - zero rows fetched, selected, or processed
call bug1863(10)|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
select * from t4|
f1 rc t3
2 0 NULL
@@ -2383,11 +2372,7 @@ begin
end|
call bug4579_1()|
call bug4579_1()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
call bug4579_1()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|
@@ -3773,9 +3758,6 @@ Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(3,3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-Warnings:
-Warning 1264 Out of range value for column 'spv1' at row 1
-Warning 1366 Incorrect decimal value: 'test' for column 'spv1' at row 1
call bug12589_2()|
Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
@@ -6134,35 +6116,6 @@ bug5274_f2()
x
Warnings:
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
drop procedure if exists proc_21513|
@@ -6257,20 +6210,17 @@ f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
PREPARE s1 FROM 'SELECT f1(2)';
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP FUNCTION f1;
@@ -6282,6 +6232,7 @@ create procedure mysqltest_db1.sp_bug285
call mysqltest_db1.sp_bug28551();
show warnings;
Level Code Message
+Note 1008 Can't drop database 'mysqltest_db1'; database doesn't exist
drop database mysqltest_db1;
drop database if exists mysqltest_db1;
drop table if exists test.t1;
@@ -6993,6 +6944,101 @@ INSERT INTO t1 VALUES (1);
SELECT * FROM t1 WHERE a = f1();
ERROR 42S02: Table 'test.t_non_existing' doesn't exist
DROP FUNCTION f1;
+DROP TABLE t1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1(a INT, b CHAR)
+BEGIN
+IF a > 0 THEN
+CALL p1(a-1, 'ab');
+ELSE
+SELECT 1;
+END IF;
+END|
+SET @save_max_sp_recursion= @@max_sp_recursion_depth;
+SET @@max_sp_recursion_depth= 5;
+CALL p1(4, 'a');
+1
+1
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
+SET @@max_sp_recursion_depth= @save_max_sp_recursion;
+DROP PROCEDURE p1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1(a CHAR)
+BEGIN
+SELECT 1;
+SELECT CAST('10 ' as UNSIGNED INTEGER);
+SELECT 1;
+END|
+CALL p1('data truncated parameter');
+1
+1
+CAST('10 ' as UNSIGNED INTEGER)
+10
+1
+1
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '10 '
+DROP PROCEDURE p1;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+CREATE PROCEDURE p1()
+CALL p2()|
+CREATE PROCEDURE p2()
+CALL p3()|
+CREATE PROCEDURE p3()
+CALL p4()|
+CREATE PROCEDURE p4()
+BEGIN
+SELECT 1;
+SELECT CAST('10 ' as UNSIGNED INTEGER);
+SELECT 2;
+END|
+CALL p1();
+1
+1
+CAST('10 ' as UNSIGNED INTEGER)
+10
+2
+2
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '10 '
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a CHAR(2));
+INSERT INTO t1 VALUES ('aa');
+CREATE FUNCTION f1() RETURNS CHAR
+RETURN (SELECT f2())|
+CREATE FUNCTION f2() RETURNS CHAR
+RETURN (SELECT f3())|
+CREATE FUNCTION f3() RETURNS CHAR
+RETURN (SELECT f4())|
+CREATE FUNCTION f4() RETURNS CHAR
+BEGIN
+RETURN (SELECT a FROM t1);
+END|
+SELECT f1();
+f1()
+a
+Warnings:
+Warning 1265 Data truncated for column 'f4()' at row 1
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP FUNCTION f3;
+DROP FUNCTION f4;
DROP TABLE t1;
# ------------------------------------------------------------------
# -- End of 6.0 tests
=== modified file 'mysql-test/r/sp_notembedded.result'
--- a/mysql-test/r/sp_notembedded.result 2008-03-26 19:27:23 +0000
+++ b/mysql-test/r/sp_notembedded.result 2008-12-10 21:53:59 +0000
@@ -21,9 +21,11 @@ end|
call bug4902_2()|
show warnings|
Level Code Message
+Note 1305 PROCEDURE test.bug4902_2 does not exist
call bug4902_2()|
show warnings|
Level Code Message
+Note 1305 PROCEDURE test.bug4902_2 does not exist
drop procedure bug4902_2|
drop table if exists t1|
create table t1 (
=== modified file 'mysql-test/r/subselect3.result'
--- a/mysql-test/r/subselect3.result 2008-12-23 04:05:29 +0000
+++ b/mysql-test/r/subselect3.result 2008-12-28 15:00:21 +0000
@@ -1190,3 +1190,36 @@ a
9
set join_cache_level=@save_join_cache_level;
drop table t0, t1;
+#
+# BUG#32665 Query with dependent subquery is too slow
+#
+create table t1 (
+idIndividual int primary key
+);
+insert into t1 values (1),(2);
+create table t2 (
+idContact int primary key,
+contactType int,
+idObj int
+);
+insert into t2 values (1,1,1),(2,2,2),(3,3,3);
+create table t3 (
+idAddress int primary key,
+idContact int,
+postalStripped varchar(100)
+);
+insert into t3 values (1,1, 'foo'), (2,2,'bar');
+The following must be converted to a semi-join:
+explain extended SELECT a.idIndividual FROM t1 a
+WHERE a.idIndividual IN
+( SELECT c.idObj FROM t3 cona
+INNER JOIN t2 c ON c.idContact=cona.idContact
+WHERE cona.postalStripped='T2H3B2'
+ );
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start materialize; Scan
+1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 End materialize
+1 PRIMARY a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer
+Warnings:
+Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2'))
+drop table t1,t2,t3;
=== modified file 'mysql-test/r/subselect3_jcl6.result'
--- a/mysql-test/r/subselect3_jcl6.result 2008-12-23 04:05:29 +0000
+++ b/mysql-test/r/subselect3_jcl6.result 2008-12-28 15:00:21 +0000
@@ -1195,6 +1195,39 @@ a
9
set join_cache_level=@save_join_cache_level;
drop table t0, t1;
+#
+# BUG#32665 Query with dependent subquery is too slow
+#
+create table t1 (
+idIndividual int primary key
+);
+insert into t1 values (1),(2);
+create table t2 (
+idContact int primary key,
+contactType int,
+idObj int
+);
+insert into t2 values (1,1,1),(2,2,2),(3,3,3);
+create table t3 (
+idAddress int primary key,
+idContact int,
+postalStripped varchar(100)
+);
+insert into t3 values (1,1, 'foo'), (2,2,'bar');
+The following must be converted to a semi-join:
+explain extended SELECT a.idIndividual FROM t1 a
+WHERE a.idIndividual IN
+( SELECT c.idObj FROM t3 cona
+INNER JOIN t2 c ON c.idContact=cona.idContact
+WHERE cona.postalStripped='T2H3B2'
+ );
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start materialize; Scan
+1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 End materialize; Using join buffer
+1 PRIMARY a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer
+Warnings:
+Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2'))
+drop table t1,t2,t3;
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
=== modified file 'mysql-test/r/trigger.result'
--- a/mysql-test/r/trigger.result 2008-07-14 12:49:19 +0000
+++ b/mysql-test/r/trigger.result 2008-12-10 21:53:59 +0000
@@ -2054,3 +2054,51 @@ drop trigger trg1;
drop trigger trg2;
drop table t1, t2;
End of 5.1 tests.
+DROP TRIGGER IF EXISTS trg1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE a CHAR;
+SELECT 'ab' INTO a;
+SELECT 'ab' INTO a;
+SELECT 'a' INTO a;
+END|
+INSERT INTO t1 VALUES (1);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+DROP TRIGGER trg1;
+DROP TABLE t1;
+DROP TRIGGER IF EXISTS trg1;
+DROP TRIGGER IF EXISTS trg2;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE trg1 CHAR;
+SELECT 'ab' INTO trg1;
+END|
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE trg2 CHAR;
+SELECT 'ab' INTO trg2;
+END|
+INSERT INTO t1 VALUES (0);
+Warnings:
+Warning 1265 Data truncated for column 'trg1' at row 1
+Warning 1265 Data truncated for column 'trg2' at row 1
+SELECT * FROM t1;
+a
+0
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t1 VALUES (1),(2);
+Warnings:
+Warning 1265 Data truncated for column 'trg1' at row 1
+Warning 1265 Data truncated for column 'trg2' at row 1
+Warning 1265 Data truncated for column 'trg1' at row 1
+Warning 1265 Data truncated for column 'trg2' at row 1
+DROP TRIGGER trg1;
+DROP TRIGGER trg2;
+DROP TABLE t1;
+End of 6.0 tests.
=== modified file 'mysql-test/suite/binlog/r/binlog_unsafe.result'
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result 2008-05-29 15:44:11 +0000
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result 2008-12-11 01:21:12 +0000
@@ -43,12 +43,6 @@ END|
CALL proc();
Warnings:
Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
---- Insert from stored function ----
CREATE FUNCTION func()
RETURNS INT
@@ -67,12 +61,6 @@ func()
0
Warnings:
Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
---- Insert from trigger ----
CREATE TRIGGER trig
BEFORE INSERT ON trigger_table
@@ -90,12 +78,6 @@ INSERT INTO trigger_table VALUES ('bye.'
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
---- Insert from prepared statement ----
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
@@ -155,12 +137,6 @@ func5()
0
Warnings:
Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
==== Variables that should *not* be unsafe ====
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
@@ -214,9 +190,6 @@ DELETE FROM t1 LIMIT 1;
END|
CALL p1();
Warnings:
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
-Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
=== added directory 'mysql-test/suite/ddl_lock'
=== added file 'mysql-test/suite/ddl_lock/README'
--- a/mysql-test/suite/ddl_lock/README 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/README 2008-12-17 10:11:14 +0000
@@ -0,0 +1,22 @@
+*DDL LOCKING TEST SUITE*
+
+This is the test suite for WL#4343
+
+Tests:
+- concurrent_ddl.test - WL#4343 Part 1. (Functional testing of
+ concurrent DDL operations)
+
+*STRESS TESTING*
+
+Typical example of running the stress test for one hour:
+
+./mysql-test-run --stress \
+ --stress-suite=ddl_lock \
+ --stress-threads=55 \
+ --stress-test-duration=3600
+
+This stress test used the tests specified in stress_init.txt and
+stress_tests.txt.
+
+
+Jorgen.Austvik@stripped
=== added directory 'mysql-test/suite/ddl_lock/include'
=== added file 'mysql-test/suite/ddl_lock/include/stress_settings.inc'
--- a/mysql-test/suite/ddl_lock/include/stress_settings.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/include/stress_settings.inc 2008-12-17 10:11:14 +0000
@@ -0,0 +1,4 @@
+##
+## Standard settings (global variables) for the stress testing.
+##
+let $num_stress_rows= 5000;
=== added file 'mysql-test/suite/ddl_lock/include/sync_lock.inc'
--- a/mysql-test/suite/ddl_lock/include/sync_lock.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/include/sync_lock.inc 2008-12-17 10:11:14 +0000
@@ -0,0 +1,75 @@
+#
+# SUMMARY
+#
+# Locks a table in one thread, run an SQL statement in another thread,
+# and check that the SQL statement is locked.
+#
+# USAGE
+#
+# let $lock_table= t1; # The table to be locked
+# let $sql= DROP TABLE t1 ; # The SQL statement that should lock
+#
+# OPTIONAL
+# let $sync= after_start_ddl; # What to sync with to unlock the tables.
+# # Default: wait_for_lock
+# let $setup= HANDLER t1 OPEN; # Statement to run before the locked
+# # statement
+# let $teardown= HANDLER t1 CLOSE; # Statement to run after the lock has
+# # been unlocked
+#
+# EXAMPLE
+# concurrent_ddl.test in ddl_lock suite.
+
+--disable_warnings
+SET DEBUG_SYNC= 'RESET';
+--enable_warnings
+
+# Default value
+if (`SELECT LENGTH("$sync") = 0`) {
+ let $sync= mdl_enter_cond;
+}
+
+--echo # Connection waiter will run setup (if any)
+connection waiter;
+if (`SELECT LENGTH("$setup")`) {
+ eval $setup;
+}
+
+--echo # Using sync_lock.inc to synchronize on '$sync'
+
+--echo # Connection locker will lock the resource
+connection locker;
+
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+send;
+eval LOCK TABLES $lock_table READ;
+
+--echo # Connection waiter will wait for the resource to be locked, and then
+--echo # run the SQL that should lock.
+connection waiter;
+
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+# run mysql-test-run --debug for information about the signal
+--replace_result $sync <sync>
+eval SET DEBUG_SYNC= '$sync SIGNAL do_unlock';
+send;
+eval $sql;
+
+--echo # Connection locker will unlock the locked resources
+connection locker;
+UNLOCK TABLES;
+
+--echo # Connection waiter will wait for the SQL to return after the
+--echo # lock is unlocked, and run teardown if we have any
+connection waiter;
+reap;
+if (`SELECT LENGTH("$teardown")`) {
+ eval $teardown;
+}
+
+--echo # Cleaning up in default connection
+connection default;
+
+--disable_warnings
+SET DEBUG_SYNC= 'RESET';
+--enable_warnings
=== added directory 'mysql-test/suite/ddl_lock/r'
=== added file 'mysql-test/suite/ddl_lock/r/concurrent_ddl.result'
--- a/mysql-test/suite/ddl_lock/r/concurrent_ddl.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/r/concurrent_ddl.result 2008-12-17 10:11:14 +0000
@@ -0,0 +1,534 @@
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT) ENGINE=<engine_type>;
+INSERT INTO t1 VALUES (1);
+# Establish connection locker: the connection that locks the resource
+# Establish connection waiter: the connection that waits for the resource
+# Both these connections are used the same way in all the test cases
+# In this test.
+##
+## 1.1 One connection holding a lock on a table, other performing
+## alter, handler, truncate and drop on same object
+##
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+# Using sync_lock.inc to synchronize on 'mdl_enter_cond'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+ALTER TABLE t1 ADD COLUMN (b INT);
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+# Using sync_lock.inc to synchronize on 'mdl_enter_cond'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+RENAME TABLE t1 TO t2;
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+RENAME TABLE t2 TO t1;
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+HANDLER t1 OPEN;
+# Using sync_lock.inc to synchronize on 'locked_external'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+HANDLER t1 READ FIRST;
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+a b
+1 NULL
+HANDLER t1 CLOSE;
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+# Using sync_lock.inc to synchronize on 'mdl_enter_cond'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+TRUNCATE TABLE t1;
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+# Using sync_lock.inc to synchronize on 'mdl_enter_cond'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+DROP TABLE t1;
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+##
+## 1.2 Two connections trying to perform alter on same table/view
+##
+CREATE TABLE t1(a INT, b CHAR(100) DEFAULT "test 1.2")
+ENGINE=<engine_type>;
+INSERT INTO t1 (a) VALUES (1), (2), (3), (4), (5);
+# Switch to connection locker
+SET DEBUG_SYNC= 'alter_table_before_main_binlog
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (c CHAR(100) DEFAULT "test 1.2 locker");
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (d CHAR(100) DEFAULT "test 1.2 waiter");
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+SELECT SUM(a) FROM t1;
+SUM(a)
+15
+SELECT COUNT(*) FROM t1 WHERE NOT c LIKE "test 1.2 %";
+COUNT(*)
+0
+DROP TABLE t1;
+##
+## 1.3 One connection creating a table, another is trying to alter it
+##
+CREATE TABLE t1(a INT, b INT)
+ENGINE=<engine_type>;
+INSERT INTO t1 VALUES (1, 2), (2, 3), (3, 4), (4, 5), (5, 6);
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+CREATE TABLE t2 ENGINE=<engine_type> AS SELECT *, SLEEP(1) FROM t1;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (c INT);
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+SELECT SUM(a), SUM(b) FROM t1;
+SUM(a) SUM(b)
+15 20
+SELECT SUM(a), SUM(b) FROM t2;
+SUM(a) SUM(b)
+15 20
+DROP TABLE t1;
+DROP TABLE t2;
+##
+## 1.4 One connection is selecting (using handler) while another is
+## altering the table (select start first)
+##
+CREATE TABLE t1(a INT, b INT) ENGINE=<engine_type>;
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+# Switch to connection locker
+HANDLER t1 OPEN;
+SET DEBUG_SYNC= 'locked_external SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+HANDLER t1 READ FIRST;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (c INT);
+# Switch to connection locker
+# "reap" outcome of last statement
+a b c
+1 2 NULL
+HANDLER t1 CLOSE;
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 NULL
+3 4 NULL
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection locker
+HANDLER t1 OPEN;
+SET DEBUG_SYNC= 'locked_external SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+HANDLER t1 READ FIRST;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t1 DROP COLUMN b;
+# Switch to connection locker
+# "reap" outcome of last statement
+a c
+1 NULL
+HANDLER t1 CLOSE;
+SELECT * FROM t1 ORDER BY a;
+a c
+1 NULL
+3 NULL
+# Switch to connection waiter
+# "reap" outcome of last statement
+SELECT * FROM t1 ORDER BY a;
+a c
+1 NULL
+3 NULL
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+##
+## 1.5 One connection selecting (using handler), while another is
+## altering the table - altering table starts first
+##
+CREATE TABLE t1(a INT, b CHAR(100)) ENGINE=<engine_type>;
+INSERT INTO t1 (a) VALUES (10);
+INSERT INTO t1 (a) VALUES (9);
+INSERT INTO t1 (a) VALUES (8);
+INSERT INTO t1 (a) VALUES (7);
+INSERT INTO t1 (a) VALUES (6);
+INSERT INTO t1 (a) VALUES (5);
+INSERT INTO t1 (a) VALUES (4);
+INSERT INTO t1 (a) VALUES (3);
+INSERT INTO t1 (a) VALUES (2);
+INSERT INTO t1 (a) VALUES (1);
+# Switch to connection locker
+SET DEBUG_SYNC= 'alter_table_before_main_binlog
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (c CHAR(100) DEFAULT "test 1.5");
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+# "send" next statement
+HANDLER t1 OPEN;
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+HANDLER t1 READ FIRST;
+a b c
+10 NULL test 1.5
+HANDLER t1 CLOSE;
+# Switch to connection default
+SELECT SUM(a) FROM t1;
+SUM(a)
+55
+SELECT COUNT(*) FROM t1 WHERE NOT c LIKE "test 1.5";
+COUNT(*)
+0
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+##
+## 1.6 Tow connections are long create/select, while another is
+## altering the table
+##
+# Connections locker1..locker3 will run different SQL queries, which
+# will all lock on the same resource.
+CREATE TABLE t1(a INT, b INT)
+ENGINE=<engine_type>;
+INSERT INTO t1 VALUES (1, 2), (2, 3), (3, 4), (4, 5), (5, 6);
+# Switch to connection locker1
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+CREATE TABLE t2 ENGINE=<engine_type> AS SELECT *, SLEEP(1) FROM t1;
+# Switch to connection locker2
+# "send" next statement
+CREATE TABLE t3 LIKE t1;
+# Switch to connection locker3
+# "send" next statement
+CREATE TABLE t4 ENGINE=<engine_type> AS SELECT *, SLEEP(1) FROM t1;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (c INT);
+# Switch to connection locker3
+# "reap" outcome of last statement
+# Switch to connection locker2
+# "reap" outcome of last statement
+# Switch to connection locker1
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SELECT SUM(a), SUM(b) FROM t2;
+SUM(a) SUM(b)
+15 20
+SELECT SUM(a), SUM(b) FROM t3;
+SUM(a) SUM(b)
+NULL NULL
+SELECT SUM(a), SUM(b) FROM t4;
+SUM(a) SUM(b)
+15 20
+# Closing connections locker1..locker3 since they are not used any more
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+##
+## 1.7 Both connections trying to rename the same table/view
+## (including alter ... rename command)
+##
+CREATE TABLE t1(a INT, b CHAR(100))
+ENGINE=<engine_type>;
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER TABLE t1 RENAME t2;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'after_start_ddl SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t2 RENAME t3;
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SELECT SUM(a) FROM t3;
+SUM(a)
+NULL
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+0
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t3;
+##
+## 1.8a Use list of tables in DROP TABLE and RENAME TABLE statements
+##
+CREATE TABLE t1(a INT) ENGINE=<engine_type>;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t_t1(a INT) ENGINE=<engine_type>;
+INSERT INTO t_t1 VALUES (1);
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+# Using sync_lock.inc to synchronize on 'mdl_enter_cond'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+RENAME TABLE t1 TO t2, t_t1 TO t3;
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+RENAME TABLE t2 TO t1, t3 TO t_t1;
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+SET DEBUG_SYNC= 'RESET';
+# Connection waiter will run setup (if any)
+# Using sync_lock.inc to synchronize on 'mdl_enter_cond'
+# Connection locker will lock the resource
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL locked WAIT_FOR do_unlock';
+LOCK TABLES t1 READ;
+# Connection waiter will wait for the resource to be locked, and then
+# run the SQL that should lock.
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync> SIGNAL do_unlock';
+DROP TABLE t1, t_t1;
+# Connection locker will unlock the locked resources
+UNLOCK TABLES;
+# Connection waiter will wait for the SQL to return after the
+# lock is unlocked, and run teardown if we have any
+# Cleaning up in default connection
+SET DEBUG_SYNC= 'RESET';
+##
+## 1.9 Two connections trying to alter the same stored procedure
+## and function
+##
+# Switch to connection default
+CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT "initial value")
+ENGINE=<engine_type>;
+CREATE PROCEDURE t_proc ()
+BEGIN
+SELECT * FROM t1;
+END|
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn lock 1.9';
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+# "send" next statement
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn waiter 1.9';
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+DROP PROCEDURE t_proc;
+CREATE FUNCTION t_func (s CHAR(20)) RETURNS CHAR(30) DETERMINISTIC
+RETURN CONCAT('Hello, ', s, '!');
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn locker 1.9';
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+# "send" next statement
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn waiter 1.9';
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+DROP FUNCTION t_func;
+DROP TABLE t1;
+##
+## 1.10 One Connection altering a stored procedure/function, while
+## the other is dropping it.
+##
+CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT "initial value")
+ENGINE=<engine_type>;
+CREATE PROCEDURE t_proc ()
+BEGIN
+SELECT * FROM t1;
+END|
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn lock 1.10';
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+# "send" next statement
+DROP PROCEDURE t_proc;
+# Switch to connection locker
+# "reap" outcome of last statement
+ERROR 42000: PROCEDURE test.t_proc does not exist
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+CREATE FUNCTION t_func (s CHAR(20)) RETURNS CHAR(30) DETERMINISTIC
+RETURN CONCAT('Hello, ', s, '!');
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn lock 1.10';
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+# "send" next statement
+DROP FUNCTION t_func;
+# Switch to connection locker
+# "reap" outcome of last statement
+ERROR 42000: FUNCTION test.t_func does not exist
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+DROP table t1;
+##
+## 1.11, 1.12 and 1.13 - ALTER TABLE and TRUNCATE TABLE simoultaniously
+##
+CREATE TABLE t1(a INT, b CHAR(20) DEFAULT "test 1.11")
+ENGINE=<engine_type>;
+INSERT INTO t1 (a) VALUES (1);
+# Switch to connection locker
+SET DEBUG_SYNC= '<sync> SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+TRUNCATE TABLE t1;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync2> SIGNAL do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (c INT);
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+# Switch to connection locker
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER TABLE t1 ADD COLUMN (d INT);
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= '<sync3> SIGNAL do_unlock';
+# "send" next statement
+TRUNCATE TABLE t1;
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+##
+## 1.14 Two connections are trying to alter the same event.
+##
+CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+SELECT MOD(29,9);
+# Switch to connection locker
+SET DEBUG_SYNC= 'locked_external SIGNAL locked WAIT_FOR do_unlock';
+# "send" next statement
+ALTER EVENT ev1 ON SCHEDULE EVERY 12 HOUR
+STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR;
+# Switch to connection waiter
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL do_unlock';
+# "send" next statement
+ALTER EVENT ev1 ON SCHEDULE EVERY 4 HOUR
+STARTS CURRENT_TIMESTAMP + INTERVAL 4 HOUR;
+# Switch to connection locker
+# "reap" outcome of last statement
+# Switch to connection waiter
+# "reap" outcome of last statement
+# Switch to connection default
+SET DEBUG_SYNC= 'RESET';
+DROP EVENT ev1;
+# Clean up connections
=== added file 'mysql-test/suite/ddl_lock/r/create_stress_tables.result'
--- a/mysql-test/suite/ddl_lock/r/create_stress_tables.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/r/create_stress_tables.result 2008-12-17 10:11:14 +0000
@@ -0,0 +1,39 @@
+CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT "initial value")
+ENGINE=<engine_type>;
+INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+SELECT MAX(id) FROM t1 INTO @max;
+INSERT INTO t1(id) SELECT id + @max FROM t1
+WHERE id + @max <= <num_stress_rows>;
+CREATE PROCEDURE t_proc (OUT b_p CHAR(100))
+BEGIN
+SELECT b INTO @b_p FROM t1 WHERE Id = 1;
+END|
+CREATE FUNCTION t_func (s CHAR(20)) RETURNS CHAR(30) DETERMINISTIC
+RETURN CONCAT('Hello, ', s, '!');
=== added file 'mysql-test/suite/ddl_lock/r/stress_ddl.result'
--- a/mysql-test/suite/ddl_lock/r/stress_ddl.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/r/stress_ddl.result 2008-12-17 10:11:14 +0000
@@ -0,0 +1,15 @@
+ALTER TABLE t1 ADD COLUMN <column_name> CHAR(200) DEFAULT "New column";
+CREATE INDEX <index_name> ON t1 (<column_name>);
+SELECT DISTINCT(<column_name>) FROM t1;
+<column_name>
+New column
+DROP INDEX <index_name> ON t1;
+ALTER TABLE t1 DROP COLUMN <column_name>;
+CREATE VIEW <view_name> AS SELECT DISTINCT b FROM t1;
+CREATE VIEW <all_view_name> AS SELECT id, b FROM t1;
+SELECT id FROM <all_view_name> WHERE id = <random_id>;
+id
+<random_id>
+DROP VIEW <view_name>, <all_view_name>;
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn <conn_id>';
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn <conn_id>';
=== added file 'mysql-test/suite/ddl_lock/r/stress_dml.result'
--- a/mysql-test/suite/ddl_lock/r/stress_dml.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/r/stress_dml.result 2008-12-17 10:11:14 +0000
@@ -0,0 +1,17 @@
+START TRANSACTION;
+UPDATE t1 SET b = "changed" WHERE id=<random>;
+SELECT id,b FROM t1 WHERE id=<random>;
+id b
+<random> changed
+COMMIT;
+START TRANSACTION;
+DELETE FROM t1 WHERE id=<random>;
+INSERT INTO t1 (id, b) VALUES (<random>, "newly_inserted");
+COMMIT;
+CALL t_proc(@b);
+SELECT @b;
+@b
+NULL
+SELECT t_func('world');
+t_func('world')
+Hello, world!
=== added file 'mysql-test/suite/ddl_lock/stress_init.txt'
--- a/mysql-test/suite/ddl_lock/stress_init.txt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/stress_init.txt 2008-12-17 10:11:14 +0000
@@ -0,0 +1 @@
+create_stress_tables
=== added file 'mysql-test/suite/ddl_lock/stress_tests.txt'
--- a/mysql-test/suite/ddl_lock/stress_tests.txt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/stress_tests.txt 2008-12-17 10:11:14 +0000
@@ -0,0 +1,13 @@
+#
+# 10% DDL transactions
+#
+stress_dml
+stress_dml
+stress_dml
+stress_dml
+stress_dml
+stress_dml
+stress_dml
+stress_dml
+stress_dml
+stress_ddl
=== added directory 'mysql-test/suite/ddl_lock/t'
=== added file 'mysql-test/suite/ddl_lock/t/concurrent_ddl.test'
--- a/mysql-test/suite/ddl_lock/t/concurrent_ddl.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/t/concurrent_ddl.test 2008-12-17 10:11:14 +0000
@@ -0,0 +1,752 @@
+##
+## Test for WL #4343 - DDL locking for all metadata objects
+##
+##
+## Test case 1: Concurrent users performing DDL operations
+##
+
+#
+# We need the Debug Sync Facility.
+#
+--source include/have_debug_sync.inc
+--source include/have_innodb.inc
+
+if (`SELECT LENGTH("$engine_type") = 0`) {
+ let $engine_type= MyISAM;
+# InnoDB;
+# MyISAM;
+}
+let $lock_table= t1;
+
+--disable_warnings
+SET DEBUG_SYNC= 'RESET';
+eval DROP TABLE IF EXISTS $lock_table;
+--enable_warnings
+
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE $lock_table(a INT) ENGINE=$engine_type;
+eval INSERT INTO $lock_table VALUES (1);
+
+# Connections we will use - create only once, in case we forget to unlock.
+--echo # Establish connection locker: the connection that locks the resource
+connect (locker,localhost,root,,);
+--echo # Establish connection waiter: the connection that waits for the resource
+connect (waiter,localhost,root,,);
+--echo # Both these connections are used the same way in all the test cases
+--echo # In this test.
+
+--echo ##
+--echo ## 1.1 One connection holding a lock on a table, other performing
+--echo ## alter, handler, truncate and drop on same object
+--echo ##
+
+let $sql= ALTER TABLE $lock_table ADD COLUMN (b INT);
+--source suite/ddl_lock/include/sync_lock.inc
+
+let $sql= RENAME TABLE $lock_table TO t2;
+let $teardown= RENAME TABLE t2 TO $lock_table;
+--source suite/ddl_lock/include/sync_lock.inc
+let $teardown= ;
+
+let $sync= locked_external;
+let $setup= HANDLER $lock_table OPEN;
+let $teardown= HANDLER t1 CLOSE;
+let $sql= HANDLER $lock_table READ FIRST;
+--source suite/ddl_lock/include/sync_lock.inc
+let $setup= ;
+let $teardown= ;
+let $sync= ;
+
+# InnoDB needs other syncronization signal
+if (`SELECT STRCMP("$engine_type", "InnoDB") = 0`) {
+ let $sync= wait_for_lock;
+}
+let $sql= TRUNCATE TABLE $lock_table;
+--source suite/ddl_lock/include/sync_lock.inc
+let $sync= ;
+
+let $sql= DROP TABLE $lock_table;
+--source suite/ddl_lock/include/sync_lock.inc
+--echo ##
+--echo ## 1.2 Two connections trying to perform alter on same table/view
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval
+CREATE TABLE t1(a INT, b CHAR(100) DEFAULT "test 1.2")
+ENGINE=$engine_type;
+
+# Some rows to make the alter table do something
+INSERT INTO t1 (a) VALUES (1), (2), (3), (4), (5);
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'alter_table_before_main_binlog
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 ADD COLUMN (c CHAR(100) DEFAULT "test 1.2 locker");
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 ADD COLUMN (d CHAR(100) DEFAULT "test 1.2 waiter");
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+SET DEBUG_SYNC= 'RESET';
+SELECT SUM(a) FROM t1;
+SELECT COUNT(*) FROM t1 WHERE NOT c LIKE "test 1.2 %";
+
+DROP TABLE t1;
+
+--echo ##
+--echo ## 1.3 One connection creating a table, another is trying to alter it
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval
+CREATE TABLE t1(a INT, b INT)
+ENGINE=$engine_type;
+
+# 5 rows, 1 sec sleep for each (see below)
+INSERT INTO t1 VALUES (1, 2), (2, 3), (3, 4), (4, 5), (5, 6);
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+--replace_result $engine_type <engine_type>
+send;
+eval
+CREATE TABLE t2 ENGINE=$engine_type AS SELECT *, SLEEP(1) FROM t1;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 ADD COLUMN (c INT);
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+
+SET DEBUG_SYNC= 'RESET';
+SELECT SUM(a), SUM(b) FROM t1;
+SELECT SUM(a), SUM(b) FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo ##
+--echo ## 1.4 One connection is selecting (using handler) while another is
+--echo ## altering the table (select start first)
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE t1(a INT, b INT) ENGINE=$engine_type;
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+
+--echo # Switch to connection locker
+connection locker;
+HANDLER t1 OPEN;
+SET DEBUG_SYNC= 'locked_external SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+HANDLER t1 READ FIRST;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 ADD COLUMN (c INT);
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+HANDLER t1 CLOSE;
+SELECT * FROM t1 ORDER BY a;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection locker
+connection locker;
+HANDLER t1 OPEN;
+SET DEBUG_SYNC= 'locked_external SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+HANDLER t1 READ FIRST;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 DROP COLUMN b;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+HANDLER t1 CLOSE;
+SELECT * FROM t1 ORDER BY a;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+SELECT * FROM t1 ORDER BY a;
+
+# Clean up
+--echo # Switch to connection default
+connection default;
+
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+
+--echo ##
+--echo ## 1.5 One connection selecting (using handler), while another is
+--echo ## altering the table - altering table starts first
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE t1(a INT, b CHAR(100)) ENGINE=$engine_type;
+
+# Need some rows to make the alter table use some time
+let $i= 10;
+while ($i) {
+ eval INSERT INTO t1 (a) VALUES ($i);
+ dec $i;
+}
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'alter_table_before_main_binlog
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 ADD COLUMN (c CHAR(100) DEFAULT "test 1.5");
+
+--echo # Switch to connection waiter
+connection waiter;
+
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+--echo # "send" next statement
+send
+HANDLER t1 OPEN;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+HANDLER t1 READ FIRST;
+HANDLER t1 CLOSE;
+
+--echo # Switch to connection default
+connection default;
+SELECT SUM(a) FROM t1;
+SELECT COUNT(*) FROM t1 WHERE NOT c LIKE "test 1.5";
+
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+
+--echo ##
+--echo ## 1.6 Tow connections are long create/select, while another is
+--echo ## altering the table
+--echo ##
+
+--echo # Connections locker1..locker3 will run different SQL queries, which
+--echo # will all lock on the same resource.
+connect (locker1,localhost,root,,);
+connect (locker2,localhost,root,,);
+connect (locker3,localhost,root,,);
+
+--replace_result $engine_type <engine_type>
+eval
+CREATE TABLE t1(a INT, b INT)
+ENGINE=$engine_type;
+
+# 5 rows, 1 sec sleep for each = 5 sec sleep
+INSERT INTO t1 VALUES (1, 2), (2, 3), (3, 4), (4, 5), (5, 6);
+
+--echo # Switch to connection locker1
+connection locker1;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+--replace_result $engine_type <engine_type>
+send;
+eval CREATE TABLE t2 ENGINE=$engine_type AS SELECT *, SLEEP(1) FROM t1;
+
+--echo # Switch to connection locker2
+connection locker2;
+--echo # "send" next statement
+send;
+eval CREATE TABLE t3 LIKE t1;
+
+--echo # Switch to connection locker3
+connection locker3;
+--echo # "send" next statement
+--replace_result $engine_type <engine_type>
+send;
+eval CREATE TABLE t4 ENGINE=$engine_type AS SELECT *, SLEEP(1) FROM t1;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'mdl_enter_cond SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 ADD COLUMN (c INT);
+
+--echo # Switch to connection locker3
+connection locker3;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection locker2
+connection locker2;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection locker1
+connection locker1;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+SELECT SUM(a), SUM(b) FROM t2;
+SELECT SUM(a), SUM(b) FROM t3;
+SELECT SUM(a), SUM(b) FROM t4;
+
+--echo # Closing connections locker1..locker3 since they are not used any more
+disconnect locker1;
+disconnect locker2;
+disconnect locker3;
+
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+
+--echo ##
+--echo ## 1.7 Both connections trying to rename the same table/view
+--echo ## (including alter ... rename command)
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval
+CREATE TABLE t1(a INT, b CHAR(100))
+ENGINE=$engine_type;
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t1 RENAME t2;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'after_start_ddl SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER TABLE t2 RENAME t3;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+SELECT SUM(a) FROM t3;
+SELECT COUNT(*) FROM t3;
+
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE t3;
+
+##
+## 1.8 - Repeat with different engines: already supported, set $engine_type
+##
+
+--echo ##
+--echo ## 1.8a Use list of tables in DROP TABLE and RENAME TABLE statements
+--echo ##
+
+let $lock_table_2 = t_$lock_table;
+
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE $lock_table(a INT) ENGINE=$engine_type;
+eval INSERT INTO $lock_table VALUES (1);
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE $lock_table_2(a INT) ENGINE=$engine_type;
+eval INSERT INTO $lock_table_2 VALUES (1);
+
+
+let $sql= RENAME TABLE $lock_table TO t2, $lock_table_2 TO t3;
+let $teardown= RENAME TABLE t2 TO $lock_table, t3 TO $lock_table_2;
+--source suite/ddl_lock/include/sync_lock.inc
+let $teardown= ;
+
+let $sql= DROP TABLE $lock_table, $lock_table_2;
+--source suite/ddl_lock/include/sync_lock.inc
+
+--echo ##
+--echo ## 1.9 Two connections trying to alter the same stored procedure
+--echo ## and function
+--echo ##
+
+--echo # Switch to connection default
+connection default;
+
+--replace_result $engine_type <engine_type>
+eval
+CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT "initial value")
+ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE t_proc ()
+BEGIN
+ SELECT * FROM t1;
+END|
+delimiter ;|
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn lock 1.9';
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn waiter 1.9';
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+
+SET DEBUG_SYNC= 'RESET';
+DROP PROCEDURE t_proc;
+
+CREATE FUNCTION t_func (s CHAR(20)) RETURNS CHAR(30) DETERMINISTIC
+RETURN CONCAT('Hello, ', s, '!');
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn locker 1.9';
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn waiter 1.9';
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+
+SET DEBUG_SYNC= 'RESET';
+DROP FUNCTION t_func;
+DROP TABLE t1;
+
+--echo ##
+--echo ## 1.10 One Connection altering a stored procedure/function, while
+--echo ## the other is dropping it.
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval
+CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT "initial value")
+ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE t_proc ()
+BEGIN
+ SELECT * FROM t1;
+END|
+delimiter ;|
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn lock 1.10';
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+--echo # "send" next statement
+send
+DROP PROCEDURE t_proc;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+# TODO: Remove when WL#4299 is fixed
+--error ER_SP_DOES_NOT_EXIST
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+
+CREATE FUNCTION t_func (s CHAR(20)) RETURNS CHAR(30) DETERMINISTIC
+RETURN CONCAT('Hello, ', s, '!');
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER FUNCTION t_func COMMENT 'Now with a comment from conn lock 1.10';
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'wait_for_lock SIGNAL do_unlock';
+--echo # "send" next statement
+send
+DROP FUNCTION t_func;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+# TODO: Remove when WL#4299 is fixed
+--error ER_SP_DOES_NOT_EXIST
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+
+SET DEBUG_SYNC= 'RESET';
+DROP table t1;
+
+--echo ##
+--echo ## 1.11, 1.12 and 1.13 - ALTER TABLE and TRUNCATE TABLE simoultaniously
+--echo ##
+
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE $lock_table(a INT, b CHAR(20) DEFAULT "test 1.11")
+ ENGINE=$engine_type;
+eval INSERT INTO $lock_table (a) VALUES (1);
+
+let $sync= locked_external;
+# InnoDB needs other syncronization signal
+if (`SELECT STRCMP("$engine_type", "InnoDB") = 0`) {
+ let $sync= after_lock_tables_takes_lock;
+}
+
+let sync2= after_lock_tables_takes_lock;
+if (`SELECT STRCMP("$engine_type", "InnoDB") = 0`) {
+ let $sync2= wait_for_lock;
+}
+
+let sync3= locked_external;
+if (`SELECT STRCMP("$engine_type", "InnoDB") = 0`) {
+ let $sync3= wait_for_lock;
+}
+
+--echo # Switch to connection locker
+connection locker;
+
+--replace_result $sync <sync>
+eval SET DEBUG_SYNC= '$sync SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send;
+eval TRUNCATE TABLE $lock_table;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+--replace_result $sync2 <sync2>
+eval SET DEBUG_SYNC= '$sync2 SIGNAL do_unlock';
+--echo # "send" next statement
+send;
+eval ALTER TABLE $lock_table ADD COLUMN (c INT);
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+SET DEBUG_SYNC= 'RESET';
+
+--echo # Switch to connection locker
+connection locker;
+# --replace_result $sync2 <sync2>
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock
+ SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send;
+eval ALTER TABLE $lock_table ADD COLUMN (d INT);
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+--replace_result $sync3 <sync3>
+eval SET DEBUG_SYNC= '$sync3 SIGNAL do_unlock';
+--echo # "send" next statement
+send;
+eval TRUNCATE TABLE $lock_table;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+
+SET DEBUG_SYNC= 'RESET';
+eval DROP TABLE $lock_table;
+
+--echo ##
+--echo ## 1.14 Two connections are trying to alter the same event.
+--echo ##
+
+CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
+SELECT MOD(29,9);
+
+--echo # Switch to connection locker
+connection locker;
+SET DEBUG_SYNC= 'locked_external SIGNAL locked WAIT_FOR do_unlock';
+--echo # "send" next statement
+send
+ALTER EVENT ev1 ON SCHEDULE EVERY 12 HOUR
+STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR;
+
+--echo # Switch to connection waiter
+connection waiter;
+SET DEBUG_SYNC= 'now WAIT_FOR locked';
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL do_unlock';
+--echo # "send" next statement
+send
+ALTER EVENT ev1 ON SCHEDULE EVERY 4 HOUR
+STARTS CURRENT_TIMESTAMP + INTERVAL 4 HOUR;
+
+--echo # Switch to connection locker
+connection locker;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection waiter
+connection waiter;
+--echo # "reap" outcome of last statement
+reap;
+
+--echo # Switch to connection default
+connection default;
+SET DEBUG_SYNC= 'RESET';
+DROP EVENT ev1;
+
+--echo # Clean up connections
+disconnect waiter;
+disconnect locker;
=== added file 'mysql-test/suite/ddl_lock/t/create_stress_tables.test'
--- a/mysql-test/suite/ddl_lock/t/create_stress_tables.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/t/create_stress_tables.test 2008-12-17 10:11:14 +0000
@@ -0,0 +1,54 @@
+##
+## Test for WL #4343 - DDL locking for all metadata objects
+##
+
+##
+## Test case 3: Concurrent system scenarios - create tables
+##
+
+--source suite/ddl_lock/include/stress_settings.inc
+
+if (`SELECT LENGTH("$engine_type") = 0`) {
+ let $engine_type= myisam;
+}
+
+#
+# Create test table with some data
+#
+
+--replace_result $engine_type <engine_type>
+eval CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT "initial value")
+ ENGINE=$engine_type;
+
+# Need something to start with
+INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
+
+# Bulk load the correct number of rows
+while (`SELECT MAX(id) < $num_stress_rows FROM t1`)
+{
+ SELECT MAX(id) FROM t1 INTO @max;
+--replace_result $num_stress_rows <num_stress_rows>
+ eval INSERT INTO t1(id) SELECT id + @max FROM t1
+ WHERE id + @max <= $num_stress_rows;
+}
+
+#
+# Create stored Procedure
+#
+delimiter |;
+CREATE PROCEDURE t_proc (OUT b_p CHAR(100))
+BEGIN
+ SELECT b INTO @b_p FROM t1 WHERE Id = 1;
+END|
+delimiter ;|
+
+#
+# Create function
+#
+CREATE FUNCTION t_func (s CHAR(20)) RETURNS CHAR(30) DETERMINISTIC
+RETURN CONCAT('Hello, ', s, '!');
+
+#
+# Side effects: this test will create table t1, and routines t_proc
+# and t_func. This is intentional.
+#
=== added file 'mysql-test/suite/ddl_lock/t/stress_ddl.test'
--- a/mysql-test/suite/ddl_lock/t/stress_ddl.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/t/stress_ddl.test 2008-12-17 10:11:14 +0000
@@ -0,0 +1,75 @@
+##
+## Test for WL #4343 - DDL locking for all metadata objects
+##
+
+##
+## Test case 3: Concurrent system scenarios - DDL load
+##
+
+# Detect whether or not this test is run from the stress test,
+# with the proper setup
+let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`;
+
+let $have_proc= `SELECT (COUNT(*) = 1) FROM INFORMATION_SCHEMA.ROUTINES
+ WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='t_proc'`;
+
+let $have_func= `SELECT (COUNT(*) = 1) FROM INFORMATION_SCHEMA.ROUTINES
+ WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='t_func'`;
+
+if (`SELECT ($have_table = 0) OR ($have_proc = 0) OR ($have_func = 0)`) {
+ --disable_query_log
+ --disable_result_log
+ --source suite/ddl_lock/t/create_stress_tables.test
+ --enable_result_log
+ --enable_query_log
+}
+
+# Use connection id so that the db objects created here get unique names
+let $conn_id= `SELECT CONNECTION_ID()`;
+
+let $col_name= c_$conn_id;
+let $idx_name= t1_indx_c_$conn_id;
+let $view_name= view_$conn_id;
+let $all_view_name= all_view_$conn_id;
+
+--source suite/ddl_lock/include/stress_settings.inc
+let $row_id= `SELECT ROUND(RAND() * $num_stress_rows)`;
+
+#
+# Table and Index
+#
+--replace_result $col_name <column_name>
+eval ALTER TABLE t1 ADD COLUMN $col_name CHAR(200) DEFAULT "New column";
+--replace_result $idx_name <index_name> $col_name <column_name>
+eval CREATE INDEX $idx_name ON t1 ($col_name);
+--replace_result $col_name <column_name>
+eval SELECT DISTINCT($col_name) FROM t1;
+--replace_result $idx_name <index_name>
+eval DROP INDEX $idx_name ON t1;
+--replace_result $col_name <column_name>
+eval ALTER TABLE t1 DROP COLUMN $col_name;
+
+#
+# View
+#
+--replace_result $view_name <view_name>
+eval CREATE VIEW $view_name AS SELECT DISTINCT b FROM t1;
+--replace_result $all_view_name <all_view_name>
+eval CREATE VIEW $all_view_name AS SELECT id, b FROM t1;
+--replace_result $all_view_name <all_view_name> $row_id <random_id>
+eval SELECT id FROM $all_view_name WHERE id = $row_id;
+--replace_result $all_view_name <all_view_name> $view_name <view_name>
+eval DROP VIEW $view_name, $all_view_name;
+
+#
+# Stored Procedure
+#
+--replace_result $conn_id <conn_id>
+eval ALTER PROCEDURE t_proc COMMENT 'Now with a comment from conn $conn_id';
+
+#
+# Function
+#
+--replace_result $conn_id <conn_id>
+eval ALTER FUNCTION t_func COMMENT 'Now with a comment from conn $conn_id';
=== added file 'mysql-test/suite/ddl_lock/t/stress_dml.test'
--- a/mysql-test/suite/ddl_lock/t/stress_dml.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ddl_lock/t/stress_dml.test 2008-12-17 10:11:14 +0000
@@ -0,0 +1,55 @@
+##
+## Test for WL #4343 - DDL locking for all metadata objects
+##
+
+##
+## Test case 3: Concurrent system scenarios - DML load
+##
+
+# Detect whether or not this test is run from the stress test,
+# with the proper setup
+let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`;
+
+let $have_proc= `SELECT (COUNT(*) = 1) FROM INFORMATION_SCHEMA.ROUTINES
+ WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='t_proc'`;
+
+let $have_func= `SELECT (COUNT(*) = 1) FROM INFORMATION_SCHEMA.ROUTINES
+ WHERE ROUTINE_SCHEMA='test' AND ROUTINE_NAME='t_func'`;
+
+if (`SELECT ($have_table = 0) OR ($have_proc = 0) OR ($have_func = 0)`) {
+ --disable_query_log
+ --disable_result_log
+ --source suite/ddl_lock/t/create_stress_tables.test
+ --enable_result_log
+ --enable_query_log
+}
+
+--source suite/ddl_lock/include/stress_settings.inc
+
+let $row_id= `SELECT ROUND(RAND() * $num_stress_rows)`;
+
+START TRANSACTION;
+--replace_result $row_id <random>
+eval UPDATE t1 SET b = "changed" WHERE id=$row_id;
+--replace_result $row_id <random>
+eval SELECT id,b FROM t1 WHERE id=$row_id;
+COMMIT;
+
+START TRANSACTION;
+--replace_result $row_id <random>
+eval DELETE FROM t1 WHERE id=$row_id;
+--replace_result $row_id <random>
+eval INSERT INTO t1 (id, b) VALUES ($row_id, "newly_inserted");
+COMMIT;
+
+#
+# Call stored procedure
+#
+eval CALL t_proc(@b);
+SELECT @b;
+
+#
+# Call function
+#
+eval SELECT t_func('world');
=== modified file 'mysql-test/suite/falcon/r/falcon_bug_28049.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_28049.result 2008-11-18 15:42:54 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_28049.result 2008-12-11 01:21:12 +0000
@@ -2017,70 +2017,5 @@ v
998
v
999
-Warnings:
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 3
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 4
DROP TABLE t1//
DROP PROCEDURE p//
=== modified file 'mysql-test/suite/falcon/r/falcon_bug_32833.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_32833.result 2008-07-15 10:59:07 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_32833.result 2008-12-11 01:21:12 +0000
@@ -25,70 +25,7 @@ END WHILE;
END//
CALL p1();
Warnings:
-Warning 1366 Incorrect string value: '\x11\x03\x13' for column 'char_column' at row 310
-Warning 1366 Incorrect string value: '\x11\x06p' for column 'char_column' at row 311
-Warning 1366 Incorrect string value: '\x11\x10'' for column 'char_column' at row 312
-Warning 1366 Incorrect string value: '\x11\x13\x84' for column 'char_column' at row 313
-Warning 1366 Incorrect string value: '\x11\x17A' for column 'char_column' at row 314
-Warning 1366 Incorrect string value: '\x11 \x98' for column 'char_column' at row 315
-Warning 1366 Incorrect string value: '\x11$U' for column 'char_column' at row 316
-Warning 1366 Incorrect string value: '\x11(\x12' for column 'char_column' at row 317
-Warning 1366 Incorrect string value: '\x111i' for column 'char_column' at row 318
-Warning 1366 Incorrect string value: '\x115&' for column 'char_column' at row 319
-Warning 1366 Incorrect string value: '\x118\x83' for column 'char_column' at row 320
-Warning 1366 Incorrect string value: '\x11B@' for column 'char_column' at row 321
-Warning 1366 Incorrect string value: '\x11E\x97' for column 'char_column' at row 322
-Warning 1366 Incorrect string value: '\x11IT' for column 'char_column' at row 323
-Warning 1366 Incorrect string value: '\x11S\x11' for column 'char_column' at row 324
-Warning 1366 Incorrect string value: '\x11Vh' for column 'char_column' at row 325
-Warning 1366 Incorrect string value: '\x11`%' for column 'char_column' at row 326
-Warning 1366 Incorrect string value: '\x11c\x82' for column 'char_column' at row 327
-Warning 1366 Incorrect string value: '\x11g9' for column 'char_column' at row 328
-Warning 1366 Incorrect string value: '\x11p\x96' for column 'char_column' at row 329
-Warning 1366 Incorrect string value: '\x11tS' for column 'char_column' at row 330
-Warning 1366 Incorrect string value: '\x11x\x10' for column 'char_column' at row 331
-Warning 1366 Incorrect string value: '\x11\x81g' for column 'char_column' at row 332
-Warning 1366 Incorrect string value: '\x11\x85$' for column 'char_column' at row 333
-Warning 1366 Incorrect string value: '\x11\x88\x81' for column 'char_column' at row 334
-Warning 1366 Incorrect string value: '\x11\x928' for column 'char_column' at row 335
-Warning 1366 Incorrect string value: '\x11\x95\x95' for column 'char_column' at row 336
-Warning 1366 Incorrect string value: '\x11\x99R' for column 'char_column' at row 337
-Warning 1366 Incorrect string value: '\x12\x03\x09' for column 'char_column' at row 338
-Warning 1366 Incorrect string value: '\x12\x06f' for column 'char_column' at row 339
-Warning 1366 Incorrect string value: '\x12\x10#' for column 'char_column' at row 340
-Warning 1366 Incorrect string value: '\x12\x13\x80' for column 'char_column' at row 341
-Warning 1366 Incorrect string value: '\x12\x177' for column 'char_column' at row 342
-Warning 1366 Incorrect string value: '\x12 \x94' for column 'char_column' at row 343
-Warning 1366 Incorrect string value: '\x12$Q' for column 'char_column' at row 344
-Warning 1366 Incorrect string value: '\x12(\x08' for column 'char_column' at row 345
-Warning 1366 Incorrect string value: '\x121e' for column 'char_column' at row 346
-Warning 1366 Incorrect string value: '\x125"' for column 'char_column' at row 347
-Warning 1366 Incorrect string value: '\x128y' for column 'char_column' at row 348
-Warning 1366 Incorrect string value: '\x12B6' for column 'char_column' at row 349
-Warning 1366 Incorrect string value: '\x12E\x93' for column 'char_column' at row 350
-Warning 1366 Incorrect string value: '\x12IP' for column 'char_column' at row 351
-Warning 1366 Incorrect string value: '\x12S\x07' for column 'char_column' at row 352
-Warning 1366 Incorrect string value: '\x12Vd' for column 'char_column' at row 353
-Warning 1366 Incorrect string value: '\x12`!' for column 'char_column' at row 354
-Warning 1366 Incorrect string value: '\x12cx' for column 'char_column' at row 355
-Warning 1366 Incorrect string value: '\x12g5' for column 'char_column' at row 356
-Warning 1366 Incorrect string value: '\x12p\x92' for column 'char_column' at row 357
-Warning 1366 Incorrect string value: '\x12tI' for column 'char_column' at row 358
-Warning 1366 Incorrect string value: '\x12x\x06' for column 'char_column' at row 359
-Warning 1366 Incorrect string value: '\x12\x81c' for column 'char_column' at row 360
-Warning 1366 Incorrect string value: '\x12\x85 ' for column 'char_column' at row 361
-Warning 1366 Incorrect string value: '\x12\x88w' for column 'char_column' at row 362
-Warning 1366 Incorrect string value: '\x12\x924' for column 'char_column' at row 363
-Warning 1366 Incorrect string value: '\x12\x95\x91' for column 'char_column' at row 364
-Warning 1366 Incorrect string value: '\x12\x99H' for column 'char_column' at row 365
-Warning 1366 Incorrect string value: '\x13\x03\x05' for column 'char_column' at row 366
-Warning 1366 Incorrect string value: '\x13\x06b' for column 'char_column' at row 367
-Warning 1366 Incorrect string value: '\x13\x10\x19' for column 'char_column' at row 368
-Warning 1366 Incorrect string value: '\x13\x13v' for column 'char_column' at row 369
-Warning 1366 Incorrect string value: '\x13\x173' for column 'char_column' at row 370
-Warning 1366 Incorrect string value: '\x13 \x90' for column 'char_column' at row 371
-Warning 1366 Incorrect string value: '\x13$G' for column 'char_column' at row 372
-Warning 1366 Incorrect string value: '\x13(\x04' for column 'char_column' at row 373
+Warning 1366 Incorrect string value: '\x99\x99W' for column 'char_column' at row 1
SELECT count(*) FROM t1;
count(*)
2802
=== modified file 'mysql-test/suite/falcon/r/falcon_bugs.result'
--- a/mysql-test/suite/falcon/r/falcon_bugs.result 2008-11-26 12:58:17 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bugs.result 2008-12-11 01:21:12 +0000
@@ -3182,71 +3182,6 @@ v
998
v
999
-Warnings:
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 5
-Warning 1264 Out of range value for column 's1' at row 3
-Warning 1264 Out of range value for column 's1' at row 4
-Warning 1264 Out of range value for column 's1' at row 4
DROP TABLE t1//
DROP PROCEDURE p//
*** Bug 216 ***
=== modified file 'mysql-test/suite/funcs_1/r/falcon_storedproc_02.result'
--- a/mysql-test/suite/funcs_1/r/falcon_storedproc_02.result 2008-05-30 15:59:41 +0000
+++ b/mysql-test/suite/funcs_1/r/falcon_storedproc_02.result 2008-12-10 21:53:59 +0000
@@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
=== modified file 'mysql-test/suite/funcs_1/r/innodb_storedproc_02.result'
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result 2008-05-30 15:59:41 +0000
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result 2008-12-10 21:53:59 +0000
@@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
=== modified file 'mysql-test/suite/funcs_1/r/memory_storedproc_02.result'
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result 2008-06-19 18:56:48 +0000
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result 2008-12-10 21:53:59 +0000
@@ -551,9 +551,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
=== modified file 'mysql-test/suite/funcs_1/r/myisam_storedproc_02.result'
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result 2008-06-19 18:56:48 +0000
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result 2008-12-10 21:53:59 +0000
@@ -551,9 +551,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
=== modified file 'mysql-test/suite/funcs_1/r/ndb_storedproc_02.result'
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result 2008-05-30 15:59:41 +0000
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result 2008-12-11 01:21:12 +0000
@@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
-Warnings:
-Note 1051 Unknown table 'tqq'
-Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()
=== modified file 'mysql-test/suite/funcs_1/r/storedproc.result'
--- a/mysql-test/suite/funcs_1/r/storedproc.result 2008-12-10 11:39:22 +0000
+++ b/mysql-test/suite/funcs_1/r/storedproc.result 2009-01-13 15:26:20 +0000
@@ -8043,8 +8043,6 @@ CALL sp1();
x y z
000 000 000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8083,8 +8081,6 @@ CALL sp1();
x y z
00000 00000 00000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8123,8 +8119,6 @@ CALL sp1();
x y z
00000000 00000000 00000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8163,8 +8157,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8203,8 +8195,6 @@ CALL sp1();
x y z
00000000000000000000 00000000000000000000 00000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8225,8 +8215,6 @@ CALL sp1();
x y z
-9999999999 -9999999999 -9999999999
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8238,8 +8226,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8251,8 +8237,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
-Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8264,8 +8248,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8277,8 +8259,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8290,8 +8270,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8303,8 +8281,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -8316,8 +8292,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@@ -14699,7 +14673,6 @@ CALL sp1();
x y @x
NULL a 3
Warnings:
-Warning 1265 Data truncated for column 'y' at row 4
Warning 1265 Data truncated for column 'y' at row 2
SELECT @v1, @v2;
@v1 @v2
@@ -16381,14 +16354,6 @@ count done
10 1
Warnings:
Warning 1265 Data truncated for column 'name' at row 1
-Warning 1265 Data truncated for column 'name' at row 2
-Warning 1265 Data truncated for column 'name' at row 3
-Warning 1265 Data truncated for column 'name' at row 4
-Warning 1265 Data truncated for column 'name' at row 5
-Warning 1265 Data truncated for column 'name' at row 6
-Warning 1265 Data truncated for column 'name' at row 7
-Warning 1265 Data truncated for column 'name' at row 8
-Warning 1265 Data truncated for column 'name' at row 9
DROP PROCEDURE sp3;
drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
@@ -17303,7 +17268,6 @@ fn7(99999999999)
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn8;
CREATE FUNCTION fn8( f1 decimal (0) unsigned zerofill) returns decimal (0) unsigned zerofill
@@ -17348,7 +17312,6 @@ fn11(99999999999)
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn12;
CREATE FUNCTION fn12( f1 decimal (0, 0) unsigned zerofill) returns decimal (0, 0) unsigned zerofill
@@ -17449,7 +17412,6 @@ SELECT fn21_d_z(1.00e+00);
fn21_d_z(1.00e+00)
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn22;
CREATE FUNCTION fn22( f1 decimal unsigned) returns decimal unsigned
@@ -17461,7 +17423,6 @@ SELECT fn22(1.00e+00);
fn22(1.00e+00)
10
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn23;
CREATE FUNCTION fn23( f1 decimal unsigned zerofill) returns decimal unsigned zerofill
@@ -17473,7 +17434,6 @@ SELECT fn23(1.00e+00);
fn23(1.00e+00)
0000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn24;
CREATE FUNCTION fn24( f1 decimal zerofill) returns decimal zerofill
@@ -17819,7 +17779,6 @@ fn56(-8388601)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn57;
CREATE FUNCTION fn57( f1 numeric) returns numeric
BEGIN
@@ -17852,7 +17811,6 @@ SELECT fn59(9999999999);
fn59(9999999999)
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn60;
CREATE FUNCTION fn60( f1 numeric (0) unsigned zerofill) returns numeric (0) unsigned zerofill
@@ -17898,7 +17856,6 @@ SELECT fn63(9999999999);
fn63(9999999999)
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn64;
CREATE FUNCTION fn64( f1 numeric (0, 0) unsigned zerofill) returns numeric (0, 0) unsigned zerofill
@@ -17934,8 +17891,6 @@ fn66(-1e+36)
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn67;
CREATE FUNCTION fn67( f1 numeric (63, 30) unsigned) returns numeric (63, 30) unsigned
@@ -17948,7 +17903,6 @@ fn67(1e+36)
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn68;
CREATE FUNCTION fn68( f1 numeric (63, 30) unsigned zerofill) returns numeric (63, 30) unsigned zerofill
@@ -17961,7 +17915,6 @@ fn68(1e+36)
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn69;
CREATE FUNCTION fn69( f1 numeric (63, 30) zerofill) returns numeric (63, 30) zerofill
@@ -18129,7 +18082,6 @@ fn84(-32601)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn85;
CREATE FUNCTION fn85( f1 tinyint) returns tinyint
BEGIN
@@ -18169,7 +18121,6 @@ fn88(-101)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn89;
CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
BEGIN
@@ -18427,7 +18378,6 @@ f1
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp8;
CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
@@ -18472,7 +18422,6 @@ f1
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp12;
CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
@@ -18594,7 +18543,6 @@ CALL sp21(1.00e+00);
f1
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp22;
CREATE PROCEDURE sp22( f1 decimal unsigned)
@@ -18606,7 +18554,6 @@ CALL sp22(1.00e+00);
f1
10
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp23;
CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
@@ -18618,7 +18565,6 @@ CALL sp23(1.00e+00);
f1
0000000010
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp24;
CREATE PROCEDURE sp24( f1 decimal zerofill)
@@ -18964,7 +18910,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp57;
CREATE PROCEDURE sp57( f1 numeric)
BEGIN
@@ -18997,7 +18942,6 @@ CALL sp59(9999999999);
f1
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp60;
CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
@@ -19043,7 +18987,6 @@ CALL sp63(9999999999);
f1
9999999999
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp64;
CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
@@ -19079,16 +19022,12 @@ f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp66_n( -1000000000000000000000000000000000000 );
f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp67_nu;
CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
@@ -19101,14 +19040,12 @@ f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp67_nu( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp68_nuz;
CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
@@ -19121,14 +19058,12 @@ f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp68_nuz( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp69_n_z;
CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
@@ -19311,7 +19246,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp85;
CREATE PROCEDURE sp85( f1 tinyint)
BEGIN
@@ -19349,7 +19283,6 @@ CALL sp88(-101);
f1
255
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp89;
=== modified file 'mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result 2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result 2008-12-11 01:33:42 +0000
@@ -22,8 +22,6 @@ END|
< ---- Master selects-- >
-------------------------
CALL test.p1(12);
-Warnings:
-Note 1051 Unknown table 't1'
SELECT * FROM test.t1;
num
12
=== modified file 'mysql-test/t/alter_table.test'
--- a/mysql-test/t/alter_table.test 2008-11-22 15:24:06 +0000
+++ b/mysql-test/t/alter_table.test 2009-01-13 15:26:20 +0000
@@ -988,3 +988,18 @@ SELECT * FROM t1;
DROP TABLE t1;
--echo End of 5.1 tests
+
+#
+# Bug #31031 ALTER TABLE regression in 5.0
+#
+# The ALTER TABLE operation failed with
+# ERROR 1089 (HY000): Incorrect sub part key; ...
+#
+CREATE TABLE t1(c CHAR(10),
+ i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES('a',2),('b',4),('c',6);
+ALTER TABLE t1
+ DROP i,
+ ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ AUTO_INCREMENT = 1;
+DROP TABLE t1;
=== modified file 'mysql-test/t/innodb_mrr.test'
--- a/mysql-test/t/innodb_mrr.test 2008-09-05 14:36:37 +0000
+++ b/mysql-test/t/innodb_mrr.test 2008-12-29 03:42:30 +0000
@@ -99,3 +99,28 @@ select pk from t1 WHERE `varchar_key` >
select pk from t1 WHERE `int_nokey` IS NULL OR `varchar_key` > 'kr' group by pk;
drop table t1;
+--echo #
+--echo # BUG#39447: Error with NOT NULL condition and LIMIT 1
+--echo #
+CREATE TABLE t1 (
+ id int(11) NOT NULL,
+ parent_id int(11) DEFAULT NULL,
+ name varchar(10) DEFAULT NULL,
+ PRIMARY KEY (id),
+ KEY ind_parent_id (parent_id)
+) ENGINE=InnoDB;
+
+insert into t1 (id, parent_id, name) values
+(10,NULL,'A'),
+(20,10,'B'),
+(30,10,'C'),
+(40,NULL,'D'),
+(50,40,'E'),
+(60,40,'F'),
+(70,NULL,'J');
+
+SELECT id FROM t1 WHERE parent_id IS NOT NULL ORDER BY id DESC LIMIT 1;
+--echo This must show type=index, extra=Using where
+explain SELECT * FROM t1 WHERE parent_id IS NOT NULL ORDER BY id DESC LIMIT 1;
+SELECT * FROM t1 WHERE parent_id IS NOT NULL ORDER BY id DESC LIMIT 1;
+drop table t1;
=== modified file 'mysql-test/t/join_cache.test'
--- a/mysql-test/t/join_cache.test 2008-12-07 20:44:24 +0000
+++ b/mysql-test/t/join_cache.test 2009-01-08 05:47:10 +0000
@@ -976,3 +976,50 @@ set join_buffer_size=default;
set join_cache_level=default;
DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug #41894: big join buffer of level 7 used to join records
+--echo # with null values in place of varchar strings
+--echo #
+
+CREATE TABLE t1 (a int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ b varchar(127) DEFAULT NULL);
+
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+INSERT INTO t1(b) SELECT b FROM t1;
+
+CREATE TABLE t2 (a int NOT NULL PRIMARY KEY, b varchar(127) DEFAULT NULL);
+INSERT INTO t2 SELECT * FROM t1;
+
+CREATE TABLE t3 (a int NOT NULL PRIMARY KEY, b varchar(127) DEFAULT NULL);
+INSERT INTO t3 SELECT * FROM t1;
+
+set join_cache_level=7;
+set join_buffer_size=1024*1024;
+
+EXPLAIN
+SELECT COUNT(*) FROM t1,t2,t3
+ WHERE t1.a=t2.a AND t2.a=t3.a AND
+ t1.b IS NULL AND t2.b IS NULL AND t3.b IS NULL;
+
+SELECT COUNT(*) FROM t1,t2,t3
+ WHERE t1.a=t2.a AND t2.a=t3.a AND
+ t1.b IS NULL AND t2.b IS NULL AND t3.b IS NULL;
+
+set join_buffer_size=default;
+set join_cache_level=default;
+
+DROP TABLE t1,t2,t3;
=== modified file 'mysql-test/t/sp.test'
--- a/mysql-test/t/sp.test 2008-11-03 12:12:00 +0000
+++ b/mysql-test/t/sp.test 2008-12-10 21:53:59 +0000
@@ -8287,6 +8287,119 @@ SELECT * FROM t1 WHERE a = f1();
DROP FUNCTION f1;
DROP TABLE t1;
+#
+# Bug#36649: Condition area is not properly cleaned up after stored routine invocation
+#
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+delimiter |;
+CREATE PROCEDURE p1(a INT, b CHAR)
+BEGIN
+ IF a > 0 THEN
+ CALL p1(a-1, 'ab');
+ ELSE
+ SELECT 1;
+ END IF;
+END|
+delimiter ;|
+
+SET @save_max_sp_recursion= @@max_sp_recursion_depth;
+SET @@max_sp_recursion_depth= 5;
+CALL p1(4, 'a');
+SET @@max_sp_recursion_depth= @save_max_sp_recursion;
+
+DROP PROCEDURE p1;
+
+#
+# Ensure that rules for message list clean up are being respected.
+#
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+delimiter |;
+CREATE PROCEDURE p1(a CHAR)
+BEGIN
+ SELECT 1;
+ SELECT CAST('10 ' as UNSIGNED INTEGER);
+ SELECT 1;
+END|
+delimiter ;|
+
+CALL p1('data truncated parameter');
+
+DROP PROCEDURE p1;
+
+#
+# Cascading stored procedure/function calls.
+#
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+--enable_warnings
+
+delimiter |;
+CREATE PROCEDURE p1()
+ CALL p2()|
+CREATE PROCEDURE p2()
+ CALL p3()|
+CREATE PROCEDURE p3()
+ CALL p4()|
+CREATE PROCEDURE p4()
+BEGIN
+ SELECT 1;
+ SELECT CAST('10 ' as UNSIGNED INTEGER);
+ SELECT 2;
+END|
+delimiter ;|
+
+CALL p1();
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+
+--disable_warnings
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a CHAR(2));
+
+INSERT INTO t1 VALUES ('aa');
+
+delimiter |;
+CREATE FUNCTION f1() RETURNS CHAR
+ RETURN (SELECT f2())|
+CREATE FUNCTION f2() RETURNS CHAR
+ RETURN (SELECT f3())|
+CREATE FUNCTION f3() RETURNS CHAR
+ RETURN (SELECT f4())|
+CREATE FUNCTION f4() RETURNS CHAR
+BEGIN
+ RETURN (SELECT a FROM t1);
+END|
+delimiter ;|
+
+SELECT f1();
+
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP FUNCTION f3;
+DROP FUNCTION f4;
+DROP TABLE t1;
+
--echo # ------------------------------------------------------------------
--echo # -- End of 6.0 tests
--echo # ------------------------------------------------------------------
=== modified file 'mysql-test/t/subselect3.test'
--- a/mysql-test/t/subselect3.test 2008-12-22 20:10:35 +0000
+++ b/mysql-test/t/subselect3.test 2008-12-28 15:00:21 +0000
@@ -976,3 +976,35 @@ set join_cache_level=6;
select * from t0 where t0.a in (select t1.a from t1 where t1.b=0);
set join_cache_level=@save_join_cache_level;
drop table t0, t1;
+
+--echo #
+--echo # BUG#32665 Query with dependent subquery is too slow
+--echo #
+create table t1 (
+ idIndividual int primary key
+);
+insert into t1 values (1),(2);
+
+create table t2 (
+ idContact int primary key,
+ contactType int,
+ idObj int
+);
+insert into t2 values (1,1,1),(2,2,2),(3,3,3);
+
+create table t3 (
+ idAddress int primary key,
+ idContact int,
+ postalStripped varchar(100)
+);
+
+insert into t3 values (1,1, 'foo'), (2,2,'bar');
+
+--echo The following must be converted to a semi-join:
+explain extended SELECT a.idIndividual FROM t1 a
+WHERE a.idIndividual IN
+ ( SELECT c.idObj FROM t3 cona
+ INNER JOIN t2 c ON c.idContact=cona.idContact
+ WHERE cona.postalStripped='T2H3B2'
+ );
+drop table t1,t2,t3;
=== modified file 'mysql-test/t/trigger.test'
--- a/mysql-test/t/trigger.test 2008-04-08 16:01:20 +0000
+++ b/mysql-test/t/trigger.test 2008-12-10 21:53:59 +0000
@@ -2337,3 +2337,68 @@ drop trigger trg2;
drop table t1, t2;
--echo End of 5.1 tests.
+
+#
+# Bug#36649: Condition area is not properly cleaned up after stored routine invocation
+#
+
+--disable_warnings
+DROP TRIGGER IF EXISTS trg1;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+
+delimiter |;
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE a CHAR;
+ SELECT 'ab' INTO a;
+ SELECT 'ab' INTO a;
+ SELECT 'a' INTO a;
+END|
+delimiter ;|
+
+INSERT INTO t1 VALUES (1);
+
+DROP TRIGGER trg1;
+DROP TABLE t1;
+
+#
+# Successive trigger actuations
+#
+
+--disable_warnings
+DROP TRIGGER IF EXISTS trg1;
+DROP TRIGGER IF EXISTS trg2;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+
+delimiter |;
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE trg1 CHAR;
+ SELECT 'ab' INTO trg1;
+END|
+
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE trg2 CHAR;
+ SELECT 'ab' INTO trg2;
+END|
+
+delimiter ;|
+
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+SHOW WARNINGS;
+INSERT INTO t1 VALUES (1),(2);
+
+DROP TRIGGER trg1;
+DROP TRIGGER trg2;
+DROP TABLE t1;
+
+--echo End of 6.0 tests.
=== modified file 'sql/Makefile.am'
--- a/sql/Makefile.am 2009-01-08 11:57:59 +0000
+++ b/sql/Makefile.am 2009-01-20 10:26:59 +0000
@@ -102,7 +102,7 @@ noinst_HEADERS = item.h item_func.h item
probes.h sql_audit.h transaction.h \
contributors.h sql_servers.h ddl_blocker.h \
si_objects.h si_logs.h sql_plist.h mdl.h records.h \
- rpl_handler.h replication.h sql_prepare.h
+ rpl_handler.h replication.h sql_prepare.h debug_sync.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
=== modified file 'sql/backup/be_default.cc'
--- a/sql/backup/be_default.cc 2008-09-09 08:19:21 +0000
+++ b/sql/backup/be_default.cc 2008-12-12 11:36:54 +0000
@@ -68,6 +68,7 @@
#include "be_default.h"
#include "backup_aux.h"
#include "rpl_record.h"
+#include "debug_sync.h"
namespace default_backup {
=== modified file 'sql/backup/be_snapshot.cc'
--- a/sql/backup/be_snapshot.cc 2008-10-30 12:29:54 +0000
+++ b/sql/backup/be_snapshot.cc 2008-12-12 11:36:54 +0000
@@ -45,6 +45,7 @@
#include "be_snapshot.h"
#include "backup_aux.h"
#include "transaction.h"
+#include "debug_sync.h"
namespace snapshot_backup {
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc 2008-12-17 18:40:14 +0000
+++ b/sql/backup/kernel.cc 2009-01-14 10:10:00 +0000
@@ -1241,7 +1241,7 @@ int Backup_restore_ctx::do_restore(bool
following line should be removed.
*/
close_thread_tables(m_thd); // Never errors
- m_thd->main_da.reset_diagnostics_area(); // Never errors
+ m_thd->stmt_da->reset_diagnostics_area(); // Never errors
err= lock_tables_for_restore(); // logs errors
if (err)
@@ -1273,7 +1273,7 @@ int Backup_restore_ctx::do_restore(bool
following line should be removed.
*/
close_thread_tables(m_thd); // Never errors
- m_thd->main_da.reset_diagnostics_area(); // Never errors
+ m_thd->stmt_da->reset_diagnostics_area(); // Never errors
DBUG_PRINT("restore",("Done."));
=== modified file 'sql/backup/logger.h'
--- a/sql/backup/logger.h 2008-12-10 15:53:06 +0000
+++ b/sql/backup/logger.h 2009-01-13 15:26:20 +0000
@@ -6,6 +6,7 @@
#include <backup/error.h>
#include "si_logs.h"
#include "rpl_mi.h"
+#include "debug_sync.h"
namespace backup {
=== modified file 'sql/ddl_blocker.cc'
--- a/sql/ddl_blocker.cc 2008-11-21 19:35:55 +0000
+++ b/sql/ddl_blocker.cc 2008-12-12 11:36:54 +0000
@@ -28,6 +28,7 @@
*/
#include "ddl_blocker.h"
+#include "debug_sync.h"
DDL_blocker_class *DDL_blocker_class::m_instance= NULL;
=== modified file 'sql/debug_sync.cc'
--- a/sql/debug_sync.cc 2008-11-20 11:01:12 +0000
+++ b/sql/debug_sync.cc 2008-12-17 10:11:14 +0000
@@ -206,10 +206,12 @@
See also worklog entry WL#4259 - Test Synchronization Facility
*/
-#include "mysql_priv.h"
+#include "debug_sync.h"
#if defined(ENABLED_DEBUG_SYNC)
+#include "mysql_priv.h"
+
/*
Action to perform at a synchronization point.
NOTE: This structure is moved around in memory by realloc(), qsort(),
@@ -544,7 +546,7 @@ static void debug_sync_action_string(cha
{
if ((wtxt == result) && (wtxt < wend))
*(wtxt++)= ' ';
- wtxt= debug_sync_bmove_len(wtxt, wend, STRING_WITH_LEN("WAIT_FOR "));
+ wtxt= debug_sync_bmove_len(wtxt, wend, STRING_WITH_LEN(" WAIT_FOR "));
wtxt= debug_sync_bmove_len(wtxt, wend, action->wait_for.ptr(),
action->wait_for.length());
=== added file 'sql/debug_sync.h'
--- a/sql/debug_sync.h 1970-01-01 00:00:00 +0000
+++ b/sql/debug_sync.h 2008-12-12 11:36:54 +0000
@@ -0,0 +1,63 @@
+/* Copyright (C) 2008 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifdef USE_PRAGMA_INTERFACE
+#pragma interface /* gcc class implementation */
+#endif
+
+#ifndef DEBUG_SYNC_H
+#define DEBUG_SYNC_H
+
+#include <my_global.h>
+
+class THD;
+
+#ifdef EXTRA_DEBUG
+/**
+ Sync points allow us to force the server to reach a certain line of code
+ and block there until the client tells the server it is ok to go on.
+ The client tells the server to block with SELECT GET_LOCK()
+ and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
+ concurrency problems
+*/
+#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
+ debug_sync_point(lock_name,lock_timeout)
+void debug_sync_point(const char* lock_name, uint lock_timeout);
+#else
+#define DBUG_SYNC_POINT(lock_name,lock_timeout)
+#endif /* EXTRA_DEBUG */
+
+/* Debug Sync Facility. */
+#if defined(ENABLED_DEBUG_SYNC)
+/* Macro to be put in the code at synchronization points. */
+#define DEBUG_SYNC(_thd_, _sync_point_name_) \
+ do { if (unlikely(opt_debug_sync_timeout)) \
+ debug_sync(_thd_, STRING_WITH_LEN(_sync_point_name_)); \
+ } while (0)
+/* Command line option --debug-sync-timeout. See mysqld.cc. */
+extern uint opt_debug_sync_timeout;
+/* Default WAIT_FOR timeout if command line option is given without argument. */
+#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300
+/* Debug Sync prototypes. See debug_sync.cc. */
+extern int debug_sync_init(void);
+extern void debug_sync_end(void);
+extern void debug_sync_init_thread(THD *thd);
+extern void debug_sync_end_thread(THD *thd);
+extern void debug_sync(THD *thd, const char *sync_point_name, size_t name_len);
+#else /* defined(ENABLED_DEBUG_SYNC) */
+#define DEBUG_SYNC(_thd_, _sync_point_name_) /* disabled DEBUG_SYNC */
+#endif /* defined(ENABLED_DEBUG_SYNC) */
+
+#endif /* DEBUG_SYNC_H */
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2008-12-14 11:36:15 +0000
+++ b/sql/ha_ndbcluster.cc 2009-01-09 16:38:52 +0000
@@ -6602,7 +6602,6 @@ void ha_ndbcluster::get_auto_increment(u
HA_NULL_IN_KEY | \
HA_AUTO_PART_KEY | \
HA_NO_PREFIX_CHAR_KEYS | \
- HA_NEED_READ_RANGE_BUFFER | \
HA_CAN_GEOMETRY | \
HA_CAN_BIT_FIELD | \
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | \
=== modified file 'sql/ha_partition.h'
--- a/sql/ha_partition.h 2009-01-08 11:57:59 +0000
+++ b/sql/ha_partition.h 2009-01-20 10:26:59 +0000
@@ -728,18 +728,6 @@ public:
Is the storage engine capable of handling bit fields?
(MyISAM, NDB)
- HA_NEED_READ_RANGE_BUFFER:
- Is Read Multi-Range supported => need multi read range buffer
- This parameter specifies whether a buffer for read multi range
- is needed by the handler. Whether the handler supports this
- feature or not is dependent of whether the handler implements
- read_multi_range* calls or not. The only handler currently
- supporting this feature is NDB so the partition handler need
- not handle this call. There are methods in handler.cc that will
- transfer those calls into index_read and other calls in the
- index scan module.
- (NDB)
-
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION:
Does the storage engine need a PK for position?
Used with hidden primary key in InnoDB.
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2009-01-08 11:57:59 +0000
+++ b/sql/handler.cc 2009-01-20 10:26:59 +0000
@@ -24,6 +24,7 @@
#endif
#include "mysql_priv.h"
+#include "debug_sync.h"
#include "rpl_filter.h"
#include <myisampack.h>
#include "myisam.h"
@@ -3892,7 +3893,7 @@ int ha_reset_logs(THD *thd)
{
binlog_func_st bfn= {BFN_RESET_LOGS, 0};
binlog_func_foreach(thd, &bfn);
- if (thd->main_da.is_error())
+ if (thd->stmt_da->is_error())
return 1;
return 0;
}
@@ -3901,7 +3902,7 @@ int ha_reset_slave(THD* thd)
{
binlog_func_st bfn= {BFN_RESET_SLAVE, 0};
binlog_func_foreach(thd, &bfn);
- if (thd->main_da.is_error())
+ if (thd->stmt_da->is_error())
return 1;
return 0;
}
@@ -3923,7 +3924,7 @@ int ha_binlog_index_purge_file(THD *thd,
{
binlog_func_st bfn= {BFN_BINLOG_PURGE_FILE, (void *)file};
binlog_func_foreach(thd, &bfn);
- if (thd->main_da.is_error())
+ if (thd->stmt_da->is_error())
return 1;
return 0;
}
@@ -3932,7 +3933,7 @@ static int ha_global_schema_lock(THD *th
{
binlog_func_st bfn= {BFN_GLOBAL_SCHEMA_LOCK, (void *)&no_queue};
int res= binlog_func_foreach(thd, &bfn);
- if (res || thd->main_da.is_error())
+ if (res || thd->stmt_da->is_error())
return 1;
return 0;
}
@@ -3941,7 +3942,7 @@ static int ha_global_schema_unlock(THD *
{
binlog_func_st bfn= {BFN_GLOBAL_SCHEMA_UNLOCK, 0};
binlog_func_foreach(thd, &bfn);
- if (thd->main_da.is_error())
+ if (thd->stmt_da->is_error())
return 1;
return 0;
}
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2009-01-08 11:57:59 +0000
+++ b/sql/handler.h 2009-01-20 10:26:59 +0000
@@ -167,14 +167,11 @@ typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_AL
#define HA_FILE_BASED (1 << 26)
#define HA_NO_VARCHAR (1 << 27)
#define HA_CAN_BIT_FIELD (1 << 28) /* supports bit fields */
-#define HA_NEED_READ_RANGE_BUFFER (1 << 29) /* for read_multi_range */
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
#define HA_NO_COPY_ON_ALTER (LL(1) << 31)
#define HA_HAS_RECORDS (LL(1) << 32) /* records() gives exact count*/
/* Has it's own method of binlog logging */
#define HA_HAS_OWN_BINLOGGING (LL(1) << 33)
-#define HA_MRR_CANT_SORT (LL(1) << 34)
-
/*
Engine is capable of row-format and statement-format logging,
respectively
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2009-01-08 11:57:59 +0000
+++ b/sql/item_func.cc 2009-01-20 10:26:59 +0000
@@ -37,6 +37,7 @@
#include "sp_head.h"
#include "sp_rcontext.h"
#include "sp.h"
+#include "debug_sync.h"
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#define sp_restore_security_context(A,B) while (0) {}
=== modified file 'sql/lock.cc'
--- a/sql/lock.cc 2008-12-17 18:40:14 +0000
+++ b/sql/lock.cc 2009-01-13 15:26:20 +0000
@@ -75,6 +75,7 @@
#include "mysql_priv.h"
#include "transaction.h"
+#include "debug_sync.h"
#include <hash.h>
#include <assert.h>
@@ -425,6 +426,7 @@ static int lock_external(THD *thd, TABLE
(*tables)->current_lock= lock_type;
}
}
+ DEBUG_SYNC(thd, "locked_external");
DBUG_RETURN(0);
}
=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc 2008-10-14 12:08:56 +0000
+++ b/sql/mdl.cc 2008-12-17 10:11:14 +0000
@@ -15,7 +15,7 @@
#include "mdl.h"
-
+#include "debug_sync.h"
#include <hash.h>
#include <mysqld_error.h>
@@ -470,6 +470,8 @@ static inline const char* mdl_enter_cond
mysys_var->current_mutex= &LOCK_mdl;
mysys_var->current_cond= &COND_mdl;
+ DEBUG_SYNC(context->thd, "mdl_enter_cond");
+
return set_thd_proc_info(context->thd, "Waiting for table",
calling_func, calling_file, calling_line);
}
@@ -490,6 +492,8 @@ static inline void mdl_exit_cond(MDL_CON
mysys_var->current_mutex= 0;
mysys_var->current_cond= 0;
pthread_mutex_unlock(&mysys_var->mutex);
+
+ DEBUG_SYNC(context->thd, "mdl_exit_cond");
(void) set_thd_proc_info(context->thd, old_msg, calling_func,
calling_file, calling_line);
=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h 2009-01-08 11:57:59 +0000
+++ b/sql/mysql_priv.h 2009-01-20 10:26:59 +0000
@@ -603,42 +603,6 @@ enum open_table_mode
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
#define UNDEF_POS (-1)
-#ifdef EXTRA_DEBUG
-/**
- Sync points allow us to force the server to reach a certain line of code
- and block there until the client tells the server it is ok to go on.
- The client tells the server to block with SELECT GET_LOCK()
- and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
- concurrency problems
-*/
-#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
- debug_sync_point(lock_name,lock_timeout)
-void debug_sync_point(const char* lock_name, uint lock_timeout);
-#else
-#define DBUG_SYNC_POINT(lock_name,lock_timeout)
-#endif /* EXTRA_DEBUG */
-
-/* Debug Sync Facility. */
-#if defined(ENABLED_DEBUG_SYNC)
-/* Macro to be put in the code at synchronization points. */
-#define DEBUG_SYNC(_thd_, _sync_point_name_) \
- do { if (unlikely(opt_debug_sync_timeout)) \
- debug_sync(_thd_, STRING_WITH_LEN(_sync_point_name_)); \
- } while (0)
-/* Command line option --debug-sync-timeout. See mysqld.cc. */
-extern uint opt_debug_sync_timeout;
-/* Default WAIT_FOR timeout if command line option is given without argument. */
-#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300
-/* Debug Sync prototypes. See debug_sync.cc. */
-extern int debug_sync_init(void);
-extern void debug_sync_end(void);
-extern void debug_sync_init_thread(THD *thd);
-extern void debug_sync_end_thread(THD *thd);
-extern void debug_sync(THD *thd, const char *sync_point_name, size_t name_len);
-#else /* defined(ENABLED_DEBUG_SYNC) */
-#define DEBUG_SYNC(_thd_, _sync_point_name_) /* disabled DEBUG_SYNC */
-#endif /* defined(ENABLED_DEBUG_SYNC) */
-
#define BACKUP_WAIT_TIMEOUT_DEFAULT 50;
/* BINLOG_DUMP options */
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2009-01-08 11:57:59 +0000
+++ b/sql/mysqld.cc 2009-01-20 10:26:59 +0000
@@ -28,6 +28,7 @@
#include "events.h"
#include "ddl_blocker.h"
#include "sql_audit.h"
+#include "debug_sync.h"
#include <waiting_threads.h>
#include "../storage/myisam/ha_myisam.h"
=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc 2008-12-16 11:29:22 +0000
+++ b/sql/protocol.cc 2009-01-13 15:26:20 +0000
@@ -30,7 +30,7 @@
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
void net_send_error_packet(THD *thd, uint sql_errno, const char *err);
/* Declared non-static only because of the embedded library. */
-void net_send_ok(THD *, uint, uint, ha_rows, ulonglong, const char *);
+void net_send_ok(THD *, uint, uint, ulonglong, ulonglong, const char *);
/* Declared non-static only because of the embedded library. */
void net_send_eof(THD *thd, uint server_status, uint statement_warn_count);
#ifndef EMBEDDED_LIBRARY
@@ -180,7 +180,7 @@ void net_send_error(THD *thd, uint sql_e
void
net_send_ok(THD *thd,
uint server_status, uint statement_warn_count,
- ha_rows affected_rows, ulonglong id, const char *message)
+ ulonglong affected_rows, ulonglong id, const char *message)
{
NET *net= &thd->net;
uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
@@ -487,7 +487,7 @@ void Protocol::end_statement()
*/
void Protocol::send_ok(uint server_status, uint statement_warn_count,
- ha_rows affected_rows, ulonglong last_insert_id,
+ ulonglong affected_rows, ulonglong last_insert_id,
const char *message)
{
DBUG_ENTER("Protocol::send_ok");
=== modified file 'sql/protocol.h'
--- a/sql/protocol.h 2008-12-05 23:47:51 +0000
+++ b/sql/protocol.h 2008-12-08 15:07:40 +0000
@@ -50,7 +50,7 @@ protected:
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
virtual void send_ok(uint server_status, uint statement_warn_count,
- ha_rows affected_rows, ulonglong last_insert_id,
+ ulonglong affected_rows, ulonglong last_insert_id,
const char *message);
virtual void send_eof(uint server_status, uint statement_warn_count);
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2008-12-17 18:40:14 +0000
+++ b/sql/sp_head.cc 2009-01-13 15:26:20 +0000
@@ -1070,8 +1070,8 @@ sp_head::execute(THD *thd)
Item_change_list old_change_list;
String old_packet;
Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer;
-
Object_creation_ctx *saved_creation_ctx;
+ Warning_info *saved_warning_info, warning_info(thd->warning_info->warn_id());
/* Use some extra margin for possible SP recursion and functions */
if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (uchar*)&old_packet))
@@ -1120,6 +1120,11 @@ sp_head::execute(THD *thd)
thd->is_slave_error= 0;
old_arena= thd->stmt_arena;
+ /* Push a new warning information area. */
+ warning_info.append_warning_info(thd, thd->warning_info);
+ saved_warning_info= thd->warning_info;
+ thd->warning_info= &warning_info;
+
/*
Switch query context. This has to be done early as this is sometimes
allocated trough sql_alloc
@@ -1320,6 +1325,10 @@ sp_head::execute(THD *thd)
thd->stmt_arena= old_arena;
state= EXECUTED;
+
+ /* Restore the caller's original warning information area. */
+ saved_warning_info->merge_with_routine_info(thd, thd->warning_info);
+ thd->warning_info= saved_warning_info;
done:
DBUG_PRINT("info", ("err_status: %d killed: %d is_slave_error: %d report_error: %d",
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_base.cc 2009-01-20 10:26:59 +0000
@@ -17,6 +17,7 @@
/* Basic functions needed by many modules */
#include "mysql_priv.h"
+#include "debug_sync.h"
#include "sql_select.h"
#include "sp_head.h"
#include "sp.h"
@@ -4470,6 +4471,8 @@ int lock_tables(THD *thd, TABLE_LIST *ta
if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start),
flags, need_reopen)))
DBUG_RETURN(-1);
+
+ DEBUG_SYNC(thd, "after_lock_tables_takes_lock");
if (thd->lex->requires_prelocking() &&
thd->lex->sql_command != SQLCOM_LOCK_TABLES)
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_class.cc 2009-01-20 10:26:59 +0000
@@ -43,6 +43,7 @@
#include "sp_rcontext.h"
#include "sp_cache.h"
#include "transaction.h"
+#include "debug_sync.h"
/*
The following is used to initialise Table_ident with a internal
@@ -400,7 +401,6 @@ THD::THD()
first_successful_insert_id_in_prev_stmt_for_binlog(0),
first_successful_insert_id_in_cur_stmt(0),
stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
- main_warning_info(0),
warning_info(&main_warning_info),
stmt_da(&main_da),
global_read_lock(0),
@@ -425,7 +425,8 @@ THD::THD()
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_control(0),
#endif /* defined(ENABLED_DEBUG_SYNC) */
- locked_tables_root(NULL)
+ locked_tables_root(NULL),
+ main_warning_info(0)
{
ulong tmp;
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2008-12-31 13:49:36 +0000
+++ b/sql/sql_class.h 2009-01-13 15:26:20 +0000
@@ -1633,9 +1633,7 @@ public:
table_map used_tables;
USER_CONN *user_connect;
CHARSET_INFO *db_charset;
- Warning_info main_warning_info;
Warning_info *warning_info;
- Diagnostics_area main_da;
Diagnostics_area *stmt_da;
#if defined(ENABLED_PROFILING)
PROFILING profiling;
@@ -2256,13 +2254,15 @@ private:
tree itself is reused between executions and thus is stored elsewhere.
*/
MEM_ROOT main_mem_root;
+ Warning_info main_warning_info;
+ Diagnostics_area main_da;
};
/** A short cut for thd->stmt_da->set_ok_status(). */
inline void
-my_ok(THD *thd, ha_rows affected_rows= 0, ulonglong id= 0,
+my_ok(THD *thd, ulonglong affected_rows= 0, ulonglong id= 0,
const char *message= NULL)
{
thd->stmt_da->set_ok_status(thd, affected_rows, id, message);
=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_delete.cc 2009-01-20 10:26:59 +0000
@@ -20,6 +20,7 @@
*/
#include "mysql_priv.h"
+#include "debug_sync.h"
#include "sql_select.h"
#include "sp_head.h"
#include "sql_trigger.h"
=== modified file 'sql/sql_error.cc'
--- a/sql/sql_error.cc 2008-12-06 00:51:16 +0000
+++ b/sql/sql_error.cc 2008-12-10 21:53:59 +0000
@@ -224,6 +224,47 @@ void Warning_info::clear_warning_info(ul
/**
+ Append warnings only if the original contents of the routine
+ warning info was replaced.
+*/
+
+void Warning_info::merge_with_routine_info(THD *thd, Warning_info *source)
+{
+ /*
+ If a routine body is empty or if a routine did not
+ generate any warnings (thus m_warn_id didn't change),
+ do not duplicate our own contents by appending the
+ contents of the called routine. We know that the called
+ routine did not change its warning info.
+
+ On the other hand, if the routine body is not empty and
+ some statement in the routine generates a warning or
+ uses tables, m_warn_id is guaranteed to have changed.
+ In this case we know that the routine warning info
+ contains only new warnings, and thus we perform a copy.
+ */
+ if (m_warn_id != source->m_warn_id)
+ {
+ /*
+ If the invocation of the routine was a standalone statement,
+ rather than a sub-statement, in other words, if it's a CALL
+ of a procedure, rather than invocation of a function or a
+ trigger, we need to clear the current contents of the caller's
+ warning info.
+
+ This is per MySQL rules: if a statement generates a warning,
+ warnings from the previous statement are flushed. Normally
+ it's done in push_warning(). However, here we don't use
+ push_warning() to avoid invocation of condition handlers or
+ escalation of warnings to errors.
+ */
+ opt_clear_warning_info(thd->query_id);
+ append_warning_info(thd, source);
+ }
+}
+
+
+/**
Add a warning to the list of warnings. Increment the respective
counters.
*/
@@ -267,8 +308,7 @@ void push_warning(THD *thd, MYSQL_ERROR:
!(thd->options & OPTION_SQL_NOTES))
DBUG_VOID_RETURN;
- if (! thd->spcont)
- thd->warning_info->opt_clear_warning_info(thd->query_id);
+ thd->warning_info->opt_clear_warning_info(thd->query_id);
thd->got_warning= 1;
=== modified file 'sql/sql_error.h'
--- a/sql/sql_error.h 2008-12-05 23:47:51 +0000
+++ b/sql/sql_error.h 2008-12-10 21:53:59 +0000
@@ -226,6 +226,27 @@ public:
}
/**
+ Concatenate the list of warnings.
+ It's considered tolerable to lose a warning.
+ */
+ void append_warning_info(THD *thd, Warning_info *source)
+ {
+ MYSQL_ERROR *err;
+ List_iterator_fast<MYSQL_ERROR> it(source->warn_list());
+ /*
+ Don't use ::push_warning() to avoid invocation of condition
+ handlers or escalation of warnings to errors.
+ */
+ while ((err= it++))
+ Warning_info::push_warning(thd, err->level, err->code, err->msg);
+ }
+
+ /**
+ Conditional merge of related warning information areas.
+ */
+ void merge_with_routine_info(THD *thd, Warning_info *source);
+
+ /**
Reset between two COM_ commands. Warnings are preserved
between commands, but statement_warn_count indicates
the number of warnings of this particular statement only.
@@ -261,6 +282,9 @@ public:
{
return m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
}
+
+ /** Id of the warning information area. */
+ ulonglong warn_id() const { return m_warn_id; }
/** Do we have any errors and warnings that we can *show*? */
bool is_empty() const { return m_warn_list.elements == 0; }
=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc 2008-12-17 18:40:14 +0000
+++ b/sql/sql_insert.cc 2009-01-13 15:26:20 +0000
@@ -63,6 +63,7 @@
#include "rpl_mi.h"
#include "sql_audit.h"
#include "transaction.h"
+#include "debug_sync.h"
#ifndef EMBEDDED_LIBRARY
static bool delayed_get_table(THD *thd, TABLE_LIST *table_list);
=== modified file 'sql/sql_join_cache.cc'
--- a/sql/sql_join_cache.cc 2008-12-22 19:03:25 +0000
+++ b/sql/sql_join_cache.cc 2009-01-08 05:47:10 +0000
@@ -2446,9 +2446,16 @@ int JOIN_CACHE_BKA_UNIQUE::init()
uint n= buff_size / (pack_length+key_entry_length+size_of_key_ofs);
+ /*
+ TODO: Make a better estimate for this upper bound of
+ the number of records in in the join buffer.
+ */
+ uint max_n= buff_size / (pack_length-length+
+ key_entry_length+size_of_key_ofs);
+
hash_entries= (uint) (n / 0.7);
- if (offset_size(n*key_entry_length) <=
+ if (offset_size(max_n*key_entry_length) <=
size_of_key_ofs)
break;
}
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_parse.cc 2009-01-20 10:26:59 +0000
@@ -32,6 +32,7 @@
#include "sql_audit.h"
#include "transaction.h"
#include "sql_prepare.h"
+#include "debug_sync.h"
#ifdef BACKUP_TEST
#include "backup/backup_test.h"
@@ -1849,9 +1850,8 @@ mysql_execute_command(THD *thd)
A better approach would be to reset this for any commands
that is not a SHOW command or a select that only access local
variables, but for now this is probably good enough.
- Don't reset warnings when executing a stored routine.
*/
- if ((all_tables || !lex->is_single_level_stmt()) && !thd->spcont)
+ if (all_tables)
thd->warning_info->opt_clear_warning_info(thd->query_id);
#ifdef HAVE_REPLICATION
=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc 2008-12-13 11:02:16 +0000
+++ b/sql/sql_prepare.cc 2009-01-13 15:26:20 +0000
@@ -237,7 +237,7 @@ protected:
virtual enum enum_protocol_type type() { return PROTOCOL_LOCAL; };
virtual void send_ok(uint server_status, uint statement_warn_count,
- ha_rows affected_rows, ulonglong last_insert_id,
+ ulonglong affected_rows, ulonglong last_insert_id,
const char *message);
virtual void send_eof(uint server_status, uint statement_warn_count);
@@ -1913,7 +1913,7 @@ static bool check_prepared_statement(Pre
get_table_list());
/* Reset warning count for each query that uses tables */
- if ((tables || !lex->is_single_level_stmt()) && !thd->spcont)
+ if (tables)
thd->warning_info->opt_clear_warning_info(thd->query_id);
switch (sql_command) {
@@ -4327,7 +4327,7 @@ bool Protocol_local::send_out_parameters
void
Protocol_local::send_ok(uint server_status, uint statement_warn_count,
- ha_rows affected_rows, ulonglong last_insert_id,
+ ulonglong affected_rows, ulonglong last_insert_id,
const char *message)
{
/*
=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_repl.cc 2009-01-20 10:26:59 +0000
@@ -22,6 +22,7 @@
#include "rpl_filter.h"
#include <my_dir.h>
#include "rpl_handler.h"
+#include "debug_sync.h"
int max_binlog_dump_events = 0; // unlimited
my_bool opt_sporadic_binlog_dump_fail = 0;
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_select.cc 2009-01-20 10:26:59 +0000
@@ -18734,9 +18734,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
}
if (tab->pre_idx_push_select_cond)
{
+ tab->select_cond= tab->pre_idx_push_select_cond;
if (tab->select)
tab->select->cond= tab->select_cond;
- tab->select_cond= tab->pre_idx_push_select_cond;
}
table->file->ha_index_or_rnd_end();
if (join->select_options & SELECT_DESCRIBE)
=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h 2008-12-27 19:17:35 +0000
+++ b/sql/sql_select.h 2009-01-08 05:47:10 +0000
@@ -397,12 +397,6 @@ private:
/* Size of the offset of a field within a record in the cache */
uint size_of_fld_ofs;
- /*
- The total maximal length of the fields stored for a record in the cache.
- For blob fields only the sizes of the blob lengths are taken into account.
- */
- uint length;
-
protected:
/* 3 functions below actually do not use the hidden parameter 'this' */
@@ -433,6 +427,12 @@ protected:
}
/*
+ The total maximal length of the fields stored for a record in the cache.
+ For blob fields only the sizes of the blob lengths are taken into account.
+ */
+ uint length;
+
+ /*
Representation of the executed multi-way join through which all needed
context can be accessed.
*/
@@ -891,7 +891,7 @@ public:
attached to the corresponding key entry in the hash table, or without any
association link. When the next record is returned by a call to the MRR
function multi_range_read_next without any association (because if was not
- passed with together with the key) then the key value is extracted from the
+ passed together with the key) then the key value is extracted from the
returned record and searched for it in the hash table. If there is any records
with such key the chain of them will be yielded as the result of this search.
@@ -923,22 +923,23 @@ public:
| V | | | | |
| |key_1|[*]|[*]| | | ... |[*]| ... |[*]| ... | |
+----------------------------------------------------------------------------+
- ^
- |
+ ^ ^ ^
+ | i-th entry j-th entry
hash table
i-th hash entry:
- circular record chain for key_3:
- record_2_1
- record_2_2 (points to record_2_1)
-
- j-th hash entry:
circular record chain for key_1:
record_1_1
record_1_2
record_1_3 (points to record_1_1)
circular record chain for key_3:
record_3_1 (points to itself)
+
+ j-th hash entry:
+ circular record chain for key_2:
+ record_2_1
+ record_2_2 (points to record_2_1)
+
*/
class JOIN_CACHE_BKA_UNIQUE :public JOIN_CACHE_BKA
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_table.cc 2009-01-20 10:26:59 +0000
@@ -16,6 +16,7 @@
/* drop and alter of tables */
#include "mysql_priv.h"
+#include "debug_sync.h"
#include <hash.h>
#include <myisam.h>
#include <my_dir.h>
@@ -2980,13 +2981,21 @@ mysql_prepare_create_table(THD *thd, HA_
}
}
else if (!f_is_geom(sql_field->pack_flag) &&
- (column->length > length ||
- !Field::type_can_have_key_part (sql_field->sql_type) ||
- ((f_is_packed(sql_field->pack_flag) ||
- ((file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
- (key_info->flags & HA_NOSAME))) &&
- column->length != length)))
- {
+ ((column->length > length &&
+ !Field::type_can_have_key_part (sql_field->sql_type)) ||
+ ((f_is_packed(sql_field->pack_flag) ||
+ ((file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
+ (key_info->flags & HA_NOSAME))) &&
+ column->length != length)))
+ {
+ /* Catch invalid uses of partial keys.
+ A key is identified as 'partial' if column->length != length.
+ A partial key is invalid if they data type does
+ not allow it, or the field is packed (as in MyISAM),
+ or the storage engine doesn't allow prefixed search and
+ the key is primary key.
+ */
+
my_message(ER_WRONG_SUB_KEY, ER(ER_WRONG_SUB_KEY), MYF(0));
DBUG_RETURN(TRUE);
}
@@ -6684,6 +6693,8 @@ bool mysql_alter_table(THD *thd,char *ne
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
mysql_bin_log.write(&qinfo);
}
+ DBUG_EXECUTE_IF("sleep_alter_rename_view", my_sleep(6000000););
+ DEBUG_SYNC(thd, "alter_rename_view");
my_ok(thd);
}
pthread_mutex_unlock(&LOCK_open);
@@ -7300,22 +7311,31 @@ view_err:
error=1;
(void) quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP);
}
- else if (mysql_rename_table(new_db_type, new_db, tmp_name, new_db,
+
+ else {
+
+ DEBUG_SYNC(thd, "alter_table_before_rename");
+
+ if (mysql_rename_table(new_db_type, new_db, tmp_name, new_db,
new_alias, FN_FROM_IS_TMP) ||
(new_name != table_name || new_db != db) && // we also do rename
Table_triggers_list::change_table_name(thd, db, table_name,
new_db, new_alias))
- {
- /* Try to get everything back. */
- error=1;
- (void) quick_rm_table(new_db_type,new_db,new_alias, 0);
- (void) quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP);
- (void) mysql_rename_table(old_db_type, db, old_name, db, alias,
- FN_FROM_IS_TMP);
+ {
+ /* Try to get everything back. */
+ error=1;
+ (void) quick_rm_table(new_db_type,new_db,new_alias, 0);
+ (void) quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP);
+ (void) mysql_rename_table(old_db_type, db, old_name, db, alias,
+ FN_FROM_IS_TMP);
+ }
}
+ DBUG_EXECUTE_IF("sleep_alter_rename_table", my_sleep(6000000););
+ DEBUG_SYNC(thd, "alter_rename_table");
+
if (! error)
- (void) quick_rm_table(old_db_type, db, old_name, FN_IS_TMP);
+ (void) quick_rm_table(old_db_type, db, old_name, FN_IS_TMP);
pthread_mutex_unlock(&LOCK_open);
@@ -7329,6 +7349,7 @@ end_online:
thd_proc_info(thd, "end");
DBUG_EXECUTE_IF("sleep_alter_before_main_binlog", my_sleep(6000000););
+ DEBUG_SYNC(thd, "alter_table_before_main_binlog");
ha_binlog_log_query(thd, create_info->db_type, LOGCOM_ALTER_TABLE,
thd->query, thd->query_length,
=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc 2009-01-08 11:57:59 +0000
+++ b/sql/sql_update.cc 2009-01-20 10:26:59 +0000
@@ -922,7 +922,6 @@ bool mysql_prepare_update(THD *thd, TABL
if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
{
update_non_unique_table_error(table_list, "UPDATE", duplicate);
- my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
DBUG_RETURN(TRUE);
}
}
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2008-12-14 11:36:15 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2009-01-09 16:38:52 +0000
@@ -999,8 +999,7 @@ ha_innobase::ha_innobase(handlerton *hto
HA_PRIMARY_KEY_IN_READ_INDEX |
HA_BINLOG_ROW_CAPABLE |
HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
- HA_TABLE_SCAN_ON_INDEX | HA_NEED_READ_RANGE_BUFFER |
- HA_MRR_CANT_SORT),
+ HA_TABLE_SCAN_ON_INDEX),
primary_key(0), /* needs initialization because index_flags() may be called
before this is set to the real value. It's ok to have any
value here because it doesn't matter if we return the
=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc 2008-12-14 11:36:15 +0000
+++ b/storage/maria/ha_maria.cc 2009-01-13 15:26:20 +0000
@@ -2315,7 +2315,7 @@ int ha_maria::external_lock(THD *thd, in
This is a bit excessive, ACID requires this only if there are some
changes to commit (rollback shouldn't be tested).
*/
- DBUG_ASSERT(!thd->main_da.is_sent ||
+ DBUG_ASSERT(!thd->stmt_da->is_sent ||
thd->killed == THD::KILL_CONNECTION);
/* autocommit ? rollback a transaction */
#ifdef MARIA_CANNOT_ROLLBACK
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2008-12-13 11:02:16 +0000
+++ b/storage/myisam/ha_myisam.cc 2009-01-09 16:38:52 +0000
@@ -550,8 +550,7 @@ ha_myisam::ha_myisam(handlerton *hton, T
HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS |
HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
- HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT |
- HA_NEED_READ_RANGE_BUFFER | HA_MRR_CANT_SORT),
+ HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT),
can_enable_indexes(1)
{}
@@ -1602,23 +1601,6 @@ int ha_myisam::index_next_same(uchar *bu
return error;
}
-int ha_myisam::read_range_first(const key_range *start_key,
- const key_range *end_key,
- bool eq_range_arg,
- bool sorted /* ignored */)
-{
- int res;
- res= handler::read_range_first(start_key, end_key, eq_range_arg, sorted);
- return res;
-}
-
-
-int ha_myisam::read_range_next()
-{
- int res= handler::read_range_next();
- return res;
-}
-
int ha_myisam::rnd_init(bool scan)
{
@@ -1683,7 +1665,6 @@ int ha_myisam::info(uint flag)
stats.max_data_file_length= misam_info.max_data_file_length;
stats.max_index_file_length= misam_info.max_index_file_length;
stats.create_time= misam_info.create_time;
- stats.mrr_length_per_rec= misam_info.reflength + 8; // 8 = max(sizeof(void *))
/*
We want the value of stats.mrr_length_per_rec to be platform independent.
The size of the chunk at the end of the join buffer used for MRR needs
=== modified file 'storage/myisam/ha_myisam.h'
--- a/storage/myisam/ha_myisam.h 2008-08-26 20:38:29 +0000
+++ b/storage/myisam/ha_myisam.h 2009-01-09 16:38:52 +0000
@@ -150,9 +150,6 @@ class ha_myisam: public handler
{
return file;
}
- int read_range_first(const key_range *start_key, const key_range *end_key,
- bool eq_range_arg, bool sorted);
- int read_range_next();
public:
/**
* Multi Range Read interface
=== modified file 'storage/myisam/myisam_backup_engine.cc'
--- a/storage/myisam/myisam_backup_engine.cc 2008-11-02 23:38:05 +0000
+++ b/storage/myisam/myisam_backup_engine.cc 2009-01-13 15:26:20 +0000
@@ -27,6 +27,7 @@
#include "myisamdef.h" // to access dfile and kfile
#include "backup/backup_engine.h"
#include "backup/backup_aux.h" // for build_table_list()
+#include "debug_sync.h"
#include <hash.h>
/**
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc 2008-12-14 11:36:15 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc 2009-01-13 15:26:20 +0000
@@ -96,7 +96,7 @@
#include "../myisam/ha_myisam.h"
#include "ha_myisammrg.h"
#include "myrg_def.h"
-
+#include "debug_sync.h"
static handler *myisammrg_create_handler(handlerton *hton,
TABLE_SHARE *table,
| Thread |
|---|
| • bzr push into mysql-6.0-runtime branch (tomas.ulin:2806 to 2807) | Tomas Ulin | 21 Jan |