Commit 146a86a2 authored by unknown's avatar unknown

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-rpl


client/Makefile.am:
  Auto merged
mysql-test/r/rpl_ndb_basic.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
parents 4c669601 58d50c88
...@@ -121,11 +121,7 @@ select * from t2; ...@@ -121,11 +121,7 @@ select * from t2;
select * from t3; select * from t3;
let $VERSION=`select version()`; let $VERSION=`select version()`;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
drop table t1,t2,t3; drop table t1,t2,t3;
# #
...@@ -157,10 +153,7 @@ start transaction; ...@@ -157,10 +153,7 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
drop table if exists t1; drop table if exists t1;
# End of 5.0 tests # End of 5.0 tests
...@@ -23,10 +23,7 @@ connection con2; ...@@ -23,10 +23,7 @@ connection con2;
# To be sure that logging has been done, we use a user lock. # To be sure that logging has been done, we use a user lock.
select get_lock("a",10); select get_lock("a",10);
let $VERSION=`select version()`; let $VERSION=`select version()`;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
drop database `drop-temp+table-test`; drop database `drop-temp+table-test`;
# End of 4.1 tests # End of 4.1 tests
...@@ -18,9 +18,7 @@ insert into t1 select * from t2; ...@@ -18,9 +18,7 @@ insert into t1 select * from t2;
# The above should produce an error, but still be in the binlog; # The above should produce an error, but still be in the binlog;
# verify the binlog : # verify the binlog :
let $VERSION=`select version()`; let $VERSION=`select version()`;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
select * from t1; select * from t1;
drop table t1, t2; drop table t1, t2;
...@@ -33,9 +31,7 @@ reset master; ...@@ -33,9 +31,7 @@ reset master;
create table t2(unique(a)) select a from t1; create table t2(unique(a)) select a from t1;
# The above should produce an error, *and* not appear in the binlog # The above should produce an error, *and* not appear in the binlog
let $VERSION=`select version()`; let $VERSION=`select version()`;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
drop table t1; drop table t1;
# End of 4.1 tests # End of 4.1 tests
This diff is collapsed.
...@@ -88,10 +88,7 @@ connection master; ...@@ -88,10 +88,7 @@ connection master;
eval create table t2 (n int)ENGINE=$engine_type; eval create table t2 (n int)ENGINE=$engine_type;
insert into t2 values (1); insert into t2 values (1);
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events;
--replace_result $VERSION VERSION --replace_result $VERSION VERSION
--replace_column 2 # 5 # --replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
...@@ -142,10 +139,7 @@ insert into t1 values (NULL, 1); ...@@ -142,10 +139,7 @@ insert into t1 values (NULL, 1);
reset master; reset master;
set insert_id=5; set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events;
select * from t1; select * from t1;
drop table t1; drop table t1;
......
This diff is collapsed.
...@@ -15,9 +15,7 @@ SELECT * FROM t1 ORDER BY a; ...@@ -15,9 +15,7 @@ SELECT * FROM t1 ORDER BY a;
sync_slave_with_master; sync_slave_with_master;
connection master; connection master;
--replace_result $VERSION VERSION source include/show_binlog_events.inc;
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
sync_slave_with_master; sync_slave_with_master;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
connection master; connection master;
......
...@@ -37,6 +37,4 @@ SELECT * FROM t1; ...@@ -37,6 +37,4 @@ SELECT * FROM t1;
connection master; connection master;
DROP TABLE t1; DROP TABLE t1;
let $SERVER_VERSION=`select version()`; let $SERVER_VERSION=`select version()`;
--replace_result $SERVER_VERSION SERVER_VERSION source include/show_binlog_events.inc;
--replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
...@@ -15,8 +15,7 @@ drop table if exists t1,t2; ...@@ -15,8 +15,7 @@ drop table if exists t1,t2;
eval CREATE TABLE `t1` ( eval CREATE TABLE `t1` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`c` VARCHAR(50) NOT NULL, `c` VARCHAR(50) NOT NULL,
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=$engine_type DEFAULT CHARSET=utf8; ) ENGINE=$engine_type DEFAULT CHARSET=utf8;
...@@ -35,7 +34,7 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name ...@@ -35,7 +34,7 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name
--echo "in the master" --echo "in the master"
--enable_info --enable_info
--replace_column 3 TIMESTAMP --replace_column 3 TIMESTAMP
SELECT * FROM t1; SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
--disable_info --disable_info
sync_slave_with_master; sync_slave_with_master;
...@@ -43,7 +42,7 @@ sync_slave_with_master; ...@@ -43,7 +42,7 @@ sync_slave_with_master;
--echo "in the slave" --echo "in the slave"
--enable_info --enable_info
--replace_column 3 TIMESTAMP --replace_column 3 TIMESTAMP
SELECT * FROM t1; SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
--disable_info --disable_info
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
...@@ -99,6 +98,21 @@ sync_slave_with_master; ...@@ -99,6 +98,21 @@ sync_slave_with_master;
--echo "in the slave" --echo "in the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status
# on CREATE EVENT
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
DO INSERT INTO t1(c) VALUES ('from slave_terminate');
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
DROP EVENT test.slave_terminate;
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate');
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
DROP EVENT test.slave_terminate;
--echo "in the master" --echo "in the master"
connection master; connection master;
DROP TABLE t1; DROP TABLE t1;
......
# include/rpl_stmt_seq.inc ################### include/rpl_stmt_seq.inc ###########################
# # #
# Please be very careful when editing this routine, because the handling of # Check if a given SQL statement (->$my_stmt) / AUTOCOMMIT mode / #
# the $variables is extreme sensitive. # storage engine somehow involved causes COMMIT or ROLLBACK. #
# # #
# #
# The typical test sequence #
# ------------------------- #
# 1. master connection: INSERT without commit #
# check table content of master and slave #
# 2. master connection: EXECUTE the statement #
# check table content of master and slave #
# 3. master connection: ROLLBACK #
# check table content of master and slave #
# 4. flush the logs #
# #
# The variables #
# $show_binlog -- print binlog entries #
# 0 - default + fits to the file with #
# results #
# 1 - useful for debugging #
# This variable is used within #
# include/rpl_stmt_seq.inc. #
# $manipulate -- Manipulation of the binary logs #
# 0 - do nothing #
# 1 - so that the output of SHOW BINLOG #
# EVENTS IN <current log> contains only #
# commands of the current test sequence #
# This is especially useful, if the #
# $show_binlog is set to 1 and many #
# subtest are executed. #
# This variable is used within #
# include/rpl_stmt_seq.inc. #
# have to be set before sourcing this script. #
# #
# Please be very careful when editing this routine, because the #
# handling of the $variables is extreme sensitive. #
# #
########################################################################
############################################################### # Last update:
# Debug options : To debug this test script # 2007-02-12 ML Replace comments via SQL by "--echo ..."
############################################################### #
let $show_binlog= 0;
let $manipulate= 1;
######## The typical test sequence
# 1. INSERT without commit
# check table content of master and slave
# 2. EXECUTE the statement
# check table content of master and slave
# 3. ROLLBACK
# check table content of master and slave
# 4. flush the logs
let $VERSION=`select version()`; let $VERSION=`select version()`;
--disable_query_log --echo
# SELECT '######## new test sequence ########' as ""; --echo ######## $my_stmt ########
eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
--enable_query_log
############################################################### ###############################################################
...@@ -49,11 +70,10 @@ let $_log_num_s= `select @aux`; ...@@ -49,11 +70,10 @@ let $_log_num_s= `select @aux`;
############################################################### ###############################################################
# INSERT # INSERT
############################################################### ###############################################################
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log # Maybe it would be smarter to use a table with an autoincrement column.
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Maybe it would be smarter to use a table with autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ; let $MAX= `SELECT MAX(f1) FROM t1` ;
eval INSERT INTO t1 SET f1= $MAX + 1; eval INSERT INTO t1 SET f1= $MAX + 1;
# results before DDL(to be tested) # results before DDL(to be tested)
...@@ -66,10 +86,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; ...@@ -66,10 +86,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results before DDL(to be tested) # results before DDL(to be tested)
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
...@@ -82,10 +101,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; ...@@ -82,10 +101,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
############################################################### ###############################################################
# command to be tested # command to be tested
############################################################### ###############################################################
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
eval $my_stmt; eval $my_stmt;
# Devaluate $my_stmt, to detect script bugs # Devaluate $my_stmt, to detect script bugs
let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT; let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
...@@ -99,10 +117,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; ...@@ -99,10 +117,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after DDL(to be tested) # results after DDL(to be tested)
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
if ($show_binlog) if ($show_binlog)
...@@ -115,10 +132,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; ...@@ -115,10 +132,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
############################################################### ###############################################################
# ROLLBACK # ROLLBACK
############################################################### ###############################################################
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
ROLLBACK; ROLLBACK;
# results after final ROLLBACK # results after final ROLLBACK
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
...@@ -140,10 +156,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; ...@@ -140,10 +156,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
} }
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after final ROLLBACK # results after final ROLLBACK
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
--disable_query_log --disable_query_log
...@@ -172,19 +187,17 @@ if ($manipulate) ...@@ -172,19 +187,17 @@ if ($manipulate)
# - flush the master and the slave log # - flush the master and the slave log
# ---> both start to write into new logs with incremented number # ---> both start to write into new logs with incremented number
# - increment $_log_num_n # - increment $_log_num_n
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
flush logs; flush logs;
# sleep 1; # sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; # eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master; sync_slave_with_master;
--echo
--echo -------- switch to slave --------
connection slave; connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# the final content of the binary log # the final content of the binary log
flush logs; flush logs;
# The next sleep is urgent needed. # The next sleep is urgent needed.
...@@ -195,7 +208,6 @@ flush logs; ...@@ -195,7 +208,6 @@ flush logs;
inc $_log_num_n; inc $_log_num_n;
} }
--echo
--echo -------- switch to master -------
connection master; connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# include/rpl_stmt_seq.inc
#
# Please be very careful when editing this routine, because the handling of
# the $variables is extreme sensitive.
#
###############################################################
# Debug options : To debug this test script
###############################################################
let $show_binlog= 0;
let $manipulate= 1;
######## The typical test sequence
# 1. INSERT without commit
# check table content of master and slave
# 2. EXECUTE the statement
# check table content of master and slave
# 3. ROLLBACK
# check table content of master and slave
# 4. flush the logs
let $VERSION=`select version()`;
--disable_query_log
# SELECT '######## new test sequence ########' as "";
eval SELECT CONCAT('######## ','$my_stmt',' $engine_type',' ########') as "";
--enable_query_log
###############################################################
# Predict the number of the current log
###############################################################
# Disable the logging of the log number computation.
--disable_query_log
# $_log_num_n should contain the number of the current binlog in numeric style.
# If this routine is called for the first time, $_log_num will not initialized
# and contain the value '' instead of '1'. So we will correct it here.
#
eval set @aux= IF('$_log_num_n' = '', '1', '$_log_num_n');
let $_log_num_n= `SELECT @aux`;
eval set @aux= LPAD('$_log_num_n',6,'0');
# SELECT @aux AS "@aux is";
#
# $_log_num_s should contain the number of the current binlog in string style.
let $_log_num_s= `select @aux`;
# eval SELECT '$log_num' ;
--enable_query_log
###############################################################
# INSERT
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Maybe it would be smarter to use a table with autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ;
eval INSERT INTO t1 SET f1= $MAX + 1;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# command to be tested
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
eval $my_stmt $engine_type;
# Devaluate $my_stmt, to detect script bugs
let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# ROLLBACK
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
ROLLBACK;
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
# Try to detect if the DDL command caused that the INSERT is committed
# $MAX holds the highest/last value just before the insert of MAX + 1
--disable_query_log
eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ',
IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
IF((MAX(f1) = $MAX + 1) XOR NOT $my_master_commit,
' (Succeeded)',
' (Failed)')) AS ""
FROM mysqltest1.t1;
--enable_query_log
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
}
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
--disable_query_log
eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ',
IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
IF((MAX(f1) = $MAX + 1) XOR NOT $my_slave_commit,
' (Succeeded)',
' (Failed)')) AS ""
FROM mysqltest1.t1;
--enable_query_log
if ($show_binlog)
{
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
}
###############################################################
# Manipulate binlog
###############################################################
if ($manipulate)
{
#### Manipulate the binary logs,
# so that the output of SHOW BINLOG EVENTS IN <current log>
# contains only commands of the current test sequence.
# - flush the master and the slave log
# ---> both start to write into new logs with incremented number
# - increment $_log_num_n
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;
connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# the final content of the binary log
flush logs;
# The next sleep is urgent needed.
# Without this sleep the slaves crashes often, when the SHOW BINLOG
# is executed. :-(
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
inc $_log_num_n;
}
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
...@@ -45,6 +45,7 @@ sync_with_master; ...@@ -45,6 +45,7 @@ sync_with_master;
# Check to see that UDF CREATE statements were replicated # Check to see that UDF CREATE statements were replicated
--echo "Running on the slave" --echo "Running on the slave"
--enable_info --enable_info
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func; SELECT * FROM mysql.func;
--disable_info --disable_info
......
--let $binlog_start=106 --let $binlog_start=106
--replace_result $binlog_start <binlog_start> --replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 # --replace_column 2 # 4 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $binlog_start --eval show binlog events from $binlog_start
This diff is collapsed.
...@@ -104,23 +104,22 @@ select * from t2; ...@@ -104,23 +104,22 @@ select * from t2;
a a
select * from t3; select * from t3;
a a
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query 1 # use `test`; drop table t1,t2 master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map 1 # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; alter table t1 add b int
master-bin.000001 # Query 1 # use `test`; alter table t1 add b int master-bin.000001 # Query # # use `test`; alter table t1 drop b
master-bin.000001 # Query 1 # use `test`; alter table t1 drop b master-bin.000001 # Query # # use `test`; create table t3 like t1
master-bin.000001 # Query 1 # use `test`; create table t3 like t1
drop table t1,t2,t3; drop table t1,t2,t3;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE; CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10; DELETE FROM t1 WHERE a=10;
...@@ -143,12 +142,11 @@ start transaction; ...@@ -143,12 +142,11 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query 1 # use `test`; COMMIT
drop table if exists t1; drop table if exists t1;
...@@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; ...@@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2); set @v=convert('abc' using ucs2);
reset master; reset master;
insert into t2 values (@v); insert into t2 values (@v);
show binlog events from 106; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 106 Table_map 1 145 table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 145 Write_rows 1 235 table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
flush logs; flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
......
...@@ -11,8 +11,7 @@ get_lock("a",10) ...@@ -11,8 +11,7 @@ get_lock("a",10)
select get_lock("a",10); select get_lock("a",10);
get_lock("a",10) get_lock("a",10)
1 1
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # create database `drop-temp+table-test`
master-bin.000001 # Query 1 # create database `drop-temp+table-test`
drop database `drop-temp+table-test`; drop database `drop-temp+table-test`;
...@@ -6,7 +6,7 @@ insert into t2 values(1),(2); ...@@ -6,7 +6,7 @@ insert into t2 values(1),(2);
reset master; reset master;
insert into t1 select * from t2; insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 'a' ERROR 23000: Duplicate entry '2' for key 'a'
source include/show_binlog_events.inc; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
...@@ -20,6 +20,6 @@ insert into t1 values(1),(1); ...@@ -20,6 +20,6 @@ insert into t1 values(1),(1);
reset master; reset master;
create table t2(unique(a)) select a from t1; create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 'a' ERROR 23000: Duplicate entry '1' for key 'a'
source include/show_binlog_events.inc; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
drop table t1; drop table t1;
...@@ -26,10 +26,10 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb ...@@ -26,10 +26,10 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; insert t1 values (5) master-bin.000001 # Query # # use `test`; insert t1 values (5)
master-bin.000001 # Xid # # COMMIT /* xid=17 */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; insert t2 values (5) master-bin.000001 # Query # # use `test`; insert t2 values (5)
master-bin.000001 # Xid # # COMMIT /* xid=20 */ master-bin.000001 # Xid # # COMMIT /* XID */
drop table t1,t2; drop table t1,t2;
reset master; reset master;
create table t1 (n int) engine=innodb; create table t1 (n int) engine=innodb;
......
...@@ -104,24 +104,23 @@ select * from t2; ...@@ -104,24 +104,23 @@ select * from t2;
a a
select * from t3; select * from t3;
a a
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query 1 # use `test`; drop table t1,t2 master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # use `test`; delete from t1 where a=10
master-bin.000001 # Query 1 # use `test`; delete from t1 where a=10 master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15
master-bin.000001 # Query 1 # use `test`; update t1 set a=11 where a=15 master-bin.000001 # Query # # use `test`; insert into t1 values(1)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1)
master-bin.000001 # Query 1 # use `test`; insert ignore into t1 values(1) master-bin.000001 # Query # # use `test`; replace into t1 values(100)
master-bin.000001 # Query 1 # use `test`; replace into t1 values(100) master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1 master-bin.000001 # Query # # use `test`; alter table t1 add b int
master-bin.000001 # Query 1 # use `test`; alter table t1 add b int master-bin.000001 # Query # # use `test`; alter table t1 drop b
master-bin.000001 # Query 1 # use `test`; alter table t1 drop b master-bin.000001 # Query # # use `test`; create table t3 like t1
master-bin.000001 # Query 1 # use `test`; create table t3 like t1 master-bin.000001 # Query # # use `test`; insert into t1 select * from t3
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3 master-bin.000001 # Query # # use `test`; replace into t1 select * from t3
master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3
drop table t1,t2,t3; drop table t1,t2,t3;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE; CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10; DELETE FROM t1 WHERE a=10;
...@@ -144,11 +143,10 @@ start transaction; ...@@ -144,11 +143,10 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(1)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query 1 # use `test`; COMMIT
drop table if exists t1; drop table if exists t1;
...@@ -11,12 +11,11 @@ get_lock("a",10) ...@@ -11,12 +11,11 @@ get_lock("a",10)
select get_lock("a",10); select get_lock("a",10);
get_lock("a",10) get_lock("a",10)
1 1
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # create database `drop-temp+table-test`
master-bin.000001 # Query 1 # create database `drop-temp+table-test` master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn1 (a int)
master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn1 (a int) master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table `table:name` (a int)
master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table `table:name` (a int) master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn2 (a int)
master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn2 (a int) master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1`
master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1`
drop database `drop-temp+table-test`; drop database `drop-temp+table-test`;
...@@ -6,10 +6,9 @@ insert into t2 values(1),(2); ...@@ -6,10 +6,9 @@ insert into t2 values(1),(2);
reset master; reset master;
insert into t1 select * from t2; insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 'a' ERROR 23000: Duplicate entry '2' for key 'a'
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query # # use `test`; insert into t1 select * from t2
master-bin.000001 106 Query 1 200 use `test`; insert into t1 select * from t2
select * from t1; select * from t1;
a a
1 1
...@@ -20,7 +19,6 @@ insert into t1 values(1),(1); ...@@ -20,7 +19,6 @@ insert into t1 values(1),(1);
reset master; reset master;
create table t2(unique(a)) select a from t1; create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 'a' ERROR 23000: Duplicate entry '1' for key 'a'
show binlog events; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4
drop table t1; drop table t1;
...@@ -8,9 +8,9 @@ SET @var1= x'8300'; ...@@ -8,9 +8,9 @@ SET @var1= x'8300';
EXECUTE stmt1 USING @var1; EXECUTE stmt1 USING @var1;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
SELECT HEX(f1) FROM t1; SELECT HEX(f1) FROM t1;
HEX(f1) HEX(f1)
8300 8300
......
...@@ -839,6 +839,24 @@ lily ...@@ -839,6 +839,24 @@ lily
river river
drop table t1; drop table t1;
deallocate prepare stmt; deallocate prepare stmt;
set names latin1;
set character_set_connection=ucs2;
select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb')
H000 H4142 I51231
select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb'));
hex(soundex('')) hex(soundex('he')) hex(soundex('hello all folks')) hex(soundex('#3556 in bugdb'))
0048003000300030 00480034003100340032 004900350031003200330031
select 'mood' sounds like 'mud';
'mood' sounds like 'mud'
1
select hex(soundex(_ucs2 0x041004110412));
hex(soundex(_ucs2 0x041004110412))
0410003000300030
select hex(soundex(_ucs2 0x00BF00C0));
hex(soundex(_ucs2 0x00BF00C0))
00C0003000300030
set names latin1;
create table t1(a blob, b text charset utf8, c text charset ucs2); create table t1(a blob, b text charset utf8, c text charset ucs2);
select data_type, character_octet_length, character_maximum_length select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1'; from information_schema.columns where table_name='t1';
......
...@@ -854,6 +854,18 @@ select * from t1 where soundex(a) = soundex('test'); ...@@ -854,6 +854,18 @@ select * from t1 where soundex(a) = soundex('test');
id a id a
1 Test 1 Test
drop table t1; drop table t1;
select soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB);
soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)
阅000
select hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB));
hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB))
E99885303030
select soundex(_utf8 0xD091D092D093);
soundex(_utf8 0xD091D092D093)
Б000
select hex(soundex(_utf8 0xD091D092D093));
hex(soundex(_utf8 0xD091D092D093))
D091303030
SET collation_connection='utf8_general_ci'; SET collation_connection='utf8_general_ci';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
......
...@@ -214,3 +214,12 @@ select count(*) from t1; ...@@ -214,3 +214,12 @@ select count(*) from t1;
count(*) count(*)
0 0
drop table t1; drop table t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
DELETE FROM t1 ORDER BY x;
ERROR 42S22: Unknown column 'x' in 'order clause'
DELETE FROM t1 ORDER BY t2.x;
ERROR 42S22: Unknown column 't2.x' in 'order clause'
DELETE FROM t1 ORDER BY (SELECT x);
ERROR 42S22: Unknown column 'x' in 'field list'
DROP TABLE t1;
...@@ -69,7 +69,7 @@ OK ...@@ -69,7 +69,7 @@ OK
SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL;
IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
OK OK
DROP EVENT start_n_end; DROP EVENT IF EXISTS events_test.start_n_end;
"Already dropped because ended. Therefore an error." "Already dropped because ended. Therefore an error."
DROP EVENT only_one_time; DROP EVENT only_one_time;
ERROR HY000: Unknown event 'only_one_time' ERROR HY000: Unknown event 'only_one_time'
......
...@@ -20,6 +20,14 @@ CREATE TABLE first_db.t1 ( ...@@ -20,6 +20,14 @@ CREATE TABLE first_db.t1 (
`name` varchar(64) NOT NULL default '' `name` varchar(64) NOT NULL default ''
) )
DEFAULT CHARSET=latin1; DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS first_db.t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE first_db.t2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
use second_db; use second_db;
DROP TABLE IF EXISTS second_db.t1; DROP TABLE IF EXISTS second_db.t1;
Warnings: Warnings:
...@@ -29,6 +37,14 @@ CREATE TABLE second_db.t1 ( ...@@ -29,6 +37,14 @@ CREATE TABLE second_db.t1 (
`name` varchar(64) NOT NULL default '' `name` varchar(64) NOT NULL default ''
) )
DEFAULT CHARSET=latin1; DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS second_db.t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE second_db.t2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
drop server if exists 'server_one'; drop server if exists 'server_one';
create server 'server_one' foreign data wrapper 'mysql' options create server 'server_one' foreign data wrapper 'mysql' options
(HOST '127.0.0.1', (HOST '127.0.0.1',
...@@ -60,10 +76,10 @@ CREATE TABLE federated.old ( ...@@ -60,10 +76,10 @@ CREATE TABLE federated.old (
) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/first_db/t1'; CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/first_db/t1';
INSERT INTO federated.old (id, name) values (1, 'federated.old url'); INSERT INTO federated.old (id, name) values (1, 'federated.old-> first_db.t1, url format');
SELECT * FROM federated.old; SELECT * FROM federated.old;
id name id name
1 federated.old url 1 federated.old-> first_db.t1, url format
DROP TABLE IF EXISTS federated.old2; DROP TABLE IF EXISTS federated.old2;
Warnings: Warnings:
Note 1051 Unknown table 'old2' Note 1051 Unknown table 'old2'
...@@ -72,8 +88,37 @@ CREATE TABLE federated.old2 ( ...@@ -72,8 +88,37 @@ CREATE TABLE federated.old2 (
`name` varchar(64) NOT NULL default '' `name` varchar(64) NOT NULL default ''
) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/first_db/t2';
INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format');
SELECT * FROM federated.old2;
id name
1 federated.old2-> first_db.t2, url format
DROP TABLE IF EXISTS federated.urldb2t1;
Warnings:
Note 1051 Unknown table 'urldb2t1'
CREATE TABLE federated.urldb2t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/second_db/t1'; CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/second_db/t1';
INSERT INTO federated.old2 (id, name) values (1, 'federated.old2 url'); INSERT INTO federated.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format');
SELECT * FROM federated.urldb2t1;
id name
1 federated.urldb2t1 -> second_db.t1, url format
DROP TABLE IF EXISTS federated.urldb2t2;
Warnings:
Note 1051 Unknown table 'urldb2t2'
CREATE TABLE federated.urldb2t2 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/second_db/t2';
INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format');
SELECT * FROM federated.urldb2t2;
id name
1 federated.urldb2t2 -> second_db.t2, url format
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 't1'
...@@ -83,18 +128,38 @@ CREATE TABLE federated.t1 ( ...@@ -83,18 +128,38 @@ CREATE TABLE federated.t1 (
) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='server_one'; CONNECTION='server_one';
INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme'); INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme, first_db.t1');
SELECT * FROM federated.t1; SELECT * FROM federated.t1;
id name id name
1 federated.old url 1 federated.old-> first_db.t1, url format
1 server_one, new scheme 1 server_one, new scheme, first_db.t1
DROP TABLE IF EXISTS federated.whatever;
Warnings:
Note 1051 Unknown table 'whatever'
CREATE TABLE federated.whatever (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='server_one/t1';
INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1');
SELECT * FROM federated.whatever;
id name
1 federated.old-> first_db.t1, url format
1 server_one, new scheme, first_db.t1
1 server_one, new scheme, whatever, first_db.t1
ALTER SERVER 'server_one' options(DATABASE 'second_db'); ALTER SERVER 'server_one' options(DATABASE 'second_db');
flush tables; INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1');
INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme');
SELECT * FROM federated.t1; SELECT * FROM federated.t1;
id name id name
1 federated.old2 url 1 federated.urldb2t1 -> second_db.t1, url format
1 server_two, new scheme 1 server_two, new scheme, second_db.t1
INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1');
SELECT * FROM federated.whatever;
id name
1 federated.urldb2t1 -> second_db.t1, url format
1 server_two, new scheme, second_db.t1
1 server_two, new scheme, whatever, second_db.t1
drop table federated.t1; drop table federated.t1;
drop server 'server_one'; drop server 'server_one';
drop server 'server_two'; drop server 'server_two';
...@@ -104,6 +169,116 @@ drop table first_db.t1; ...@@ -104,6 +169,116 @@ drop table first_db.t1;
drop table second_db.t1; drop table second_db.t1;
drop database first_db; drop database first_db;
drop database second_db; drop database second_db;
create database db_legitimate;
create database db_bogus;
use db_legitimate;
CREATE TABLE db_legitimate.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
);
INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate');
use db_bogus;
CREATE TABLE db_bogus.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
)
;
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
USER 'root',
PASSWORD '',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
create user guest_select@localhost;
grant select on federated.* to guest_select@localhost;
create user guest_super@localhost;
grant select,SUPER,RELOAD on *.* to guest_super@localhost;
create user guest_usage@localhost;
grant usage on *.* to guest_usage@localhost;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(64) NOT NULL default ''
) ENGINE = FEDERATED CONNECTION = 's1';
select * from federated.t1;
id name
1 this is legitimate
alter server s1 options (database 'db_bogus');
ERROR 42000: Access denied; you need the SUPER privilege for this operation
flush tables;
select * from federated.t1;
id name
1 this is legitimate
alter server s1 options (database 'db_bogus');
ERROR 42000: Access denied; you need the SUPER privilege for this operation
flush tables;
select * from federated.t1;
id name
1 this is legitimate
alter server s1 options (database 'db_bogus');
flush tables;
select * from federated.t1;
id name
2 this is bogus
drop server if exists 's1';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
USER 'root',
PASSWORD '',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
ERROR 42000: Access denied; you need the SUPER privilege for this operation
drop server 's1';
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
USER 'root',
PASSWORD '',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
flush tables;
select * from federated.t1;
id name
1 this is legitimate
drop database db_legitimate;
drop database db_bogus;
drop user guest_super@localhost;
drop user guest_usage@localhost;
drop user guest_select@localhost;
drop table federated.t1;
drop server 's1';
# End of 5.1 tests
use test;
create procedure p1 ()
begin
DECLARE v INT DEFAULT 0;
DECLARE e INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
WHILE v < 10000 do
CREATE SERVER s
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
ALTER SERVER s OPTIONS (USER 'Remote');
DROP SERVER s;
SET v = v + 1;
END WHILE;
SELECT e > 0;
END//
use test;
call p1();
call p1();
e > 0
1
e > 0
1
drop procedure p1;
drop server if exists s;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated; DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
......
...@@ -734,3 +734,13 @@ f2 group_concat(f1) ...@@ -734,3 +734,13 @@ f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
drop table t1; drop table t1;
CREATE TABLE t1(a TEXT, b CHAR(20));
INSERT INTO t1 VALUES ("one.1","one.1"),("two.2","two.2"),("one.3","one.3");
SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1;
GROUP_CONCAT(DISTINCT UCASE(a))
ONE.1,TWO.2,ONE.3
SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
GROUP_CONCAT(DISTINCT UCASE(b))
ONE.1,TWO.2,ONE.3
DROP TABLE t1;
End of 5.0 tests
...@@ -730,6 +730,12 @@ point(b, b) IS NULL linestring(b) IS NULL polygon(b) IS NULL multipoint(b) IS NU ...@@ -730,6 +730,12 @@ point(b, b) IS NULL linestring(b) IS NULL polygon(b) IS NULL multipoint(b) IS NU
1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 0 1 1 1 1 1 1
drop table t1; drop table t1;
CREATE TABLE t1(a POINT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1;
a
NULL
DROP TABLE t1;
End of 4.1 tests End of 4.1 tests
create table t1 (s1 geometry not null,s2 char(100)); create table t1 (s1 geometry not null,s2 char(100));
create trigger t1_bu before update on t1 for each row set new.s1 = null; create trigger t1_bu before update on t1 for each row set new.s1 = null;
...@@ -764,6 +770,17 @@ create table t1 (g geometry not null); ...@@ -764,6 +770,17 @@ create table t1 (g geometry not null);
insert into t1 values(default); insert into t1 values(default);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1; drop table t1;
CREATE TABLE t1 (a GEOMETRY);
CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1;
CREATE VIEW v2 AS SELECT a FROM t1;
DESCRIBE v1;
Field Type Null Key Default Extra
GeomFromwkb(ASBINARY(a)) geometry YES NULL
DESCRIBE v2;
Field Type Null Key Default Extra
a geometry YES NULL
DROP VIEW v1,v2;
DROP TABLE t1;
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create view v1 as select * from t1; create view v1 as select * from t1;
desc v1; desc v1;
......
...@@ -1141,4 +1141,9 @@ EXPLAIN SELECT 1 FROM t2 WHERE a IN ...@@ -1141,4 +1141,9 @@ EXPLAIN SELECT 1 FROM t2 WHERE a IN
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where
SHOW VARIABLES LIKE 'old';
Variable_name Value
old OFF
SET @@old = off;
ERROR HY000: Variable 'old' is a read only variable
DROP TABLE t1, t2; DROP TABLE t1, t2;
...@@ -280,6 +280,33 @@ a ...@@ -280,6 +280,33 @@ a
1 1
1 1
drop table t1; drop table t1;
CREATE TABLE t1 (
c1 CHAR(3),
c2 INTEGER,
KEY USING BTREE(c1),
KEY USING BTREE(c2)
) ENGINE= MEMORY;
INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0);
UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A';
SELECT * FROM t1;
c1 c2
ABC 0
A 1
B 0
C 0
DROP TABLE t1;
CREATE TABLE t1 (
c1 ENUM('1', '2'),
UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
CREATE TABLE t1 (
c1 SET('1', '2'),
UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory; CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
INSERT INTO t1 VALUES(0); INSERT INTO t1 VALUES(0);
......
...@@ -258,3 +258,81 @@ SELECT LAST_INSERT_ID(); ...@@ -258,3 +258,81 @@ SELECT LAST_INSERT_ID();
LAST_INSERT_ID() LAST_INSERT_ID()
1 1
DROP TABLE t1; DROP TABLE t1;
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
CREATE TABLE `t1` (
`id` int(11) PRIMARY KEY auto_increment,
`f1` varchar(10) NOT NULL UNIQUE
);
INSERT IGNORE INTO t1 (f1) VALUES ("test1")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
INSERT IGNORE INTO t1 (f1) VALUES ("test1")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
SELECT * FROM t1;
id f1
1 test1
INSERT IGNORE INTO t1 (f1) VALUES ("test2")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
SELECT * FROM t1;
id f1
1 test1
2 test2
INSERT IGNORE INTO t1 (f1) VALUES ("test2")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT * FROM t1;
id f1
1 test1
2 test2
INSERT IGNORE INTO t1 (f1) VALUES ("test3")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
3
SELECT * FROM t1;
id f1
1 test1
2 test2
3 test3
DROP TABLE t1;
CREATE TABLE `t1` (
`id` int(11) PRIMARY KEY auto_increment,
`f1` varchar(10) NOT NULL UNIQUE
);
INSERT IGNORE INTO t1 (f1) VALUES ("test1")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
SELECT * FROM t1;
id f1
1 test1
INSERT IGNORE INTO t1 (f1) VALUES ("test1"),("test4")
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
2
SELECT * FROM t1;
id f1
1 test1
2 test4
DROP TABLE t1;
CREATE TABLE `t1` (
`id` int(11) PRIMARY KEY auto_increment,
`f1` varchar(10) NOT NULL UNIQUE,
tim1 timestamp default '2003-01-01 00:00:00' on update current_timestamp
);
INSERT INTO t1 (f1) VALUES ("test1");
SELECT id, f1 FROM t1;
id f1
1 test1
REPLACE INTO t1 VALUES (0,"test1",null);
SELECT id, f1 FROM t1;
id f1
0 test1
DROP TABLE t1;
SET SQL_MODE='';
...@@ -943,6 +943,156 @@ SHOW TABLE STATUS LIKE 't1'; ...@@ -943,6 +943,156 @@ SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Dynamic X X X 72057594037927935 X X X X X X latin1_swedish_ci X max_rows=4100100100 avg_row_length=70100 t1 MyISAM 10 Dynamic X X X 72057594037927935 X X X X X X latin1_swedish_ci X max_rows=4100100100 avg_row_length=70100
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
INSERT INTO t1 VALUES
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
(''), (''), (''), (''),
(' B'), (' B'), (' B'), (' B');
SELECT DISTINCT COUNT(*) FROM t1 WHERE c1 = '';
COUNT(*)
4
SELECT DISTINCT length(c1), c1 FROM t1 WHERE c1 = '';
length(c1) c1
0
SELECT DISTINCT COUNT(*) FROM t1 IGNORE INDEX (c1) WHERE c1 = '';
COUNT(*)
4
SELECT DISTINCT length(c1), c1 FROM t1 IGNORE INDEX (c1) WHERE c1 = '';
length(c1) c1
0
SELECT DISTINCT length(c1), c1 FROM t1 ORDER BY c1;
length(c1) c1
0
2 A
2 B
DROP TABLE t1;
End of 4.1 tests End of 4.1 tests
set storage_engine=MyISAM; set storage_engine=MyISAM;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
......
...@@ -717,6 +717,147 @@ d8c4177d225791924.30714720 ...@@ -717,6 +717,147 @@ d8c4177d225791924.30714720
d8c4177d2380fc201.39666693 d8c4177d2380fc201.39666693
d8c4177d24ccef970.14957924 d8c4177d24ccef970.14957924
DROP TABLE t1; DROP TABLE t1;
create table t1 (
c1 char(10), c2 char(10), c3 char(10), c4 char(10),
c5 char(10), c6 char(10), c7 char(10), c8 char(10),
c9 char(10), c10 char(10), c11 char(10), c12 char(10),
c13 char(10), c14 char(10), c15 char(10), c16 char(10),
index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16)
);
insert into t1 (c1) values ('1'),('1'),('1'),('1');
select * from t1 where
c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC")
and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh",
"abcdefg1", "123456781", "qwertyui1", "asddfg1",
"abcdefg2", "123456782", "qwertyui2", "asddfg2",
"abcdefg3", "123456783", "qwertyui3", "asddfg3",
"abcdefg4", "123456784", "qwertyui4", "asddfg4",
"abcdefg5", "123456785", "qwertyui5", "asddfg5",
"abcdefg6", "123456786", "qwertyui6", "asddfg6",
"abcdefg7", "123456787", "qwertyui7", "asddfg7",
"abcdefg8", "123456788", "qwertyui8", "asddfg8",
"abcdefg9", "123456789", "qwertyui9", "asddfg9",
"abcdefgA", "12345678A", "qwertyuiA", "asddfgA",
"abcdefgB", "12345678B", "qwertyuiB", "asddfgB",
"abcdefgC", "12345678C", "qwertyuiC", "asddfgC");
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16
drop table t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1 ( CREATE TABLE t1 (
id int(11) NOT NULL auto_increment, id int(11) NOT NULL auto_increment,
......
This diff is collapsed.
...@@ -11,8 +11,7 @@ drop table if exists t1,t2; ...@@ -11,8 +11,7 @@ drop table if exists t1,t2;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`c` VARCHAR(50) NOT NULL, `c` VARCHAR(50) NOT NULL,
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 (c) VALUES ('manually'); INSERT INTO t1 (c) VALUES ('manually');
...@@ -22,13 +21,13 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name ...@@ -22,13 +21,13 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name
db name status originator db name status originator
test justonce ENABLED 1 test justonce ENABLED 1
"in the master" "in the master"
SELECT * FROM t1; SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
id c ts id c ts
1 manually TIMESTAMP 1 manually TIMESTAMP
2 from justonce TIMESTAMP 2 from justonce TIMESTAMP
affected rows: 2 affected rows: 2
"in the slave" "in the slave"
SELECT * FROM t1; SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
id c ts id c ts
1 manually TIMESTAMP 1 manually TIMESTAMP
2 from justonce TIMESTAMP 2 from justonce TIMESTAMP
...@@ -69,6 +68,18 @@ db name status originator ...@@ -69,6 +68,18 @@ db name status originator
"in the slave" "in the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator db name status originator
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
DO INSERT INTO t1(c) VALUES ('from slave_terminate');
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
db name status originator
test slave_terminate ENABLED 2
DROP EVENT test.slave_terminate;
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate');
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
db name status originator
test slave_terminate SLAVESIDE_DISABLED 2
DROP EVENT test.slave_terminate;
"in the master" "in the master"
DROP TABLE t1; DROP TABLE t1;
set binlog_format=statement; set binlog_format=statement;
...@@ -77,8 +88,7 @@ drop table if exists t1,t2; ...@@ -77,8 +88,7 @@ drop table if exists t1,t2;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`c` VARCHAR(50) NOT NULL, `c` VARCHAR(50) NOT NULL,
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 (c) VALUES ('manually'); INSERT INTO t1 (c) VALUES ('manually');
...@@ -88,13 +98,13 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name ...@@ -88,13 +98,13 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name
db name status originator db name status originator
test justonce ENABLED 1 test justonce ENABLED 1
"in the master" "in the master"
SELECT * FROM t1; SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
id c ts id c ts
1 manually TIMESTAMP 1 manually TIMESTAMP
2 from justonce TIMESTAMP 2 from justonce TIMESTAMP
affected rows: 2 affected rows: 2
"in the slave" "in the slave"
SELECT * FROM t1; SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
id c ts id c ts
1 manually TIMESTAMP 1 manually TIMESTAMP
2 from justonce TIMESTAMP 2 from justonce TIMESTAMP
...@@ -135,5 +145,17 @@ db name status originator ...@@ -135,5 +145,17 @@ db name status originator
"in the slave" "in the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator db name status originator
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
DO INSERT INTO t1(c) VALUES ('from slave_terminate');
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
db name status originator
test slave_terminate ENABLED 2
DROP EVENT test.slave_terminate;
CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate');
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
db name status originator
test slave_terminate SLAVESIDE_DISABLED 2
DROP EVENT test.slave_terminate;
"in the master" "in the master"
DROP TABLE t1; DROP TABLE t1;
...@@ -12,10 +12,7 @@ a ...@@ -12,10 +12,7 @@ a
1 1
2 2
3 3
SET @saved = @@debug;
SET SESSION debug="d,incident_database_resync_on_replace";
REPLACE INTO t1 VALUES (4); REPLACE INTO t1 VALUES (4);
SET SESSION debug=@saved;
SELECT * FROM t1; SELECT * FROM t1;
a a
1 1
...@@ -47,7 +44,7 @@ Replicate_Do_Table ...@@ -47,7 +44,7 @@ Replicate_Do_Table
Replicate_Ignore_Table Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1583 Last_Errno 1586
Last_Error The incident LOST_EVENTS occured on the master. Message: <none> Last_Error The incident LOST_EVENTS occured on the master. Message: <none>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
......
...@@ -109,39 +109,39 @@ a b ...@@ -109,39 +109,39 @@ a b
1 cp850_general_ci 1 cp850_general_ci
drop database mysqltest2; drop database mysqltest2;
drop database mysqltest3; drop database mysqltest3;
show binlog events from 105; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query # # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3 master-bin.000001 # Query # # drop database if exists mysqltest3
master-bin.000001 # Query 1 # create database mysqltest2 character set latin2 master-bin.000001 # Query # # create database mysqltest2 character set latin2
master-bin.000001 # Query 1 # create database mysqltest3 master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query 1 # drop database mysqltest3 master-bin.000001 # Query # # drop database mysqltest3
master-bin.000001 # Query 1 # create database mysqltest3 master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # drop database mysqltest2 master-bin.000001 # Query # # drop database mysqltest2
master-bin.000001 # Query 1 # drop database mysqltest3 master-bin.000001 # Query # # drop database mysqltest3
select "--- --global--" as ""; select "--- --global--" as "";
--- --global-- --- --global--
......
This diff is collapsed.
This diff is collapsed.
...@@ -26,11 +26,11 @@ stop slave; ...@@ -26,11 +26,11 @@ stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ; FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
105 master-bin1.000001 106 master-bin1.000001
CHANGE MASTER TO CHANGE MASTER TO
master_port=<MASTER_PORT1>, master_port=<MASTER_PORT1>,
master_log_file = 'master-bin1.000001', master_log_file = 'master-bin1.000001',
master_log_pos = 105 ; master_log_pos = 106 ;
start slave; start slave;
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
DELETE FROM t1 WHERE c3 = 1; DELETE FROM t1 WHERE c3 = 1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--loose-debug=+d,incident_database_resync_on_replace
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment