mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result: Auto merged mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result: Auto merged mysql-test/t/disabled.def: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster_binlog.h: Auto merged sql/log_event.cc: Auto merged sql/log_event.h: Auto merged sql/rpl_record.cc: Auto merged sql/rpl_rli.h: Auto merged sql/rpl_utility.cc: Auto merged sql/rpl_utility.h: Auto merged
This commit is contained in:
@ -144,4 +144,29 @@ disconnect con1;
|
||||
disconnect con2;
|
||||
drop table t1, t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
--echo End of 4.1 tests
|
||||
|
||||
#
|
||||
# Bug#25164 create table `a` as select * from `A` hangs
|
||||
#
|
||||
|
||||
set storage_engine=innodb;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists a;
|
||||
drop table if exists A;
|
||||
--enable_warnings
|
||||
|
||||
create table A (c int);
|
||||
insert into A (c) values (0);
|
||||
--error 0,ER_LOCK_DEADLOCK,ER_UPDATE_TABLE_USED
|
||||
create table a as select * from A;
|
||||
drop table A;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists a;
|
||||
--enable_warnings
|
||||
|
||||
set storage_engine=default;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
@ -465,3 +465,36 @@ select * from t1;
|
||||
# Just to be sure and not confuse the next test case writer.
|
||||
drop table if exists t1;
|
||||
|
||||
#
|
||||
# Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
eval create table t1 (a int) ENGINE=$other_engine_type;
|
||||
--echo --> client 2
|
||||
connection con2;
|
||||
--error 1031
|
||||
handler t1 open;
|
||||
--echo --> client 1
|
||||
connection default;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#30632 HANDLER read failure causes hang
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
--error 1176
|
||||
handler t1_alias read a next;
|
||||
--error 1054
|
||||
handler t1_alias READ a next where inexistent > 0;
|
||||
--error 1176
|
||||
handler t1_alias read a next;
|
||||
--error 1054
|
||||
handler t1_alias READ a next where inexistent > 0;
|
||||
handler t1_alias close;
|
||||
drop table t1;
|
||||
|
@ -1,26 +0,0 @@
|
||||
# This file is intended to be used in each IM-test. It contains stamements,
|
||||
# that ensure that starting conditions (environment) for the IM-test are as
|
||||
# expected.
|
||||
|
||||
# Check the running instances.
|
||||
|
||||
--connect (mysql1_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
|
||||
|
||||
--connection mysql1_con
|
||||
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
|
||||
--source include/not_windows.inc
|
||||
|
||||
--connection default
|
||||
|
||||
# Let IM detect that mysqld1 is online. This delay should be longer than
|
||||
# monitoring interval.
|
||||
|
||||
--sleep 2
|
||||
|
||||
# Check that IM understands that mysqld1 is online, while mysqld2 is
|
||||
# offline.
|
||||
|
||||
--replace_result starting XXXXX online XXXXX
|
||||
SHOW INSTANCES;
|
@ -939,6 +939,36 @@ alter table t1 add index(a(1024));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #28570: handler::index_read() is called with different find_flag when
|
||||
# ORDER BY is used
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a INT,
|
||||
b INT,
|
||||
KEY (b)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
|
||||
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 WHERE b=20 FOR UPDATE;
|
||||
|
||||
--connect (conn2, localhost, root,,test)
|
||||
|
||||
# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
|
||||
# restarting transaction" message when the bug is present.
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
|
||||
ROLLBACK;
|
||||
|
||||
--disconnect conn2
|
||||
--connection default
|
||||
|
||||
ROLLBACK;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
|
||||
|
@ -275,5 +275,223 @@ drop table t1;
|
||||
--echo ---- disconnect connection con1 ----
|
||||
disconnect con1;
|
||||
|
||||
#
|
||||
# Bug #25843 Changing default database between PREPARE and EXECUTE of statement
|
||||
# breaks binlog.
|
||||
#
|
||||
# There were actually two problems discovered by this bug:
|
||||
#
|
||||
# 1. Default (current) database is not fixed at the creation time.
|
||||
# That leads to wrong output of DATABASE() function.
|
||||
#
|
||||
# 2. Database attributes (@@collation_database) are not fixed at the creation
|
||||
# time. That leads to wrong resultset.
|
||||
#
|
||||
# Binlog breakage and Query Cache wrong output happened because of the first
|
||||
# problem.
|
||||
#
|
||||
|
||||
--echo ########################################################################
|
||||
--echo #
|
||||
--echo # BUG#25843: Changing default database between PREPARE and EXECUTE of
|
||||
--echo # statement breaks binlog.
|
||||
--echo #
|
||||
--echo ########################################################################
|
||||
|
||||
###############################################################################
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # Check that default database and its attributes are fixed at the
|
||||
--echo # creation time.
|
||||
--echo #
|
||||
|
||||
# Prepare data structures.
|
||||
|
||||
--echo
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest1;
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
--enable_warnings
|
||||
|
||||
--echo
|
||||
CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
|
||||
CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
|
||||
|
||||
--echo
|
||||
CREATE TABLE mysqltest1.t1(msg VARCHAR(255));
|
||||
CREATE TABLE mysqltest2.t1(msg VARCHAR(255));
|
||||
|
||||
# - Create a prepared statement with mysqltest1 as default database;
|
||||
|
||||
--echo
|
||||
|
||||
use mysqltest1;
|
||||
|
||||
PREPARE stmt_a_1 FROM 'INSERT INTO t1 VALUES(DATABASE())';
|
||||
PREPARE stmt_a_2 FROM 'INSERT INTO t1 VALUES(@@collation_database)';
|
||||
|
||||
# - Execute on mysqltest1.
|
||||
|
||||
--echo
|
||||
|
||||
EXECUTE stmt_a_1;
|
||||
EXECUTE stmt_a_2;
|
||||
|
||||
# - Execute on mysqltest2.
|
||||
|
||||
--echo
|
||||
|
||||
use mysqltest2;
|
||||
|
||||
EXECUTE stmt_a_1;
|
||||
EXECUTE stmt_a_2;
|
||||
|
||||
# - Check the results;
|
||||
|
||||
--echo
|
||||
SELECT * FROM mysqltest1.t1;
|
||||
|
||||
--echo
|
||||
SELECT * FROM mysqltest2.t1;
|
||||
|
||||
# - Drop prepared statements.
|
||||
|
||||
--echo
|
||||
DROP PREPARE stmt_a_1;
|
||||
DROP PREPARE stmt_a_2;
|
||||
|
||||
###############################################################################
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # The Query Cache test case.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
DELETE FROM mysqltest1.t1;
|
||||
DELETE FROM mysqltest2.t1;
|
||||
|
||||
--echo
|
||||
INSERT INTO mysqltest1.t1 VALUES('mysqltest1.t1');
|
||||
INSERT INTO mysqltest2.t1 VALUES('mysqltest2.t1');
|
||||
|
||||
--echo
|
||||
use mysqltest1;
|
||||
PREPARE stmt_b_1 FROM 'SELECT * FROM t1';
|
||||
|
||||
--echo
|
||||
use mysqltest2;
|
||||
PREPARE stmt_b_2 FROM 'SELECT * FROM t1';
|
||||
|
||||
--echo
|
||||
EXECUTE stmt_b_1;
|
||||
|
||||
--echo
|
||||
EXECUTE stmt_b_2;
|
||||
|
||||
--echo
|
||||
use mysqltest1;
|
||||
|
||||
--echo
|
||||
EXECUTE stmt_b_1;
|
||||
|
||||
--echo
|
||||
EXECUTE stmt_b_2;
|
||||
|
||||
--echo
|
||||
DROP PREPARE stmt_b_1;
|
||||
DROP PREPARE stmt_b_2;
|
||||
|
||||
# Cleanup.
|
||||
|
||||
--echo
|
||||
use test;
|
||||
|
||||
--echo
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
|
||||
###############################################################################
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # Check that prepared statements work properly when there is no current
|
||||
--echo # database.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
|
||||
CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
|
||||
|
||||
--echo
|
||||
use mysqltest1;
|
||||
|
||||
--echo
|
||||
PREPARE stmt_c_1 FROM 'SELECT DATABASE(), @@collation_database';
|
||||
|
||||
--echo
|
||||
use mysqltest2;
|
||||
|
||||
--echo
|
||||
PREPARE stmt_c_2 FROM 'SELECT DATABASE(), @@collation_database';
|
||||
|
||||
--echo
|
||||
DROP DATABASE mysqltest2;
|
||||
|
||||
--echo
|
||||
SELECT DATABASE(), @@collation_database;
|
||||
|
||||
# -- Here we have: current db: NULL; stmt db: mysqltest1;
|
||||
--echo
|
||||
EXECUTE stmt_c_1;
|
||||
|
||||
--echo
|
||||
SELECT DATABASE(), @@collation_database;
|
||||
|
||||
# -- Here we have: current db: NULL; stmt db: mysqltest2 (non-existent);
|
||||
--echo
|
||||
EXECUTE stmt_c_2;
|
||||
|
||||
--echo
|
||||
SELECT DATABASE(), @@collation_database;
|
||||
|
||||
# -- Create prepared statement, which has no current database.
|
||||
|
||||
--echo
|
||||
PREPARE stmt_c_3 FROM 'SELECT DATABASE(), @@collation_database';
|
||||
|
||||
# -- Here we have: current db: NULL; stmt db: NULL;
|
||||
--echo
|
||||
EXECUTE stmt_c_3;
|
||||
|
||||
--echo
|
||||
use mysqltest1;
|
||||
|
||||
# -- Here we have: current db: mysqltest1; stmt db: mysqltest2 (non-existent);
|
||||
--echo
|
||||
EXECUTE stmt_c_2;
|
||||
|
||||
--echo
|
||||
SELECT DATABASE(), @@collation_database;
|
||||
|
||||
# -- Here we have: current db: mysqltest1; stmt db: NULL;
|
||||
--echo
|
||||
EXECUTE stmt_c_3;
|
||||
|
||||
--echo
|
||||
SELECT DATABASE(), @@collation_database;
|
||||
|
||||
--echo
|
||||
DROP DATABASE mysqltest1;
|
||||
|
||||
--echo
|
||||
use test;
|
||||
|
||||
--echo
|
||||
--echo ########################################################################
|
||||
|
||||
###############################################################################
|
||||
|
||||
set @@global.query_cache_size=@initial_query_cache_size;
|
||||
flush status; # reset Qcache status variables for next tests
|
||||
|
@ -147,4 +147,6 @@ DROP EVENT test.slave_terminate;
|
||||
--echo "Cleanup"
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
|
||||
|
@ -35,7 +35,7 @@ eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
|
||||
--error ER_CANT_FIND_DL_ENTRY
|
||||
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
|
||||
--replace_column 3 UDF_LIB
|
||||
SELECT * FROM mysql.func;
|
||||
SELECT * FROM mysql.func ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
save_master_pos;
|
||||
@ -46,7 +46,7 @@ sync_with_master;
|
||||
--echo "Running on the slave"
|
||||
--enable_info
|
||||
--replace_column 3 UDF_LIB
|
||||
SELECT * FROM mysql.func;
|
||||
SELECT * FROM mysql.func ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
connection master;
|
||||
@ -81,7 +81,7 @@ connection master;
|
||||
--enable_info
|
||||
DROP FUNCTION myfunc_double;
|
||||
DROP FUNCTION myfunc_int;
|
||||
SELECT * FROM mysql.func;
|
||||
SELECT * FROM mysql.func ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
sync_slave_with_master;
|
||||
@ -89,7 +89,7 @@ sync_slave_with_master;
|
||||
# Check to see if the UDFs were dropped on the slave
|
||||
--echo "Running on the slave"
|
||||
--enable_info
|
||||
SELECT * FROM mysql.func;
|
||||
SELECT * FROM mysql.func ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
connection master;
|
||||
@ -108,7 +108,7 @@ DROP TABLE t1;
|
||||
--enable_info
|
||||
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
|
||||
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
sync_slave_with_master;
|
||||
@ -116,7 +116,7 @@ sync_slave_with_master;
|
||||
# Check to see that UDF CREATE statements were replicated
|
||||
--echo "Running on the slave"
|
||||
--enable_info
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
connection master;
|
||||
@ -147,7 +147,7 @@ connection master;
|
||||
--enable_info
|
||||
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
|
||||
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
sync_slave_with_master;
|
||||
@ -155,7 +155,7 @@ sync_slave_with_master;
|
||||
# Check to see if data was replicated
|
||||
--echo "Running on the slave"
|
||||
--enable_info
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||
|
||||
# Check to see that the functions are available for execution on the slave
|
||||
SELECT myfuncsql_int(25);
|
||||
@ -169,7 +169,7 @@ connection master;
|
||||
--enable_info
|
||||
DROP FUNCTION myfuncsql_double;
|
||||
DROP FUNCTION myfuncsql_int;
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
sync_slave_with_master;
|
||||
@ -177,7 +177,7 @@ sync_slave_with_master;
|
||||
# Check to see if the UDFs were dropped on the slave
|
||||
--echo "Running on the slave"
|
||||
--enable_info
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
|
||||
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
|
||||
--disable_info
|
||||
|
||||
connection master;
|
||||
|
40
mysql-test/include/test_fieldsize.inc
Normal file
40
mysql-test/include/test_fieldsize.inc
Normal file
@ -0,0 +1,40 @@
|
||||
#
|
||||
# include/test_fieldsize.inc
|
||||
#
|
||||
# This include file is designed to create a table with one column
|
||||
# whose size on the master is greater than that on the slave. The
|
||||
# test should fail with an error on the slave.
|
||||
#
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
eval $test_table_slave;
|
||||
|
||||
connection master;
|
||||
eval $test_table_master;
|
||||
RESET MASTER;
|
||||
|
||||
eval $test_insert;
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
wait_for_slave_to_stop;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
||||
# The following should be 0
|
||||
SELECT COUNT(*) FROM t1;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
|
||||
connection master;
|
||||
RESET MASTER;
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
@ -17,6 +17,7 @@
|
||||
# let $wait_condition=
|
||||
# SELECT c = 3 FROM t;
|
||||
# --source include/wait_condition.inc
|
||||
# --echo Executed the test condition $wait_condition_reps times
|
||||
#
|
||||
# EXAMPLE
|
||||
# events_bugs.test, events_time_zone.test
|
||||
@ -33,9 +34,13 @@ if ($wait_timeout)
|
||||
# calls, and default will be used instead.
|
||||
let $wait_timeout= 0;
|
||||
|
||||
# Keep track of how many times the wait condition is tested
|
||||
# This is used by some tests (e.g., main.status)
|
||||
let $wait_condition_reps= 0;
|
||||
while ($wait_counter)
|
||||
{
|
||||
let $success= `$wait_condition`;
|
||||
inc $wait_condition_reps;
|
||||
if ($success)
|
||||
{
|
||||
let $wait_counter= 0;
|
||||
|
Reference in New Issue
Block a user