1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1

into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


sql/sql_delete.cc:
  Auto merged
This commit is contained in:
unknown
2008-03-25 14:54:08 +03:00
39 changed files with 875 additions and 227 deletions

View File

@ -102,4 +102,192 @@ disconnect con7;
connection default;
drop table t1;
# End of 4.1 tests
--disconnect con1
--disconnect con2
--disconnect con3
--disconnect con4
--disconnect con5
--disconnect con6
--disconnect con10
--echo # ------------------------------------------------------------------
--echo # -- End of 4.1 tests
--echo # ------------------------------------------------------------------
###########################################################################
--echo
--echo # -- Bug#33507: Event scheduler creates more threads than max_connections
--echo # -- which results in user lockout.
--echo
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
# NOTE: if the test case fails sporadically due to spurious connections,
# consider disabling all users.
--echo
let $saved_max_connections = `SELECT @@global.max_connections`;
SET GLOBAL max_connections = 3;
SET GLOBAL event_scheduler = ON;
--echo
--echo # -- Waiting for Event Scheduler to start...
let $wait_condition =
SELECT COUNT(*) = 1
FROM information_schema.processlist
WHERE user = 'event_scheduler';
--source include/wait_condition.inc
--echo
--echo # -- Disconnecting default connection...
--disconnect default
--echo
--echo # -- Check that we allow exactly three user connections, no matter how
--echo # -- many threads are running.
--echo
--echo # -- Connecting (1)...
let $con_name = con_1;
let $con_user_name = mysqltest_u1;
--source include/connect2.inc
--echo
--echo # -- Connecting (2)...
let $con_name = con_2;
let $con_user_name = mysqltest_u1;
--source include/connect2.inc
--echo
--echo # -- Connecting (3)...
let $con_name = con_3;
let $con_user_name = mysqltest_u1;
--source include/connect2.inc
--echo
--echo # -- Connecting (4) [should fail]...
let $con_name = con_4;
let $con_user_name = mysqltest_u1;
let $wait_timeout = 5;
--source include/connect2.inc
--echo
--echo # -- Check that we allow one extra SUPER-user connection.
--echo
--echo # -- Connecting super (1)...
let $con_name = con_super_1;
let $con_user_name = root;
--source include/connect2.inc
--echo
--echo # -- Connecting super (2) [should fail]...
let $con_name = con_super_2;
let $con_user_name = root;
let $wait_timeout = 5;
--source include/connect2.inc
--echo
--echo # -- Ensure that we have Event Scheduler thread, 3 ordinary user
--echo # -- connections and one extra super-user connection.
SELECT user FROM information_schema.processlist ORDER BY id;
--echo
--echo # -- Resetting variables...
--eval SET GLOBAL max_connections = $saved_max_connections
--echo
--echo # -- Stopping Event Scheduler...
SET GLOBAL event_scheduler = OFF;
--echo
--echo # -- Waiting for Event Scheduler to stop...
let $wait_condition =
SELECT COUNT(*) = 0
FROM information_schema.processlist
WHERE user = 'event_scheduler';
--source include/wait_condition.inc
--echo
--echo # -- That's it. Closing connections...
--disconnect con_1
--disconnect con_2
--disconnect con_3
--disconnect con_super_1
--echo
--echo # -- Restoring default connection...
--connect (default,localhost,root,,test)
--echo
--echo # -- Waiting for connections to close...
let $wait_condition =
SELECT COUNT(*) = 1
FROM information_schema.processlist
WHERE db = 'test';
--source include/wait_condition.inc
--echo
DROP USER mysqltest_u1@localhost;
--echo
--echo # -- End of Bug#33507.
--echo
###########################################################################
--echo # -- Bug#35074: max_used_connections is not correct.
--echo
FLUSH STATUS;
--echo
SHOW STATUS LIKE 'max_used_connections';
--echo
--echo # -- Starting Event Scheduler...
SET GLOBAL event_scheduler = ON;
--echo # -- Waiting for Event Scheduler to start...
let $wait_condition =
SELECT COUNT(*) = 1
FROM information_schema.processlist
WHERE user = 'event_scheduler';
--source include/wait_condition.inc
# NOTE: We should use a new connection here instead of reconnect in order to
# avoid races (we can not for sure when the connection being disconnected is
# actually disconnected on the server).
--echo
--echo # -- Opening a new connection to check max_used_connections...
--connect (con_1,localhost,root)
--echo
--echo # -- Check that max_used_connections hasn't changed.
SHOW STATUS LIKE 'max_used_connections';
--echo
--echo # -- Closing new connection...
--disconnect con_1
--connection default
--echo
--echo # -- Stopping Event Scheduler...
SET GLOBAL event_scheduler = OFF;
--echo # -- Waiting for Event Scheduler to stop...
let $wait_condition =
SELECT COUNT(*) = 0
FROM information_schema.processlist
WHERE user = 'event_scheduler';
--source include/wait_condition.inc
--echo
--echo # -- End of Bug#35074.
--echo
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------

View File

@ -1365,6 +1365,8 @@ create table t1 like information_schema.character_sets;
show create table t1;
drop table t1;
###########################################################################
--echo
--echo # --
--echo # -- Bug#21380: DEFAULT definition not always transfered by CREATE
@ -1407,8 +1409,10 @@ DROP TABLE t2;
--echo
--echo # -- End of test case for Bug#21380.
--echo
###########################################################################
--echo
--echo # --
--echo # -- Bug#18834: ALTER TABLE ADD INDEX on table with two timestamp fields
--echo # --
@ -1471,6 +1475,50 @@ DROP TABLE t3;
--echo
--echo # -- End of Bug#18834.
###########################################################################
--echo
--echo # --
--echo # -- Bug#34274: Invalid handling of 'DEFAULT 0' for YEAR data type.
--echo # --
--echo
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo
CREATE TABLE t1(c1 YEAR DEFAULT 2008, c2 YEAR DEFAULT 0);
--echo
SHOW CREATE TABLE t1;
--echo
INSERT INTO t1 VALUES();
--echo
SELECT * FROM t1;
--echo
ALTER TABLE t1 MODIFY c1 YEAR DEFAULT 0;
--echo
SHOW CREATE TABLE t1;
--echo
INSERT INTO t1 VALUES();
--echo
SELECT * FROM t1;
--echo
DROP TABLE t1;
--echo
--echo # -- End of Bug#34274
###########################################################################
--echo
--echo End of 5.1 tests

View File

@ -134,4 +134,38 @@ drop table mysql_test.`#sql-347f_8`;
copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm;
drop database mysql_test;
###########################################################################
--echo
--echo # --
--echo # -- Bug#29958: Weird message on DROP DATABASE if mysql.proc does not
--echo # -- exist.
--echo # --
--disable_warnings
DROP DATABASE IF EXISTS mysql_test;
--enable_warnings
CREATE DATABASE mysql_test;
--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm
--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD
--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI
DROP TABLE mysql.proc;
DROP DATABASE mysql_test;
--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD
--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI
--echo
--echo # --
--echo # -- End of Bug#29958.
--echo # --
###########################################################################
--echo
--echo End of 5.1 tests

View File

@ -14,6 +14,7 @@
# Disable concurrent inserts to avoid test failures when reading the
# connection id which was inserted into a table by another thread.
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
connect (con1,localhost,root,,);
@ -58,3 +59,7 @@ reap;
connection con2;
drop table t1;
connection default;
# Restore global concurrent_insert value
set @@global.concurrent_insert= @old_concurrent_insert;

View File

@ -8,6 +8,7 @@
# Disable concurrent inserts to avoid test failures when reading the
# connection id which was inserted into a table by another thread.
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
connect (con1, localhost, root,,);
@ -326,3 +327,9 @@ KILL CONNECTION_ID();
--echo # of close of the connection socket
--error 2013, 2006
SELECT 1;
--connection default
###########################################################################
# Restore global concurrent_insert value. Keep in the end of the test file.
set @@global.concurrent_insert= @old_concurrent_insert;

View File

@ -1251,6 +1251,15 @@ disconnect user2;
disconnect user3;
#
--echo #
--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
--echo #
set global query_cache_size=100000;
set global query_cache_size=0;
set global query_cache_type=0;
show status like 'Qcache_free_blocks';
--echo Restore default values.
# Bug #28211 RENAME DATABASE and query cache don't play nicely together
#
# TODO: enable these tests when RENAME DATABASE is implemented.

View File

@ -1,7 +1,9 @@
# Can't test with embedded server
-- source include/not_embedded.inc
# Disable concurrent inserts to avoid test failures
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
--sleep 2
--disable_warnings
drop table if exists t1,t3;
--enable_warnings
@ -39,10 +41,14 @@ create procedure bug4902_2()
begin
show processlist;
end|
--replace_column 1 # 6 # 3 localhost
--disable_result_log
call bug4902_2()|
--replace_column 1 # 6 # 3 localhost
--enable_result_log
show warnings|
--disable_result_log
call bug4902_2()|
--enable_result_log
show warnings|
drop procedure bug4902_2|
#
@ -268,69 +274,72 @@ drop procedure 15298_1;
drop procedure 15298_2;
#
# Test case disabled due to Bug#34891: sp_notembedded.test fails sporadically.
# Bug#29936 Stored Procedure DML ignores low_priority_updates setting
#
# #
# # Bug#29936 Stored Procedure DML ignores low_priority_updates setting
# #
--disable_warnings
drop table if exists t1;
drop procedure if exists p1;
--enable_warnings
create table t1 (value varchar(15));
create procedure p1() update t1 set value='updated' where value='old';
# load the procedure into sp cache and execute once
call p1();
insert into t1 (value) values ("old");
connect (rl_holder, localhost, root,,);
connect (rl_acquirer, localhost, root,,);
connect (rl_contender, localhost, root,,);
connect (rl_wait, localhost, root,,);
connection rl_holder;
select get_lock('b26162',120);
connection rl_acquirer;
--send select 'rl_acquirer', value from t1 where get_lock('b26162',120);
# we must wait till this select opens and locks the tables
connection rl_wait;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "User lock" and
info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)";
--source include/wait_condition.inc
connection default;
set session low_priority_updates=on;
--send call p1();
connection rl_wait;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Locked" and
info = "update t1 set value='updated' where value='old'";
--source include/wait_condition.inc
connection rl_contender;
select 'rl_contender', value from t1;
connection rl_holder;
select release_lock('b26162');
connection rl_acquirer;
--reap
connection default;
--reap
disconnect rl_holder;
disconnect rl_acquirer;
disconnect rl_wait;
drop procedure p1;
drop table t1;
set session low_priority_updates=default;
#
# --disable_warnings
# drop table if exists t1;
# drop procedure if exists p1;
# --enable_warnings
# Restore global concurrent_insert value. Keep in the end of the test file.
#
# create table t1 (value varchar(15));
# create procedure p1() update t1 set value='updated' where value='old';
#
# # load the procedure into sp cache and execute once
# call p1();
#
# insert into t1 (value) values ("old");
#
# connect (rl_holder, localhost, root,,);
# connect (rl_acquirer, localhost, root,,);
# connect (rl_contender, localhost, root,,);
# connect (rl_wait, localhost, root,,);
#
# connection rl_holder;
# select get_lock('b26162',120);
#
# connection rl_acquirer;
# --send select 'rl_acquirer', value from t1 where get_lock('b26162',120);
#
# # we must wait till this select opens and locks the tables
# connection rl_wait;
# let $wait_condition=
# select count(*) = 1 from information_schema.processlist
# where state = "User lock" and
# info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)";
# --source include/wait_condition.inc
#
# connection default;
# set session low_priority_updates=on;
# --send call p1();
#
# connection rl_wait;
# let $wait_condition=
# select count(*) = 1 from information_schema.processlist
# where state = "Locked" and
# info = "update t1 set value='updated' where value='old'";
# --source include/wait_condition.inc
#
# connection rl_contender;
# select 'rl_contender', value from t1;
#
# connection rl_holder;
# select release_lock('b26162');
#
# connection rl_acquirer;
# --reap
# connection default;
# --reap
#
# disconnect rl_holder;
# disconnect rl_acquirer;
# disconnect rl_wait;
# drop procedure p1;
# drop table t1;
# set session low_priority_updates=default;
set @@global.concurrent_insert= @old_concurrent_insert;

View File

@ -128,5 +128,37 @@ drop table t1, t2, t3;
disconnect connection_update;
disconnect connection_aux;
#
# Bug#34643: TRUNCATE crash if trigger and foreign key.
#
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=innodb;
CREATE TABLE t2(b INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=innodb;
INSERT INTO t1 VALUES (1);
CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW SET @a = 1;
CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1;
SET @a = 0;
SET @b = 0;
TRUNCATE t1;
SELECT @a, @b;
INSERT INTO t1 VALUES (1);
DELETE FROM t1;
SELECT @a, @b;
DROP TABLE t2, t1;
--echo End of 5.0 tests