Merge trift2.:/MySQL/M51/mysql-5.1

into  trift2.:/MySQL/M51/push-5.1


configure.in:
  Auto merged
extra/yassl/src/handshake.cpp:
  Auto merged
extra/yassl/src/template_instnt.cpp:
  Auto merged
extra/yassl/src/yassl_imp.cpp:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
storage/ndb/src/common/util/OutputStream.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
  Auto merged
storage/ndb/tools/waiter.cpp:
  Auto merged
This commit is contained in:
unknown 2008-02-22 16:14:27 +01:00
commit 50ba314c98
173 changed files with 8939 additions and 5404 deletions

File diff suppressed because it is too large Load Diff

View File

@ -419,7 +419,9 @@ enum ha_base_keytype {
statement */ statement */
#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to #define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to
illegal data being read */ illegal data being read */
#define HA_ERR_LAST 171 /*Copy last error nr.*/ #define HA_ERR_ROWS_EVENT_APPLY 172 /* The event could not be processed
no other hanlder error happened */
#define HA_ERR_LAST 172 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */ /* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

View File

@ -1,9 +1,6 @@
# Replication of character sets. # Replication of character sets.
# This test will fail if the server/client does not support enough charsets. # This test will fail if the server/client does not support enough charsets.
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc; source include/master-slave.inc;
--disable_warnings --disable_warnings
set timestamp=1000000000; set timestamp=1000000000;
@ -52,14 +49,10 @@ insert into t1 (b) values(@@character_set_client);
# collation_client does not exist # collation_client does not exist
insert into t1 (b) values(@@character_set_connection); insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
--disable_query_log --echo --- --master--
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a; select * from t1 order by a;
sync_slave_with_master; sync_slave_with_master;
--disable_query_log --echo --- --slave--
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a; select * from mysqltest2.t1 order by a;
connection master; connection master;
@ -70,14 +63,10 @@ insert into t1 (b) values(LEAST("M
set collation_connection=latin1_german2_ci; set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler")); insert into t1 (b) values(LEAST("Müller","Muffler"));
--disable_query_log --echo --- --master--
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a; select * from t1 order by a;
sync_slave_with_master; sync_slave_with_master;
--disable_query_log --echo --- --slave--
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a; select * from mysqltest2.t1 order by a;
# Presently charset info is not logged with LOAD DATA but it will # Presently charset info is not logged with LOAD DATA but it will
@ -96,20 +85,15 @@ connection master;
set @a= _cp850 'Müller' collate cp850_general_ci; set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(collation(@a)); insert into t1 (b) values(collation(@a));
--disable_query_log --echo --- --master--
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a; select * from t1 order by a;
sync_slave_with_master; sync_slave_with_master;
--disable_query_log --echo --- --slave--
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a; select * from mysqltest2.t1 order by a;
connection master; connection master;
drop database mysqltest2; drop database mysqltest2;
drop database mysqltest3; drop database mysqltest3;
source include/show_binlog_events.inc;
sync_slave_with_master; sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3) # Check that we can change global.collation_server (since 5.0.3)
@ -153,10 +137,6 @@ sync_slave_with_master;
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
connection master; connection master;
# Let's have a look at generated SETs.
flush logs;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1; drop table t1;
sync_slave_with_master; sync_slave_with_master;

View File

@ -50,17 +50,30 @@ insert into t1 values (1,2);
--echo --echo
connection master; connection master;
# here is actually a bug, since there is no begin statement, the --echo # Now check that that is in the apply_status table is consistant
# query is autocommitted, and end_pos shows end of the insert and not --echo # with what is in the binlog
# end of the commit --echo
--echo # since insert is done with transactional engine, expect a BEGIN
--echo # at <start_pos>
--echo
--replace_result $start_pos <start_pos> --replace_result $start_pos <start_pos>
--replace_column 5 # --replace_column 5 #
--eval show binlog events from $start_pos limit 1 --eval show binlog events from $start_pos limit 1
--echo
--echo # Now the insert, one step after
--echo
--replace_result $start_pos <start_pos>
--replace_column 2 # 5 #
--eval show binlog events from $start_pos limit 1,1
--echo
--echo # and the COMMIT should be at <end_pos>
--echo --echo
--replace_result $start_pos <start_pos> $end_pos <end_pos> --replace_result $start_pos <start_pos> $end_pos <end_pos>
--replace_column 2 # --replace_column 2 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $start_pos limit 1,1 --eval show binlog events from $start_pos limit 2,1
--echo --echo

View File

@ -1,179 +0,0 @@
# Replication of character sets.
# This test will fail if the server/client does not support enough charsets.
--disable_warnings
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
--enable_warnings
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
--disable_query_log
select "--- --master--" as "";
--enable_query_log
show create database mysqltest2;
show create database mysqltest3;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
show create database mysqltest2;
show create database mysqltest3;
connection master;
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;
--disable_query_log
select "--- --master--" as "";
--enable_query_log
show create database mysqltest3;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
show create database mysqltest3;
connection master;
use mysqltest2;
--eval create table t1 (a int auto_increment primary key, b varchar(100))engine=$engine_type;
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
# character_set_database and collation_database are not tested as they
# needn't be replicated (Bar said in Jan 2005).
insert into t1 (b) values(@@character_set_client);
# collation_client does not exist
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--disable_query_log
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
select "--- --muller--" as "";
connection master;
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
--disable_query_log
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
# Presently charset info is not logged with LOAD DATA but it will
# change in Jan 2005 when Dmitri pushes his new LOAD DATA,
# before 5.0.3 goes out. When done, LOAD DATA INFILE should be tested
# here.
# See if user var is prefixed with collation in binlog and replicated well.
# Note: replication of user variables is broken as far as derivation is
# concerned. That's because when we store a user variable in the binlog,
# we lose its derivation. So later on the slave, it's impossible to
# know if the collation was explicit or not, so we use DERIVATION_NONE,
# which provokes error messages (like 'Illegal mix of collation') when
# we replay the master's INSERT/etc statements.
select "--- --INSERT--" as "";
connection master;
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--disable_query_log
select "--- --master--" as "";
--enable_query_log
select * from t1 order by a;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
connection master;
drop database mysqltest2;
drop database mysqltest3;
source include/show_binlog_events.inc;
sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3)
select "--- --global--" as "";
set global character_set_server=latin2;
set global character_set_server=latin1; # back
connection master;
set global character_set_server=latin2;
set global character_set_server=latin1; # back
# Check that SET ONE_SHOT is really one shot
select "--- --oneshot--" as "";
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
select @@character_set_server;
set @@character_set_server=latin5;
select @@character_set_server;
select @@character_set_server;
# ONE_SHOT on not charset/collation stuff is not allowed
-- error 1382
set one_shot max_join_size=10;
# Test of wrong character set numbers;
error 1115;
set character_set_client=9999999;
error 1273;
set collation_server=9999998;
# This one was contributed by Sergey Petrunia (BUG#3943)
select "--- --3943--" as "";
use test;
--eval CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=$engine_type;
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
sync_slave_with_master;
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
connection master;
# Let's have a look at generated SETs.
--replace_result $MYSQLTEST_VARDIR MYSQL_TEST_DIR/var
#--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1;
sync_slave_with_master;
#
# BUG#6676: Derivation of variables must be correct on slave
#
select "--- --6676--" as "";
connection master;
eval create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=$engine_type default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;

View File

@ -46,7 +46,7 @@ ALTER TABLE t1_bit
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test'; ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
# ... and add one non-nullable INT column last in table 't1_text' # ... and add one non-nullable INT column last in table 't1_text'
# with no default, # with no default,
ALTER TABLE t1_nodef ADD x INT NOT NULL; ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
# ... and remove the last column in t2 # ... and remove the last column in t2
ALTER TABLE t2 DROP b; ALTER TABLE t2 DROP b;
# ... change the type of the single column in table 't4' # ... change the type of the single column in table 't4'
@ -222,8 +222,8 @@ sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
connection slave; connection slave;
INSERT INTO t1_nodef VALUES (1,2,3); INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6); INSERT INTO t1_nodef VALUES (2,4,6,8,10);
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;

View File

@ -889,6 +889,7 @@ our @tags=
["include/have_ndb.inc", "ndb_test", 1], ["include/have_ndb.inc", "ndb_test", 1],
["include/have_multi_ndb.inc", "ndb_test", 1], ["include/have_multi_ndb.inc", "ndb_test", 1],
["include/have_ndb_extra.inc", "ndb_extra", 1], ["include/have_ndb_extra.inc", "ndb_extra", 1],
["include/ndb_master-slave.inc", "ndb_test", 1],
["require_manager", "require_manager", 1], ["require_manager", "require_manager", 1],
); );

View File

@ -137,8 +137,11 @@ our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
our @extra_suites= our @extra_suites=
( (
["mysql-5.1-new-ndb", "ndb_team"], ["mysql-5.1-new-ndb", "ndb_team"],
["mysql-5.1-new-ndb-merge", "ndb_team"],
["mysql-5.1-telco-6.2", "ndb_team"], ["mysql-5.1-telco-6.2", "ndb_team"],
["mysql-5.1-telco-6.2-merge", "ndb_team"],
["mysql-5.1-telco-6.3", "ndb_team"], ["mysql-5.1-telco-6.3", "ndb_team"],
["mysql-6.0-ndb", "ndb_team"],
); );
@ -413,14 +416,21 @@ sub main () {
{ {
# use default and add any extra_suites as defined # use default and add any extra_suites as defined
$opt_suites= $opt_suites_default; $opt_suites= $opt_suites_default;
my $ddd= basename(dirname($glob_mysql_test_dir)); my $ccc= dirname($glob_mysql_test_dir);
my $found= 0;
while (!$found and !($ccc eq "/") and !($ccc eq ""))
{
my $ddd= basename($ccc);
foreach my $extra_suite (@extra_suites) foreach my $extra_suite (@extra_suites)
{ {
if ($extra_suite->[0] eq "$ddd") if ($extra_suite->[0] eq "$ddd")
{ {
$opt_suites= "$extra_suite->[1],$opt_suites"; $opt_suites= "$extra_suite->[1],$opt_suites";
$found= 1;
} }
} }
$ccc= dirname($ccc);
}
} }
my $tests= collect_test_cases($opt_suites); my $tests= collect_test_cases($opt_suites);

View File

@ -78,11 +78,6 @@ FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
OK OK
SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
OK
"Already dropped because ended. Therefore an error." "Already dropped because ended. Therefore an error."
DROP EVENT event_3; DROP EVENT event_3;
ERROR HY000: Unknown event 'event_3' ERROR HY000: Unknown event 'event_3'

View File

@ -40,8 +40,13 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
create table t1 (a int) engine= myisam/*!*/; create table t1 (a int) engine= myisam
/*!*/;
# at 203 # at 203
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
==== Test non-matching FD event and Row event ==== ==== Test non-matching FD event and Row event ====
BINLOG ' BINLOG '
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA 4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA

View File

@ -29,6 +29,16 @@ SELECT COUNT(*) FROM t3;
COUNT(*) COUNT(*)
17920 17920
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
==== Read binlog from version 4.1 ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
4 four
190243 random
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t3;
==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a b a b

View File

@ -6,6 +6,10 @@
# See also BUG#32407. # See also BUG#32407.
# BINLOG statement does not work in embedded mode.
source include/not_embedded.inc;
# Test to show BUG#32407. This reads a binlog created with the # Test to show BUG#32407. This reads a binlog created with the
# mysql-5.1-telco-6.1 tree, specifically at the tag # mysql-5.1-telco-6.1 tree, specifically at the tag
# mysql-5.1.15-ndb-6.1.23, and applies it to the database. The test # mysql-5.1.15-ndb-6.1.23, and applies it to the database. The test
@ -15,7 +19,7 @@
# The binlog contains row events equivalent to: # The binlog contains row events equivalent to:
# CREATE TABLE t1 (a int) engine = myisam # CREATE TABLE t1 (a int) engine = myisam
# INSERT INTO t1 VALUES (1), (1) # INSERT INTO t1 VALUES (1), (1)
exec $MYSQL_BINLOG suite/binlog/std_data/binlog-bug32407.000001 | $MYSQL; exec $MYSQL_BINLOG suite/binlog/std_data/bug32407.001 | $MYSQL;
# The above line should succeed and t1 should contain two ones # The above line should succeed and t1 should contain two ones
select * from t1; select * from t1;
@ -68,7 +72,7 @@ select * from t1;
# mysqlbinlog should fail # mysqlbinlog should fail
--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/#/ --replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/#/
error 1; error 1;
exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/binlog-bug32407.000001; exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/bug32407.001;
# the above line should output the query log event and then stop # the above line should output the query log event and then stop
@ -78,7 +82,7 @@ exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/binlog-bug32407.0
--echo ==== Test non-matching FD event and Row event ==== --echo ==== Test non-matching FD event and Row event ====
# This is the Format_description_log_event from # This is the Format_description_log_event from
# binlog-bug32407.000001, encoded in base64. It contains only the old # bug32407.001, encoded in base64. It contains only the old
# row events (number of event types is 22) # row events (number of event types is 22)
BINLOG ' BINLOG '
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA 4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA

View File

@ -39,7 +39,7 @@ connection con2;
reap; reap;
let $rows= `select count(*) from t2 /* must be 2 or 0 */`; let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
--exec $MYSQL_BINLOG --start-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog --exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
@ -250,7 +250,7 @@ source include/show_binlog_events.inc;
# a proof the query is binlogged with an error # a proof the query is binlogged with an error
--exec $MYSQL_BINLOG --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
@ -296,7 +296,7 @@ source include/show_binlog_events.inc;
# a proof the query is binlogged with an error # a proof the query is binlogged with an error
--exec $MYSQL_BINLOG --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))

View File

@ -23,7 +23,7 @@ update t1 set a=2 /* will be "killed" after work has been done */;
#todo: introduce a suite private macro that provides numeric values #todo: introduce a suite private macro that provides numeric values
# for some constants like the offset of the first real event # for some constants like the offset of the first real event
# that is different between severs versions. # that is different between severs versions.
--exec $MYSQL_BINLOG --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
@ -51,7 +51,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "kil
source include/show_binlog_events.inc; source include/show_binlog_events.inc;
--exec $MYSQL_BINLOG --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))

View File

@ -31,7 +31,7 @@ DROP TABLE IF EXISTS t1, t2, t3;
--echo ==== Read modern binlog (version 5.1.23) ==== --echo ==== Read modern binlog (version 5.1.23) ====
# Read binlog. # Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1_23.000001 | $MYSQL --local-infile=1 --exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1_23.001 | $MYSQL --local-infile=1
# Show result. # Show result.
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
@ -43,7 +43,7 @@ DROP TABLE t1, t2, t3;
--echo ==== Read binlog from version 5.1.17 ==== --echo ==== Read binlog from version 5.1.17 ====
# Read binlog. # Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1_17.000001 | $MYSQL --local-infile=1 --exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1_17.001 | $MYSQL --local-infile=1
# Show result. # Show result.
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
@ -52,6 +52,21 @@ SELECT COUNT(*) FROM t3;
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
--echo ==== Read binlog from version 4.1 ====
# In this version, neither row-based binlogging nor Xid events
# existed, so the binlog was generated without the "row-based tests"
# part and the "get xid event" part, and it does not create table t2.
# Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_4_1.000001 | $MYSQL --local-infile=1
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t3;
--echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== --echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
# In this version, it was not possible to switch between row-based and # In this version, it was not possible to switch between row-based and
@ -60,9 +75,9 @@ DROP TABLE t1, t2, t3;
# replication. # replication.
# Read rbr binlog. # Read rbr binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1-wl2325_row.000001 | $MYSQL --local-infile=1 --exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-wl2325_r.001 | $MYSQL --local-infile=1
# Read stm binlog. # Read stm binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1-wl2325_stm.000001 | $MYSQL --local-infile=1 --exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-wl2325_s.001 | $MYSQL --local-infile=1
# Show result. # Show result.
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
@ -74,7 +89,7 @@ DROP TABLE t1, t2, t3;
--echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ==== --echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
# Read binlog. # Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1-telco.000001 | $MYSQL --local-infile=1 --exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-telco.001 | $MYSQL --local-infile=1
# Show resulting tablea. # Show resulting tablea.
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;

View File

@ -10,4 +10,3 @@
# #
############################################################################## ##############################################################################
binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly
binlog_base64_flag : BUG#33247 2007-12-14 Sven: mysqlbinlog does not clean up after itself on termination. When compiled in debug mode, this test generates lots of warnings for memory leaks.

View File

@ -0,0 +1,3 @@
a
b
c

View File

@ -0,0 +1,34 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** On Master ****
CREATE TABLE t1 (b CHAR(10));
**** On Slave ****
STOP SLAVE;
**** On Master ****
LOAD DATA INFILE FILENAME
SELECT COUNT(*) FROM t1;
COUNT(*)
3
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: #
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (b CHAR(10))
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE FILENAME ;file_id=#
**** On Slave ****
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
**** On Master ****
DROP TABLE t1;

View File

@ -0,0 +1,53 @@
# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER
# Date: 01/31/2008
# Added: Serge Kozlov <skozlov@mysql.com>
--source include/master-slave.inc
--connection master
--source include/have_binlog_format_mixed_or_statement.inc
--echo
--echo **** On Master ****
CREATE TABLE t1 (b CHAR(10));
--echo
--echo **** On Slave ****
--sync_slave_with_master
STOP SLAVE;
--source include/wait_for_slave_to_stop.inc
--connection master
--echo
--echo **** On Master ****
--exec cp $MYSQL_TEST_DIR/suite/bugs/data/rpl_bug12691.dat $MYSQLTEST_VARDIR/tmp/
--echo LOAD DATA INFILE FILENAME
--disable_query_log
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE t1 FIELDS TERMINATED BY '|'
--enable_query_log
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat
SELECT COUNT(*) FROM t1;
--replace_column 2 # 5 #
--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /'.+'/FILENAME/
SHOW BINLOG EVENTS;
--save_master_pos
--connection slave
--echo
--echo **** On Slave ****
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
--source include/wait_for_slave_to_start.inc
--sync_with_master
SELECT COUNT(*) FROM t1;
# Clean up
--connection master
--echo
--echo **** On Master ****
DROP TABLE t1;
--sync_slave_with_master

View File

@ -421,10 +421,10 @@ select * from t1 order by a;
a a
1 1
20 20
21
33 33
34 34
35 35
65
insert into t1 values (100); insert into t1 values (100);
insert into t1 values (NULL); insert into t1 values (NULL);
insert into t1 values (NULL); insert into t1 values (NULL);
@ -432,11 +432,11 @@ select * from t1 order by a;
a a
1 1
20 20
21
22
33 33
34 34
35 35
65
66
100 100
101 101
set auto_increment_offset = @old_auto_increment_offset; set auto_increment_offset = @old_auto_increment_offset;

View File

@ -0,0 +1,37 @@
DROP TABLE IF EXISTS t1,t2,t3;
USE test;
CREATE TABLE t1 (
id INT AUTO_INCREMENT,
PRIMARY KEY(id)
) ENGINE=NDBCLUSTER;
CREATE TABLE t2 (
id INT AUTO_INCREMENT,
KEY(id)
) ENGINE=NDBCLUSTER;
ERROR HY000: Can't create table 'test.t2' (errno: 4335)
SHOW TABLES;
Tables_in_test
t1
CREATE TABLE t3 (
id INT AUTO_INCREMENT,
KEY(id)
) ENGINE=MYISAM;
ALTER TABLE t3
ENGINE NDBCLUSTER;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`id` int(11) NOT NULL AUTO_INCREMENT,
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t3
ADD PRIMARY KEY (id);
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t3;
End of 5.1 tests

View File

@ -0,0 +1,98 @@
drop table if exists t1;
create table t1(a int primary key, b int, c int, unique(b)) engine = ndb;
insert into t1 values (2,2,2);
insert into t1 values (3,3,3);
insert into t1 values (4,4,4);
begin;
insert into t1 values (1,1,1);
begin;
update t1 set c = 2 where b = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
rollback;
drop table t1;
create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
insert into t1 values (2,2,2);
insert into t1 values (3,3,3);
insert into t1 values (4,4,4);
begin;
insert into t1 values (1,1,1);
begin;
update t1 set c = 2 where b = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
rollback;
drop table t1;
--con1
create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
insert into t1 values (1,1,1);
insert into t1 values (2,2,2);
insert into t1 values (3,3,3);
insert into t1 values (4,4,4);
begin;
update t1 set c = 10 where a = 1;
update t1 set c = 20 where a = 1;
update t1 set c = 30 where a = 1;
--con1 c=30
select * from t1 where b >= 1 order by b;
a b c
1 1 30
2 2 2
3 3 3
4 4 4
--con2 c=1
select * from t1 where b >= 1 order by b;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
--con1
delete from t1 where a = 1;
--con1 c=none
select * from t1 where b >= 1 order by b;
a b c
2 2 2
3 3 3
4 4 4
--con2 c=1
select * from t1 where b >= 1 order by b;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
--con1
commit;
--con1 c=none
select * from t1 where b >= 1 order by b;
a b c
2 2 2
3 3 3
4 4 4
--con2 c=none
select * from t1 where b >= 1 order by b;
a b c
2 2 2
3 3 3
4 4 4
--con1
begin;
insert into t1 values (1,1,1);
update t1 set c = 10 where a = 1;
update t1 set c = 20 where a = 1;
update t1 set c = 30 where a = 1;
--con1 c=30
select * from t1 where b >= 1 order by b;
a b c
1 1 30
2 2 2
3 3 3
4 4 4
--con2 c=none
select * from t1 where b >= 1 order by b;
a b c
2 2 2
3 3 3
4 4 4
drop table t1;

View File

@ -1904,6 +1904,12 @@ a b d
10 1 4369 10 1 4369
20 2 8738 20 2 8738
50 5 21845 50 5 21845
-- big filter just below limit
a b d
10 1 4369
20 2 8738
50 5 21845
-- big filter just above limit
a b d a b d
10 1 4369 10 1 4369
20 2 8738 20 2 8738

View File

@ -406,6 +406,16 @@ a b c
1 7 7 1 7 7
2 2 2 2 2 2
3 3 3 3 3 3
DELETE FROM t1;
INSERT INTO t1 VALUES (3,'1','1');
BEGIN;
UPDATE t1 SET b = b + 2 WHERE A = 3;
DELETE FROM t1 WHERE A = 3;
INSERT INTO t1 VALUES (3,'0','0');
COMMIT;
SELECT * from t1 ORDER BY 1;
a b c
3 0 0
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a INT NOT NULL PRIMARY KEY, a INT NOT NULL PRIMARY KEY,
@ -501,6 +511,18 @@ f1 f2
111111 aaaaaa 111111 aaaaaa
222222 bbbbbb 222222 bbbbbb
drop table test.t1; drop table test.t1;
CREATE TABLE t1 (
id int unsigned NOT NULL,
c1 int unsigned NOT NULL,
c2 int DEFAULT NULL,
PRIMARY KEY using hash (id),
UNIQUE KEY c1 using hash (c1))
TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster;
insert into t1 values(1, 1, 3);
insert into t1 values(2, 2, 3);
update t1 set c1 = 1 where id = 2;
ERROR 23000: Duplicate entry '1' for key 'c1'
drop table t1;
ALTER TABLESPACE ts1 ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat' DROP DATAFILE 'datafile.dat'
ENGINE = NDB; ENGINE = NDB;

View File

@ -38,6 +38,23 @@ a b c
1 10 3 1 10 3
1 11 3 1 11 3
1 12 3 1 12 3
select max(b) from t1 where a = 1;
max(b)
12
select b from t1 where a = 1 order by b desc;
b
12
11
10
9
8
7
6
5
4
3
2
1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT, CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
PRIMARY KEY (a,b,c) USING HASH) PRIMARY KEY (a,b,c) USING HASH)

View File

@ -46,6 +46,14 @@ a b c
1 1 1 1 1 1
6 1 1 6 1 1
10 1 1 10 1 1
INSERT into t1 values (1, 2, 2);
select max(b) from t1 where a = 1;
max(b)
2
select b from t1 where a = 1 order by b desc;
b
2
1
drop table t1; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int not null, a int not null,

View File

@ -253,21 +253,41 @@ a
2000 2000
3000 3000
10000 10000
show table status like 't1_c'; select max(capgoaledatta) from t1_c;
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 max(capgoaledatta)
X X X X X X X X X X 3001 X X X X X X X 3000
show table status like 't2_c'; select auto_increment from information_schema.tables
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 where table_name = 't1_c';
X X X X X X X X X X 501 X X X X X X X auto_increment
show table status like 't4_c'; 3001
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 select max(capgotod) from t2_c;
X X X X X X X X X X 290000001 X X X X X X X max(capgotod)
show table status like 't7_c'; 500
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 select auto_increment from information_schema.tables
X X X X X X X X X X 29 X X X X X X X where table_name = 't2_c';
show table status like 't10_c'; auto_increment
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 501
X X X X X X X X X X 10001 X X X X X X X select max(capfa) from t4_c;
max(capfa)
290000000
select auto_increment from information_schema.tables
where table_name = 't4_c';
auto_increment
290000001
select max(dardtestard) from t7_c;
max(dardtestard)
28
select auto_increment from information_schema.tables
where table_name = 't7_c';
auto_increment
29
select max(a) from t10_c;
max(a)
10000
select auto_increment from information_schema.tables
where table_name = 't10_c';
auto_increment
10001
ALTER TABLE t7_c ALTER TABLE t7_c
PARTITION BY LINEAR KEY (`dardtestard`); PARTITION BY LINEAR KEY (`dardtestard`);
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;

View File

@ -0,0 +1,45 @@
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
--enable_warnings
USE test;
CREATE TABLE t1 (
id INT AUTO_INCREMENT,
PRIMARY KEY(id)
) ENGINE=NDBCLUSTER;
# Test For bug#30417
--error 1005
CREATE TABLE t2 (
id INT AUTO_INCREMENT,
KEY(id)
) ENGINE=NDBCLUSTER;
SHOW TABLES;
CREATE TABLE t3 (
id INT AUTO_INCREMENT,
KEY(id)
) ENGINE=MYISAM;
--disable_result_log
--error 1005
ALTER TABLE t3
ENGINE NDBCLUSTER;
--enable_result_log
SHOW CREATE TABLE t3;
ALTER TABLE t3
ADD PRIMARY KEY (id);
SHOW CREATE TABLE t3;
DROP TABLE t1, t3;
--echo End of 5.1 tests

View File

@ -0,0 +1,109 @@
--source include/have_ndb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
# setup
connect (con1,localhost,root,,test);
connect (con2,localhost,root,,test);
# unique index
connection con1;
create table t1(a int primary key, b int, c int, unique(b)) engine = ndb;
insert into t1 values (2,2,2);
insert into t1 values (3,3,3);
insert into t1 values (4,4,4);
begin;
insert into t1 values (1,1,1);
connection con2;
begin;
--error 1205
update t1 set c = 2 where b = 1;
rollback;
connection con1;
rollback;
drop table t1;
# ordered index
connection con1;
create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
insert into t1 values (2,2,2);
insert into t1 values (3,3,3);
insert into t1 values (4,4,4);
begin;
insert into t1 values (1,1,1);
connection con2;
begin;
--error 1205
update t1 set c = 2 where b = 1;
rollback;
connection con1;
rollback;
drop table t1;
# multiple versions
--echo --con1
connection con1;
create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
insert into t1 values (1,1,1);
insert into t1 values (2,2,2);
insert into t1 values (3,3,3);
insert into t1 values (4,4,4);
begin;
update t1 set c = 10 where a = 1;
update t1 set c = 20 where a = 1;
update t1 set c = 30 where a = 1;
--echo --con1 c=30
select * from t1 where b >= 1 order by b;
--echo --con2 c=1
connection con2;
select * from t1 where b >= 1 order by b;
--echo --con1
connection con1;
delete from t1 where a = 1;
--echo --con1 c=none
select * from t1 where b >= 1 order by b;
--echo --con2 c=1
connection con2;
select * from t1 where b >= 1 order by b;
--echo --con1
connection con1;
commit;
--echo --con1 c=none
select * from t1 where b >= 1 order by b;
--echo --con2 c=none
connection con2;
select * from t1 where b >= 1 order by b;
--echo --con1
connection con1;
begin;
insert into t1 values (1,1,1);
update t1 set c = 10 where a = 1;
update t1 set c = 20 where a = 1;
update t1 set c = 30 where a = 1;
--echo --con1 c=30
select * from t1 where b >= 1 order by b;
--echo --con2 c=none
connection con2;
select * from t1 where b >= 1 order by b;
# this fails with "no such table" via con2 ???
connection con1;
drop table t1;

View File

@ -1753,6 +1753,7 @@ set engine_condition_pushdown = 1;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
# bug#29390 (scan filter is too large, discarded) # bug#29390 (scan filter is too large, discarded)
# bug#34107 (previous limit was too large for TUP)
drop table t1; drop table t1;
@ -1771,9 +1772,11 @@ select a,b,d from t1
where b in (0,1,2,5) where b in (0,1,2,5)
order by b; order by b;
--echo -- big filter just below limit
--disable_query_log --disable_query_log
select a,b,d from t1 select a,b,d from t1
where b in ( where b in (
0,1,2,5,0,1,2,5,0,1,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
@ -1904,745 +1907,15 @@ select a,b,d from t1
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,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1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, 0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,

View File

@ -346,6 +346,16 @@ UPDATE t1 SET c = '6' WHERE b = '7';
SELECT * FROM t1 ORDER BY 1; SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '7' WHERE c = '6'; UPDATE t1 SET c = '7' WHERE c = '6';
SELECT * FROM t1 ORDER BY 1; SELECT * FROM t1 ORDER BY 1;
DELETE FROM t1;
INSERT INTO t1 VALUES (3,'1','1');
BEGIN;
UPDATE t1 SET b = b + 2 WHERE A = 3;
DELETE FROM t1 WHERE A = 3;
INSERT INTO t1 VALUES (3,'0','0');
COMMIT;
SELECT * from t1 ORDER BY 1;
DROP TABLE t1; DROP TABLE t1;
######################## ########################
@ -439,6 +449,21 @@ select f2 from test.t1 order by f2;
select f1,f2 from test.t1 order by f1; select f1,f2 from test.t1 order by f1;
drop table test.t1; drop table test.t1;
# bug#34118 hash index trigger and do not update any disk attr
CREATE TABLE t1 (
id int unsigned NOT NULL,
c1 int unsigned NOT NULL,
c2 int DEFAULT NULL,
PRIMARY KEY using hash (id),
UNIQUE KEY c1 using hash (c1))
TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster;
insert into t1 values(1, 1, 3);
insert into t1 values(2, 2, 3);
--error ER_DUP_ENTRY
update t1 set c1 = 1 where id = 2;
drop table t1;
################### ###################
# Test Cleanup # Test Cleanup
################### ###################

View File

@ -38,6 +38,10 @@ insert into t1 values
select * from t1 order by b; select * from t1 order by b;
# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
select max(b) from t1 where a = 1;
select b from t1 where a = 1 order by b desc;
DROP TABLE t1; DROP TABLE t1;
# #

View File

@ -48,6 +48,11 @@ select * from t1 where a=21 order by a;
select * from t1 where a in (1,6,10,21) order by a; select * from t1 where a in (1,6,10,21) order by a;
select * from t1 where b=1 and a in (1,6,10,21) order by a; select * from t1 where b=1 and a in (1,6,10,21) order by a;
# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
INSERT into t1 values (1, 2, 2);
select max(b) from t1 where a = 1;
select b from t1 where a = 1 order by b desc;
drop table t1; drop table t1;
# #

View File

@ -246,16 +246,21 @@ select count(*)
select * from t10_c order by a; select * from t10_c order by a;
# Bug #27775 cont'd # Bug #27775 cont'd
# - auto inc info should be correct # - auto inc info should be correct
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X select max(capgoaledatta) from t1_c;
show table status like 't1_c'; select auto_increment from information_schema.tables
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X where table_name = 't1_c';
show table status like 't2_c'; select max(capgotod) from t2_c;
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X select auto_increment from information_schema.tables
show table status like 't4_c'; where table_name = 't2_c';
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X select max(capfa) from t4_c;
show table status like 't7_c'; select auto_increment from information_schema.tables
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X where table_name = 't4_c';
show table status like 't10_c'; select max(dardtestard) from t7_c;
select auto_increment from information_schema.tables
where table_name = 't7_c';
select max(a) from t10_c;
select auto_increment from information_schema.tables
where table_name = 't10_c';
# #
# Try Partitioned tables as well # Try Partitioned tables as well

View File

@ -440,23 +440,21 @@ f1 f2 f3 f4
select * from t4 order by f1; select * from t4 order by f1;
f1 f2 f3 f4 f1 f2 f3 f4
1 1 1 first 1 1 1 first
select * from t31 order by f1; select * from t31 order by f3;
f1 f2 f3 f4 f1 f2 f3 f4
1 1 5 fifth
1 1 3 third
1 1 1 first 1 1 1 first
1 1 6 sixth
1 1 2 second 1 1 2 second
1 1 3 third
1 1 4 fourth 1 1 4 fourth
1 1 5 fifth
1 1 6 sixth
** Do updates master ** ** Do updates master **
update t31 set f5=555555555555555 where f3=6; update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2; update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1; update t31 set f1=NULL where f3=1;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master ** ** Delete from Master **
@ -563,7 +561,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 1534 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
@ -581,7 +579,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno # Last_IO_Errno #
Last_IO_Error # Last_IO_Error #
Last_SQL_Errno 1534 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -638,7 +636,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 1534 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
@ -656,7 +654,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno # Last_IO_Errno #
Last_IO_Error # Last_IO_Error #
Last_SQL_Errno 1534 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -1581,23 +1579,21 @@ f1 f2 f3 f4
select * from t4 order by f1; select * from t4 order by f1;
f1 f2 f3 f4 f1 f2 f3 f4
1 1 1 first 1 1 1 first
select * from t31 order by f1; select * from t31 order by f3;
f1 f2 f3 f4 f1 f2 f3 f4
1 1 5 fifth
1 1 3 third
1 1 1 first 1 1 1 first
1 1 6 sixth
1 1 2 second 1 1 2 second
1 1 3 third
1 1 4 fourth 1 1 4 fourth
1 1 5 fifth
1 1 6 sixth
** Do updates master ** ** Do updates master **
update t31 set f5=555555555555555 where f3=6; update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2; update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1; update t31 set f1=NULL where f3=1;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master ** ** Delete from Master **
@ -1704,7 +1700,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 1534 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
@ -1722,7 +1718,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno # Last_IO_Errno #
Last_IO_Error # Last_IO_Error #
Last_SQL_Errno 1534 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -1779,7 +1775,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 1534 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
@ -1797,7 +1793,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno # Last_IO_Errno #
Last_IO_Error # Last_IO_Error #
Last_SQL_Errno 1534 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;

View File

@ -20,13 +20,27 @@ from mysql.ndb_apply_status;
@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos @log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
<log_name> <start_pos> <end_pos> <log_name> <start_pos> <end_pos>
# Now check that that is in the apply_status table is consistant
# with what is in the binlog
# since insert is done with transactional engine, expect a BEGIN
# at <start_pos>
show binlog events from <start_pos> limit 1; show binlog events from <start_pos> limit 1;
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 <start_pos> Query 1 # use `test`; insert into t1 values (1,2) master-bin.000001 <start_pos> Query 1 # use `test`; BEGIN
# Now the insert, one step after
show binlog events from <start_pos> limit 1,1; show binlog events from <start_pos> limit 1,1;
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 # Xid 1 445 COMMIT /* XID */ master-bin.000001 # Query 1 # use `test`; insert into t1 values (1,2)
# and the COMMIT should be at <end_pos>
show binlog events from <start_pos> limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
begin; begin;
insert into t1 values (2,3); insert into t1 values (2,3);

View File

@ -15,3 +15,6 @@ ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_autodiscover3 : bug#21806 #ndb_autodiscover3 : bug#21806
#ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages #ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages
#rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris
#rpl_ndb_mix_innodb : Bug #32720 Test rpl_ndb_mix_innodb fails on SPARC and PowerPC
#rpl_ndb_dd_advance : Bug #30222 rpl_ndb_dd_advance.test fails

View File

@ -40,14 +40,13 @@ show create database mysqltest3;
Database Create Database Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
use mysqltest2; use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB;; create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci; set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server); insert into t1 (b) values(@@collation_server);
insert into t1 (b) values(@@character_set_client); insert into t1 (b) values(@@character_set_client);
insert into t1 (b) values(@@character_set_connection); insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
--- --master-- --- --master--
select * from t1 order by a; select * from t1 order by a;
a b a b
@ -56,7 +55,6 @@ a b
3 cp850 3 cp850
4 latin2 4 latin2
5 latin2_croatian_ci 5 latin2_croatian_ci
--- --slave-- --- --slave--
select * from mysqltest2.t1 order by a; select * from mysqltest2.t1 order by a;
a b a b
@ -65,9 +63,6 @@ a b
3 cp850 3 cp850
4 latin2 4 latin2
5 latin2_croatian_ci 5 latin2_croatian_ci
select "--- --muller--" as "";
--- --muller--
set character_set_client=latin1, collation_connection=latin1_german1_ci; set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
@ -75,7 +70,6 @@ insert into t1 (b) values(LEAST("M
set collation_connection=latin1_german2_ci; set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler")); insert into t1 (b) values(LEAST("Müller","Muffler"));
--- --master-- --- --master--
select * from t1 order by a; select * from t1 order by a;
a b a b
@ -83,7 +77,6 @@ a b
2 Muffler 2 Muffler
3 latin1_german2_ci 3 latin1_german2_ci
4 Müller 4 Müller
--- --slave-- --- --slave--
select * from mysqltest2.t1 order by a; select * from mysqltest2.t1 order by a;
a b a b
@ -91,65 +84,23 @@ a b
2 Muffler 2 Muffler
3 latin1_german2_ci 3 latin1_german2_ci
4 Müller 4 Müller
select "--- --INSERT--" as "";
--- --INSERT--
set @a= _cp850 'Müller' collate cp850_general_ci; set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(collation(@a)); insert into t1 (b) values(collation(@a));
--- --master-- --- --master--
select * from t1 order by a; select * from t1 order by a;
a b a b
1 cp850_general_ci 1 cp850_general_ci
--- --slave-- --- --slave--
select * from mysqltest2.t1 order by a; select * from mysqltest2.t1 order by a;
a b 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 <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists mysqltest2
master-bin.000001 # Query # # drop database if exists mysqltest3
master-bin.000001 # Query # # create database mysqltest2 character set latin2
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # drop database mysqltest3
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # drop database mysqltest2
master-bin.000001 # Query # # drop database mysqltest3
select "--- --global--" as "";
--- --global--
set global character_set_server=latin2; set global character_set_server=latin2;
set global character_set_server=latin1; set global character_set_server=latin1;
set global character_set_server=latin2; set global character_set_server=latin2;
set global character_set_server=latin1; set global character_set_server=latin1;
select "--- --oneshot--" as "";
--- --oneshot--
set one_shot @@character_set_server=latin5; set one_shot @@character_set_server=latin5;
set @@max_join_size=1000; set @@max_join_size=1000;
select @@character_set_server; select @@character_set_server;
@ -171,31 +122,23 @@ set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999' ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998; set collation_server=9999998;
ERROR HY000: Unknown collation: '9999998' ERROR HY000: Unknown collation: '9999998'
select "--- --3943--" as "";
--- --3943--
use test; use test;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=NDB;; CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r, SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r; CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
hex(c1) hex(c2) hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
hex(c1) hex(c2) hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
drop table t1; drop table t1;
select "--- --6676--" as "";
--- --6676--
create table `t1` ( create table `t1` (
`pk` varchar(10) not null default '', `pk` varchar(10) not null default '',
primary key (`pk`) primary key (`pk`)
) engine=NDB default charset=latin1; ) engine=myisam default charset=latin1;
set @p=_latin1 'test'; set @p=_latin1 'test';
update t1 set pk='test' where pk=@p; update t1 set pk='test' where pk=@p;
drop table t1; drop table t1;

View File

@ -195,9 +195,11 @@ test slave_terminate SLAVESIDE_DISABLED 2
DROP EVENT test.slave_terminate; DROP EVENT test.slave_terminate;
"Cleanup" "Cleanup"
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t28953 (a INT);
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
DO BEGIN DO BEGIN
select * from t1; select * from t28953;
END;| END;|
ALTER EVENT event1 RENAME TO event2; ALTER EVENT event1 RENAME TO event2;
DROP EVENT event2; DROP EVENT event2;
DROP TABLE t28953;

View File

@ -12,13 +12,13 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
select count(*) from t2 /* 5 000 */; select count(*) from t2 /* 5 000 */;
count(*) count(*)
5000 5000
show binlog events in 'master-bin.000002' from 106; show binlog events in 'master-bin.000002' 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.000002 106 Query 1 # use `test`; create table t2 (id int not null primary key auto_increment) master-bin.000002 # Query # # use `test`; create table t2 (id int not null primary key auto_increment)
master-bin.000002 229 Begin_load_query 1 # ;file_id=#;block_len=8192 master-bin.000002 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000002 8444 Append_block 1 # ;file_id=#;block_len=8192 master-bin.000002 # Append_block # # ;file_id=#;block_len=#
master-bin.000002 16659 Append_block 1 # ;file_id=#;block_len=7509 master-bin.000002 # Append_block # # ;file_id=#;block_len=#
master-bin.000002 24191 Execute_load_query 1 # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# master-bin.000002 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=#
select count(*) from t2 /* 5 000 */; select count(*) from t2 /* 5 000 */;
count(*) count(*)
5000 5000

View File

@ -1,203 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
--- --master--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
--- --slave--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;
--- --master--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
--- --slave--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam;;
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
insert into t1 (b) values(@@character_set_client);
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--- --master--
select * from t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
select "--- --muller--" as "";
--- --muller--
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
--- --master--
select * from t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
select "--- --INSERT--" as "";
--- --INSERT--
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--- --master--
select * from t1 order by a;
a b
1 cp850_general_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists mysqltest2
master-bin.000001 # Query # # drop database if exists mysqltest3
master-bin.000001 # Query # # create database mysqltest2 character set latin2
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # drop database mysqltest3
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # drop database mysqltest2
master-bin.000001 # Query # # drop database mysqltest3
select "--- --global--" as "";
--- --global--
set global character_set_server=latin2;
set global character_set_server=latin1;
set global character_set_server=latin2;
set global character_set_server=latin1;
select "--- --oneshot--" as "";
--- --oneshot--
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin1
set @@character_set_server=latin5;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin5
set one_shot max_join_size=10;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
ERROR HY000: Unknown collation: '9999998'
select "--- --3943--" as "";
--- --3943--
use test;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=myisam;;
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
drop table t1;
select "--- --6676--" as "";
--- --6676--
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=myisam default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;

View File

@ -1,227 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
--- --master--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
--- --slave--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;
--- --master--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
--- --slave--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb;;
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
insert into t1 (b) values(@@character_set_client);
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--- --master--
select * from t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
select "--- --muller--" as "";
--- --muller--
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
--- --master--
select * from t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
select "--- --INSERT--" as "";
--- --INSERT--
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--- --master--
select * from t1 order by a;
a b
1 cp850_general_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists mysqltest2
master-bin.000001 # Query # # drop database if exists mysqltest3
master-bin.000001 # Query # # create database mysqltest2 character set latin2
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # drop database mysqltest3
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # drop database mysqltest2
master-bin.000001 # Query # # drop database mysqltest3
select "--- --global--" as "";
--- --global--
set global character_set_server=latin2;
set global character_set_server=latin1;
set global character_set_server=latin2;
set global character_set_server=latin1;
select "--- --oneshot--" as "";
--- --oneshot--
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin1
set @@character_set_server=latin5;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin5
set one_shot max_join_size=10;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
ERROR HY000: Unknown collation: '9999998'
select "--- --3943--" as "";
--- --3943--
use test;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=innodb;;
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
SET SQL_BIG_SELECTS=1;
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
drop table t1;
select "--- --6676--" as "";
--- --6676--
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=innodb default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;

View File

@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101', ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10'; ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test'; ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL; ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
ALTER TABLE t2 DROP b; ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT; ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT; ALTER TABLE t5 MODIFY b FLOAT;
@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4); INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1;
**** On Slave **** **** On Slave ****
INSERT INTO t1_nodef VALUES (1,2,3); INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6); INSERT INTO t1_nodef VALUES (2,4,6,8,10);
**** On Master **** **** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1; UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
@ -403,9 +403,9 @@ a b
2 4 2 4
**** On Slave **** **** On Slave ****
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
a b x a b x y z
1 4 3 1 4 3 4 5
2 4 6 2 4 6 8 10
**** On Master **** **** On Master ****
DELETE FROM t1_nodef WHERE a=2; DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
@ -413,8 +413,8 @@ a b
1 4 1 4
**** On Slave **** **** On Slave ****
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
a b x a b x y z
1 4 3 1 4 3 4 5
**** Cleanup **** **** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef; DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9; DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;

View File

@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101', ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10'; ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test'; ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL; ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
ALTER TABLE t2 DROP b; ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT; ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT; ALTER TABLE t5 MODIFY b FLOAT;
@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4); INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1;
**** On Slave **** **** On Slave ****
INSERT INTO t1_nodef VALUES (1,2,3); INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6); INSERT INTO t1_nodef VALUES (2,4,6,8,10);
**** On Master **** **** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1; UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
@ -403,9 +403,9 @@ a b
2 4 2 4
**** On Slave **** **** On Slave ****
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
a b x a b x y z
1 4 3 1 4 3 4 5
2 4 6 2 4 6 8 10
**** On Master **** **** On Master ****
DELETE FROM t1_nodef WHERE a=2; DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
@ -413,8 +413,8 @@ a b
1 4 1 4
**** On Slave **** **** On Slave ****
SELECT * FROM t1_nodef ORDER BY a; SELECT * FROM t1_nodef ORDER BY a;
a b x a b x y z
1 4 3 1 4 3 4 5
**** Cleanup **** **** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef; DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9; DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;

View File

@ -1,293 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
--- --master--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
--- --slave--
show create database mysqltest2;
Database Create Database
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;
--- --master--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
--- --slave--
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
insert into t1 (b) values(@@character_set_client);
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);
--- --master--
select * from t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 armscii8
2 armscii8_bin
3 cp850
4 latin2
5 latin2_croatian_ci
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Müller","Muffler"));
--- --master--
select * from t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
--- --master--
select * from t1 order by a;
a b
1 cp850_general_ci
--- --slave--
select * from mysqltest2.t1 order by a;
a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # drop database if exists mysqltest2
master-bin.000001 # Query # # drop database if exists mysqltest3
master-bin.000001 # Query # # create database mysqltest2 character set latin2
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # drop database mysqltest3
master-bin.000001 # Query # # create database mysqltest3
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
master-bin.000001 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
master-bin.000001 # Intvar # # INSERT_ID=2
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_server)
master-bin.000001 # Intvar # # INSERT_ID=3
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
master-bin.000001 # Intvar # # INSERT_ID=5
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
master-bin.000001 # Intvar # # INSERT_ID=2
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
master-bin.000001 # Intvar # # INSERT_ID=3
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
master-bin.000001 # Intvar # # INSERT_ID=1
master-bin.000001 # User var # # @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(collation(@a))
master-bin.000001 # Query # # drop database mysqltest2
master-bin.000001 # Query # # drop database mysqltest3
set global character_set_server=latin2;
set global character_set_server=latin1;
set global character_set_server=latin2;
set global character_set_server=latin1;
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin1
set @@character_set_server=latin5;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin5
set one_shot max_join_size=10;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
ERROR HY000: Unknown collation: '9999998'
use test;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
drop database if exists mysqltest2
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
drop database if exists mysqltest3
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
create database mysqltest2 character set latin2
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30/*!*/;
create database mysqltest3
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=64/*!*/;
drop database mysqltest3
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
create database mysqltest3
/*!*/;
use mysqltest2/*!*/;
SET TIMESTAMP=1000000000/*!*/;
create table t1 (a int auto_increment primary key, b varchar(100))
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C cp850 *//*!*/;
SET @@session.character_set_client=4,@@session.collation_connection=27,@@session.collation_server=64/*!*/;
insert into t1 (b) values(@@character_set_server)
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(@@collation_server)
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(@@character_set_client)
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(@@character_set_connection)
/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(@@collation_connection)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=5,@@session.collation_server=64/*!*/;
truncate table t1
/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(@@collation_connection)
/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(LEAST("Müller","Muffler"))
/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=31,@@session.collation_server=64/*!*/;
insert into t1 (b) values(@@collation_connection)
/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(LEAST("Müller","Muffler"))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
truncate table t1
/*!*/;
SET INSERT_ID=1/*!*/;
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 (b) values(collation(@a))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
drop database mysqltest2
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
drop database mysqltest3
/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30/*!*/;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
/*!\C koi8r *//*!*/;
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30/*!*/;
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ')
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t1;
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=myisam default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;

View File

@ -0,0 +1,3 @@
let $engine_type=myisam;
source extra/rpl_tests/rpl_charset.test;

View File

@ -28,10 +28,12 @@ set binlog_format=statement;
connection master; connection master;
CREATE TABLE t28953 (a INT);
DELIMITER |; DELIMITER |;
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
DO BEGIN DO BEGIN
select * from t1; select * from t28953;
END;| END;|
DELIMITER ;| DELIMITER ;|
@ -45,3 +47,9 @@ DROP EVENT event2;
sync_slave_with_master; sync_slave_with_master;
# Doing cleanup of the table referred to in the event to guarantee
# that there is no bad timing cauing it to try to access the table.
connection master;
DROP TABLE t28953;
sync_slave_with_master;

View File

@ -7,6 +7,7 @@
# BUG#33413 show binlog events fails if binlog has event size of close # BUG#33413 show binlog events fails if binlog has event size of close
# to max_allowed_packet # to max_allowed_packet
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc; source include/master-slave.inc;
source include/have_innodb.inc; source include/have_innodb.inc;
source include/have_binlog_format_mixed_or_statement.inc; source include/have_binlog_format_mixed_or_statement.inc;
@ -35,9 +36,9 @@ select count(*) from t2 /* 5 000 */;
# the binglog will show fragmented Append_block events # the binglog will show fragmented Append_block events
--let $binlog_start=106 --let $binlog_start=106
--replace_column 5 # --replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--eval show binlog events in 'master-bin.000002' from $binlog_start --eval show binlog events in 'master-bin.000002' from $binlog_start

View File

@ -1,9 +0,0 @@
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_charset.test

View File

@ -1 +0,0 @@
--innodb

View File

@ -1,10 +0,0 @@
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
# Added to skip if ndb is default #
########################################################
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_row_charset.test

View File

@ -1,2 +0,0 @@
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_stm_charset.test

View File

@ -4,7 +4,14 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SET storage_engine=ndb; set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=INNODB;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--- Start test 1 Basic testing --- --- Start test 1 Basic testing ---
@ -27,7 +34,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave --- --- Show table on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -100,7 +107,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -186,7 +193,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave -- --- Show table on slave --
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -200,7 +207,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -258,7 +265,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -274,7 +281,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -299,11 +306,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
@ -342,7 +349,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave --- --- Show table on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -356,7 +363,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -414,7 +421,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -430,7 +437,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -495,7 +502,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -508,7 +515,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -533,11 +540,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
@ -566,7 +573,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -582,7 +589,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -607,11 +614,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
@ -648,7 +655,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Show that tables on slave --- --- Show that tables on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -663,7 +670,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -720,7 +727,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still right type --- --- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -736,7 +743,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -793,7 +800,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -809,7 +816,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -853,3 +860,4 @@ DELETE FROM t1;
--- End test 5 key partition testing --- --- End test 5 key partition testing ---
--- Do Cleanup --- --- Do Cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;

View File

@ -4,7 +4,14 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SET storage_engine=ndb; set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--- Start test 1 Basic testing --- --- Start test 1 Basic testing ---
@ -186,7 +193,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Show table on slave -- --- Show table on slave --
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -200,7 +207,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -258,7 +265,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -274,7 +281,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -299,11 +306,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
@ -342,7 +349,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Show table on slave --- --- Show table on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -356,7 +363,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -414,7 +421,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -430,7 +437,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -495,7 +502,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -508,7 +515,7 @@ t1 CREATE TABLE `t1` (
`total` bigint(20) unsigned DEFAULT NULL, `total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL `t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -533,11 +540,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
@ -566,7 +573,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -582,7 +589,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date NOT NULL DEFAULT '0000-00-00', `t` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`t`,`id`) PRIMARY KEY (`t`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -607,11 +614,11 @@ UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master --- --- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave --- --- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t id hex(b1) vc bc d f total y t
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master --- --- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42; DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 --- --- Show current count on master for t1 ---
@ -648,7 +655,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Show that tables on slave --- --- Show that tables on slave ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -663,7 +670,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -720,7 +727,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still right type --- --- Make sure that our tables on slave are still right type ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -736,7 +743,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -793,7 +800,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Make sure that our tables on slave are still same engine --- --- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly --- --- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -809,7 +816,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL, `y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL, `t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`) PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
--- Perform basic operation on master --- --- Perform basic operation on master ---
--- and ensure replicated correctly --- --- and ensure replicated correctly ---
"--- Insert into t1 --" as ""; "--- Insert into t1 --" as "";
@ -853,3 +860,4 @@ DELETE FROM t1;
--- End test 5 key partition testing --- --- End test 5 key partition testing ---
--- Do Cleanup --- --- Do Cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;

View File

@ -0,0 +1,400 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
SET storage_engine=ndb;
=== NDB -> NDB ===
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
--- Create Table Section ---
CREATE TABLE t1 (id MEDIUMINT NOT NULL,
b1 INT,
vc VARCHAR(255),
bc CHAR(255),
d DECIMAL(10,4) DEFAULT 0,
f FLOAT DEFAULT 0,
total BIGINT UNSIGNED,
y YEAR,
t DATE,
PRIMARY KEY(id));
--- Show table on master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that simple Alter statements are replicated correctly --
ALTER TABLE t1 DROP PRIMARY KEY;
ALTER TABLE t1 MODIFY vc char(32);
--- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that replication works when slave has more columns than master
ALTER TABLE t1 ADD PRIMARY KEY(id,total);
ALTER TABLE t1 MODIFY vc TEXT;
INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1905-11-14");
INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1965-11-14");
INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1985-11-14");
--- Add columns on slave ---
ALTER TABLE t1 ADD (u int, v char(16) default 'default');
UPDATE t1 SET u=7 WHERE id < 50;
UPDATE t1 SET v='explicit' WHERE id >10;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
`u` int(11) DEFAULT NULL,
`v` char(16) DEFAULT 'default',
PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
SELECT *
FROM t1
ORDER BY id;
id b1 vc bc d f total y t u v
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t u v
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL NULL
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL NULL
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL NULL
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL NULL
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL NULL
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t u v
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL NULL
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL NULL
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL NULL
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Check that replication works when master has more columns than slave
--- Remove columns on slave ---
ALTER TABLE t1 DROP COLUMN v;
ALTER TABLE t1 DROP COLUMN u;
ALTER TABLE t1 DROP COLUMN t;
ALTER TABLE t1 DROP COLUMN y;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;

View File

@ -8,6 +8,14 @@ SET storage_engine=ndb;
=== NDB -> MYISAM === === NDB -> MYISAM ===
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
SET storage_engine=myisam; SET storage_engine=myisam;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
@ -402,6 +410,7 @@ DROP TABLE IF EXISTS t1;
=== NDB -> INNODB === === NDB -> INNODB ===
alter table mysql.ndb_apply_status engine=innodb;
SET storage_engine=innodb; SET storage_engine=innodb;
--- Doing pre test cleanup --- --- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
@ -793,397 +802,4 @@ TRUNCATE TABLE t1;
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
--- Do Cleanup -- --- Do Cleanup --
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
drop table mysql.ndb_apply_status;
=== NDB -> NDB ===
SET storage_engine=ndb;
--- Doing pre test cleanup ---
DROP TABLE IF EXISTS t1;
--- Create Table Section ---
CREATE TABLE t1 (id MEDIUMINT NOT NULL,
b1 INT,
vc VARCHAR(255),
bc CHAR(255),
d DECIMAL(10,4) DEFAULT 0,
f FLOAT DEFAULT 0,
total BIGINT UNSIGNED,
y YEAR,
t DATE,
PRIMARY KEY(id));
--- Show table on master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` varchar(255) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that simple Alter statements are replicated correctly --
ALTER TABLE t1 DROP PRIMARY KEY;
ALTER TABLE t1 MODIFY vc char(32);
--- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` char(32) DEFAULT NULL,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
--- Check that replication works when slave has more columns than master
ALTER TABLE t1 ADD PRIMARY KEY(id,total);
ALTER TABLE t1 MODIFY vc TEXT;
INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1905-11-14");
INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1965-11-14");
INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
'Must make it bug free for the customer',
654321.4321,15.21,0,1965,"1985-11-14");
--- Add columns on slave ---
ALTER TABLE t1 ADD (u int, v char(16) default 'default');
UPDATE t1 SET u=7 WHERE id < 50;
UPDATE t1 SET v='explicit' WHERE id >10;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
`u` int(11) DEFAULT NULL,
`v` char(16) DEFAULT 'default',
PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT *
FROM t1
ORDER BY id;
id b1 vc bc d f total y t u v
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total y t u v
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default
3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default
20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default
50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t u v
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
7
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Check that replication works when master has more columns than slave
--- Remove columns on slave ---
ALTER TABLE t1 DROP COLUMN v;
ALTER TABLE t1 DROP COLUMN u;
ALTER TABLE t1 DROP COLUMN t;
ALTER TABLE t1 DROP COLUMN y;
--- Show changed table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL,
`b1` int(11) DEFAULT NULL,
`vc` text,
`bc` char(255) DEFAULT NULL,
`d` decimal(10,4) DEFAULT '0.0000',
`f` float DEFAULT '0',
`total` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`total`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
--- Populate t1 with data ---
--- Select from t1 on master ---
select *
from t1
order by id;
id b1 vc bc d f total y t
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
--- Select from t1 on slave ---
select *
from t1
order by id;
id b1 vc bc d f total
2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
--- Perform basic operation on master ---
--- and ensure replicated correctly ---
--- Update t1 on master --
UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
WHERE id < 100
ORDER BY id;
--- Check the update on master ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total y t
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
--- Check Update on slave ---
SELECT *
FROM t1
WHERE id < 100
ORDER BY id;
id b1 vc bc d f total
2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 412;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
--- Do Cleanup --
DROP TABLE IF EXISTS t1;

View File

@ -0,0 +1,20 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
*** on slave there should be zero rows ***
select count(*) from mysql.ndb_apply_status;
count(*)
0
create table t1 (a int key, b int) engine ndb;
insert into t1 values (1,1);
*** on master it should be empty ***
select * from mysql.ndb_apply_status;
server_id epoch log_name start_pos end_pos
*** on slave there should be one row ***
select count(*) from mysql.ndb_apply_status;
count(*)
1
drop table t1;

View File

@ -20,13 +20,27 @@ from mysql.ndb_apply_status;
@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos @log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
<log_name> <start_pos> <end_pos> <log_name> <start_pos> <end_pos>
# Now check that that is in the apply_status table is consistant
# with what is in the binlog
# since insert is done with transactional engine, expect a BEGIN
# at <start_pos>
show binlog events from <start_pos> limit 1; show binlog events from <start_pos> limit 1;
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 <start_pos> Query 1 # use `test`; BEGIN master-bin.000001 <start_pos> Query 1 # use `test`; BEGIN
# Now the insert, one step after
show binlog events from <start_pos> limit 1,1; show binlog events from <start_pos> limit 1,1;
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 486 use `test`; insert into t1 values (1,2) master-bin.000001 # Query 1 # use `test`; insert into t1 values (1,2)
# and the COMMIT should be at <end_pos>
show binlog events from <start_pos> limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
begin; begin;
insert into t1 values (2,3); insert into t1 values (2,3);

View File

@ -11,17 +11,5 @@
############################################################################## ##############################################################################
rpl_ndb_2innodb : Bug #32648 Test failure between NDB Cluster and other engines
rpl_ndb_2myisam : Bug #32648 Test failure between NDB Cluster and other engines
rpl_ndb_2other : Bug #32648 Test failure between NDB Cluster and other engines
rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris
rpl_ndb_mix_innodb : Bug #32720 Test rpl_ndb_mix_innodb fails on SPARC and PowerPC
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
rpl_ndb_innodb_trans : Bug#34454: Some test cases from the 'rpl_ndb' suite fail
rpl_ndb_charset : Bug#34454: Some test cases from the 'rpl_ndb' suite fail
rpl_ndb_multi : Bug#34454: Some test cases from the 'rpl_ndb' suite fail

View File

@ -1 +1 @@
--default-storage-engine=ndbcluster --new --default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--innodb --default-storage-engine=innodb --innodb --default-storage-engine=innodb --ndbcluster=0

View File

@ -8,9 +8,20 @@
# test and to have control over the tests. # test and to have control over the tests.
############################################################## ##############################################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_master-slave.inc -- source include/master-slave.inc
connection slave;
-- connection slave
-- source include/have_innodb.inc -- source include/have_innodb.inc
connection master; set @@global.slave_exec_mode= 'IDEMPOTENT';
SET storage_engine=ndb; CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=INNODB;
--source extra/rpl_tests/rpl_ndb_2multi_eng.test --source extra/rpl_tests/rpl_ndb_2multi_eng.test
--connection slave
drop table mysql.ndb_apply_status;

View File

@ -1 +1 @@
--default-storage-engine=ndbcluster --new --default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--default-storage-engine=myisam --default-storage-engine=myisam --ndbcluster=0

View File

@ -8,6 +8,19 @@
# test and to have control over the tests. # test and to have control over the tests.
############################################################## ##############################################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_master-slave.inc -- source include/master-slave.inc
SET storage_engine=ndb;
-- connection slave
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
--source extra/rpl_tests/rpl_ndb_2multi_eng.test --source extra/rpl_tests/rpl_ndb_2multi_eng.test
--connection slave
drop table mysql.ndb_apply_status;

View File

@ -0,0 +1 @@
--default-storage-engine=ndbcluster --log-slave-updates=0

View File

@ -0,0 +1,18 @@
#############################################################
# Author: Rafal Somla
# Date: 2006-08-20
# Purpose: Trying to test ability to replicate from cluster
# to other engines (innodb, myisam), see also rpl_ndb_2other.test
##############################################################
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc
# On master use NDB as storage engine.
connection master;
SET storage_engine=ndb;
--echo
--echo === NDB -> NDB ===
--echo
connection slave;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test

View File

@ -1 +1 @@
--innodb --log-slave-updates=0 --innodb --ndbcluster=0 --log-slave-updates=0

View File

@ -7,7 +7,7 @@
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_binlog_format_mixed_or_row.inc --source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/master-slave.inc
# On master use NDB as storage engine. # On master use NDB as storage engine.
connection master; connection master;
@ -17,6 +17,14 @@ SET storage_engine=ndb;
--echo === NDB -> MYISAM === --echo === NDB -> MYISAM ===
--echo --echo
connection slave; connection slave;
set @@global.slave_exec_mode= 'IDEMPOTENT';
CREATE TABLE mysql.ndb_apply_status
( server_id INT UNSIGNED NOT NULL,
epoch BIGINT UNSIGNED NOT NULL,
log_name VARCHAR(255) BINARY NOT NULL,
start_pos BIGINT UNSIGNED NOT NULL,
end_pos BIGINT UNSIGNED NOT NULL,
PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
SET storage_engine=myisam; SET storage_engine=myisam;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test --source extra/rpl_tests/rpl_ndb_2multi_basic.test
@ -24,12 +32,9 @@ SET storage_engine=myisam;
--echo === NDB -> INNODB === --echo === NDB -> INNODB ===
--echo --echo
connection slave; connection slave;
alter table mysql.ndb_apply_status engine=innodb;
SET storage_engine=innodb; SET storage_engine=innodb;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test --source extra/rpl_tests/rpl_ndb_2multi_basic.test
--echo
--echo === NDB -> NDB ===
--echo
connection slave; connection slave;
SET storage_engine=ndb; drop table mysql.ndb_apply_status;
--source extra/rpl_tests/rpl_ndb_2multi_basic.test

View File

@ -0,0 +1 @@
--replicate_ignore_db=mysql

View File

@ -0,0 +1,26 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_master-slave.inc
#
# Bug#28170 replicate-ignore-db=mysql should not ignore mysql.ndb_apply_status
#
# Slave is started with --replicate-ignore-db=mysql
#
sync_slave_with_master;
echo *** on slave there should be zero rows ***;
select count(*) from mysql.ndb_apply_status;
connection master;
create table t1 (a int key, b int) engine ndb;
insert into t1 values (1,1);
echo *** on master it should be empty ***;
select * from mysql.ndb_apply_status;
sync_slave_with_master;
echo *** on slave there should be one row ***;
select count(*) from mysql.ndb_apply_status;
connection master;
drop table t1;
sync_slave_with_master;

View File

@ -1,8 +0,0 @@
########################################################
# By JBM 2005-02-15 Wrapped to allow reuse of test code#
########################################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_row_charset.test

View File

@ -56,15 +56,12 @@ DELETE FROM t1 WHERE c3 = 2;
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
save_master_pos;
# insert another row, and check that we have it on the slave # insert another row, and check that we have it on the slave
connection server2; connection server2;
INSERT INTO t1 VALUES ("row5","E",5); INSERT INTO t1 VALUES ("row5","E",5);
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
#sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
--sleep 2
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
STOP SLAVE; STOP SLAVE;

View File

@ -10,6 +10,8 @@
# Storage engine to be used in CREATE TABLE # Storage engine to be used in CREATE TABLE
--source include/have_ndb.inc --source include/have_ndb.inc
connection default;
let $engine_type= NDB; let $engine_type= NDB;

View File

@ -76,21 +76,28 @@ let $wait_condition=select count(*) = 0 from information_schema.events
where event_name='event_4' and status='enabled'; where event_name='event_4' and status='enabled';
--source include/wait_condition.inc --source include/wait_condition.inc
# check the data # Wait for the events to fire and check the data afterwards
let $wait_condition=SELECT SUM(a) >= 4 FROM table_1;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1; SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
let $wait_condition=SELECT SUM(a) >= 5 FROM table_2;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2; SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2;
let $wait_condition=SELECT SUM(a) >= 1 FROM table_3;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3; SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
let $wait_condition=SELECT SUM(a) >= 1 FROM table_4;
source include/wait_condition.inc;
SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4; SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4;
SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
FROM INFORMATION_SCHEMA.EVENTS
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
--echo "Already dropped because ended. Therefore an error." --echo "Already dropped because ended. Therefore an error."
--error ER_EVENT_DOES_NOT_EXIST --error ER_EVENT_DOES_NOT_EXIST
DROP EVENT event_3; DROP EVENT event_3;

View File

@ -316,6 +316,10 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbTransaction *trans,
/* /*
Place holder for ha_ndbcluster thread specific data Place holder for ha_ndbcluster thread specific data
*/ */
typedef struct st_thd_ndb_share {
const void *key;
struct Ndb_local_table_statistics stat;
} THD_NDB_SHARE;
static static
uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length, uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length,
my_bool not_used __attribute__((unused))) my_bool not_used __attribute__((unused)))
@ -372,41 +376,6 @@ Thd_ndb::init_open_tables()
my_hash_reset(&open_tables); my_hash_reset(&open_tables);
} }
THD_NDB_SHARE *
Thd_ndb::get_open_table(THD *thd, const void *key)
{
DBUG_ENTER("Thd_ndb::get_open_table");
HASH_SEARCH_STATE state;
THD_NDB_SHARE *thd_ndb_share=
(THD_NDB_SHARE*)hash_first(&open_tables, (uchar *)&key, sizeof(key), &state);
while (thd_ndb_share && thd_ndb_share->key != key)
thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (uchar *)&key, sizeof(key), &state);
if (thd_ndb_share == 0)
{
thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root,
sizeof(THD_NDB_SHARE));
if (!thd_ndb_share)
{
mem_alloc_error(sizeof(THD_NDB_SHARE));
DBUG_RETURN(NULL);
}
thd_ndb_share->key= key;
thd_ndb_share->stat.last_count= count;
thd_ndb_share->stat.no_uncommitted_rows_count= 0;
thd_ndb_share->stat.records= ~(ha_rows)0;
my_hash_insert(&open_tables, (uchar *)thd_ndb_share);
}
else if (thd_ndb_share->stat.last_count != count)
{
thd_ndb_share->stat.last_count= count;
thd_ndb_share->stat.no_uncommitted_rows_count= 0;
thd_ndb_share->stat.records= ~(ha_rows)0;
}
DBUG_PRINT("exit", ("thd_ndb_share: 0x%lx key: 0x%lx",
(long) thd_ndb_share, (long) key));
DBUG_RETURN(thd_ndb_share);
}
inline inline
Ndb *ha_ndbcluster::get_ndb() Ndb *ha_ndbcluster::get_ndb()
{ {
@ -2742,10 +2711,13 @@ ha_ndbcluster::set_auto_inc(Field *field)
("Trying to set next auto increment value to %s", ("Trying to set next auto increment value to %s",
llstr(next_val, buff))); llstr(next_val, buff)));
#endif #endif
if (ndb->checkUpdateAutoIncrementValue(m_share->tuple_id_range, next_val))
{
Ndb_tuple_id_range_guard g(m_share); Ndb_tuple_id_range_guard g(m_share);
if (ndb->setAutoIncrementValue(m_table, g.range, next_val, TRUE) if (ndb->setAutoIncrementValue(m_table, g.range, next_val, TRUE)
== -1) == -1)
ERR_RETURN(ndb->getNdbError()); ERR_RETURN(ndb->getNdbError());
}
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@ -4554,12 +4526,48 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb)
thd_ndb->trans_options|= TNTO_INJECTED_APPLY_STATUS; thd_ndb->trans_options|= TNTO_INJECTED_APPLY_STATUS;
} }
#endif #endif
// TODO remove double pointers...
if (!(m_thd_ndb_share= thd_ndb->get_open_table(thd, m_table))) if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{ {
const void *key= m_table;
HASH_SEARCH_STATE state;
THD_NDB_SHARE *thd_ndb_share=
(THD_NDB_SHARE*)hash_first(&thd_ndb->open_tables, (uchar *)&key, sizeof(key), &state);
while (thd_ndb_share && thd_ndb_share->key != key)
thd_ndb_share= (THD_NDB_SHARE*)hash_next(&thd_ndb->open_tables, (uchar *)&key, sizeof(key), &state);
if (thd_ndb_share == 0)
{
thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root,
sizeof(THD_NDB_SHARE));
if (!thd_ndb_share)
{
mem_alloc_error(sizeof(THD_NDB_SHARE));
DBUG_RETURN(1); DBUG_RETURN(1);
} }
m_table_info= &m_thd_ndb_share->stat; thd_ndb_share->key= key;
thd_ndb_share->stat.last_count= thd_ndb->count;
thd_ndb_share->stat.no_uncommitted_rows_count= 0;
thd_ndb_share->stat.records= ~(ha_rows)0;
my_hash_insert(&thd_ndb->open_tables, (uchar *)thd_ndb_share);
}
else if (thd_ndb_share->stat.last_count != thd_ndb->count)
{
thd_ndb_share->stat.last_count= thd_ndb->count;
thd_ndb_share->stat.no_uncommitted_rows_count= 0;
thd_ndb_share->stat.records= ~(ha_rows)0;
}
DBUG_PRINT("exit", ("thd_ndb_share: 0x%lx key: 0x%lx",
(long) thd_ndb_share, (long) key));
m_table_info= &thd_ndb_share->stat;
}
else
{
struct Ndb_local_table_statistics &stat= m_table_info_instance;
stat.last_count= thd_ndb->count;
stat.no_uncommitted_rows_count= 0;
stat.records= ~(ha_rows)0;
m_table_info= &stat;
}
DBUG_RETURN(0); DBUG_RETURN(0);
} }

View File

@ -195,11 +195,6 @@ struct Ndb_local_table_statistics {
ha_rows records; ha_rows records;
}; };
typedef struct st_thd_ndb_share {
const void *key;
struct Ndb_local_table_statistics stat;
} THD_NDB_SHARE;
class Thd_ndb class Thd_ndb
{ {
public: public:
@ -207,7 +202,6 @@ class Thd_ndb
~Thd_ndb(); ~Thd_ndb();
void init_open_tables(); void init_open_tables();
THD_NDB_SHARE *get_open_table(THD *thd, const void *key);
Ndb *ndb; Ndb *ndb;
ulong count; ulong count;
@ -514,6 +508,7 @@ private:
NdbScanOperation *m_active_cursor; NdbScanOperation *m_active_cursor;
const NdbDictionary::Table *m_table; const NdbDictionary::Table *m_table;
struct Ndb_local_table_statistics *m_table_info; struct Ndb_local_table_statistics *m_table_info;
struct Ndb_local_table_statistics m_table_info_instance;
char m_dbname[FN_HEADLEN]; char m_dbname[FN_HEADLEN];
//char m_schemaname[FN_HEADLEN]; //char m_schemaname[FN_HEADLEN];
char m_tabname[FN_HEADLEN]; char m_tabname[FN_HEADLEN];
@ -522,7 +517,6 @@ private:
bool m_lock_tuple; bool m_lock_tuple;
NDB_SHARE *m_share; NDB_SHARE *m_share;
NDB_INDEX_DATA m_index[MAX_KEY]; NDB_INDEX_DATA m_index[MAX_KEY];
THD_NDB_SHARE *m_thd_ndb_share;
// NdbRecAttr has no reference to blob // NdbRecAttr has no reference to blob
NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE]; NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE];
uchar m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH]; uchar m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH];

View File

@ -683,6 +683,18 @@ static void ndbcluster_reset_slave(THD *thd)
/* /*
Initialize the binlog part of the ndb handlerton Initialize the binlog part of the ndb handlerton
*/ */
/**
Upon the sql command flush logs, we need to ensure that all outstanding
ndb data to be logged has made it to the binary log to get a deterministic
behavior on the rotation of the log.
*/
static bool ndbcluster_flush_logs(handlerton *hton)
{
ndbcluster_binlog_wait(current_thd);
return FALSE;
}
static int ndbcluster_binlog_func(handlerton *hton, THD *thd, static int ndbcluster_binlog_func(handlerton *hton, THD *thd,
enum_binlog_func fn, enum_binlog_func fn,
void *arg) void *arg)
@ -711,6 +723,7 @@ static int ndbcluster_binlog_func(handlerton *hton, THD *thd,
void ndbcluster_binlog_init_handlerton() void ndbcluster_binlog_init_handlerton()
{ {
handlerton *h= ndbcluster_hton; handlerton *h= ndbcluster_hton;
h->flush_logs= ndbcluster_flush_logs;
h->binlog_func= ndbcluster_binlog_func; h->binlog_func= ndbcluster_binlog_func;
h->binlog_log_query= ndbcluster_binlog_log_query; h->binlog_log_query= ndbcluster_binlog_log_query;
} }

View File

@ -99,12 +99,23 @@ static const char *HA_ERR(int i)
case HA_ERR_RECORD_IS_THE_SAME: return "HA_ERR_RECORD_IS_THE_SAME"; case HA_ERR_RECORD_IS_THE_SAME: return "HA_ERR_RECORD_IS_THE_SAME";
case HA_ERR_LOGGING_IMPOSSIBLE: return "HA_ERR_LOGGING_IMPOSSIBLE"; case HA_ERR_LOGGING_IMPOSSIBLE: return "HA_ERR_LOGGING_IMPOSSIBLE";
case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT"; case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT";
case HA_ERR_ROWS_EVENT_APPLY : return "HA_ERR_ROWS_EVENT_APPLY";
} }
return 0; return 0;
} }
/** /**
macro to call from different branches of Rows_log_event::do_apply_event Error reporting facility for Rows_log_event::do_apply_event
@param level error, warning or info
@param ha_error HA_ERR_ code
@param rli pointer to the active Relay_log_info instance
@param thd pointer to the slave thread's thd
@param table pointer to the event's table object
@param type the type of the event
@param log_name the master binlog file name
@param pos the master binlog file pos (the next after the event)
*/ */
static void inline slave_rows_error_report(enum loglevel level, int ha_error, static void inline slave_rows_error_report(enum loglevel level, int ha_error,
Relay_log_info const *rli, THD *thd, Relay_log_info const *rli, THD *thd,
@ -112,14 +123,27 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
const char *log_name, ulong pos) const char *log_name, ulong pos)
{ {
const char *handler_error= HA_ERR(ha_error); const char *handler_error= HA_ERR(ha_error);
char buff[MAX_SLAVE_ERRMSG], *slider;
const char *buff_end= buff + sizeof(buff);
uint len;
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
MYSQL_ERROR *err;
buff[0]= 0;
for (err= it++, slider= buff; err && slider < buff_end - 1;
slider += len, err= it++)
{
len= my_snprintf(slider, buff_end - slider,
" %s, Error_code: %d;", err->msg, err->code);
}
rli->report(level, thd->net.client_last_errno, rli->report(level, thd->net.client_last_errno,
"Could not execute %s event on table %s.%s;" "Could not execute %s event on table %s.%s;"
"%s%s handler error %s; " "%s handler error %s; "
"the event's master log %s, end_log_pos %lu", "the event's master log %s, end_log_pos %lu",
type, table->s->db.str, type, table->s->db.str,
table->s->table_name.str, table->s->table_name.str,
thd->net.client_last_error[0] != 0 ? thd->net.client_last_error : "", buff,
thd->net.client_last_error[0] != 0 ? ";" : "",
handler_error == NULL? "<unknown>" : handler_error, handler_error == NULL? "<unknown>" : handler_error,
log_name, pos); log_name, pos);
} }
@ -212,9 +236,9 @@ uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation
*/ */
#ifdef MYSQL_CLIENT #ifdef MYSQL_CLIENT
static void pretty_print_str(IO_CACHE* cache, char* str, int len) static void pretty_print_str(IO_CACHE* cache, const char* str, int len)
{ {
char* end = str + len; const char* end = str + len;
my_b_printf(cache, "\'"); my_b_printf(cache, "\'");
while (str < end) while (str < end)
{ {
@ -277,9 +301,9 @@ inline int ignored_error_code(int err_code)
*/ */
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
static char *pretty_print_str(char *packet, char *str, int len) static char *pretty_print_str(char *packet, const char *str, int len)
{ {
char *end= str + len; const char *end= str + len;
char *pos= packet; char *pos= packet;
*pos++= '\''; *pos++= '\'';
while (str < end) while (str < end)
@ -385,7 +409,7 @@ static void cleanup_load_tmpdir()
write_str() write_str()
*/ */
static bool write_str(IO_CACHE *file, char *str, uint length) static bool write_str(IO_CACHE *file, const char *str, uint length)
{ {
uchar tmp[1]; uchar tmp[1];
tmp[0]= (uchar) length; tmp[0]= (uchar) length;
@ -2957,18 +2981,63 @@ Format_description_log_event(const char* buf,
If post_header_len is null, it means malloc failed, and is_valid If post_header_len is null, it means malloc failed, and is_valid
will fail, so there is no need to do anything. will fail, so there is no need to do anything.
The trees which have wrong event id's are: The trees in which events have wrong id's are:
mysql-5.1-wl2325-5.0-drop6p13-alpha, mysql-5.1-wl2325-5.0-drop6,
mysql-5.1-wl2325-5.0, mysql-5.1-wl2325-no-dd (`grep -C2 mysql-5.1-wl1012.old mysql-5.1-wl2325-5.0-drop6p13-alpha
BEGIN_LOAD_QUERY_EVENT /home/bk/ * /sql/log_event.h`). The mysql-5.1-wl2325-5.0-drop6 mysql-5.1-wl2325-5.0
corresponding version (`grep mysql, configure.in` in those trees) mysql-5.1-wl2325-no-dd
strings are 5.2.2-a_drop6p13-alpha, 5.2.2-a_drop6p13c,
5.1.5-a_drop5p20, 5.1.2-a_drop5p5. (this was found by grepping for two lines in sequence where the
first matches "FORMAT_DESCRIPTION_EVENT," and the second matches
"TABLE_MAP_EVENT," in log_event.h in all trees)
In these trees, the following server_versions existed since
TABLE_MAP_EVENT was introduced:
5.1.1-a_drop5p3 5.1.1-a_drop5p4 5.1.1-alpha
5.1.2-a_drop5p10 5.1.2-a_drop5p11 5.1.2-a_drop5p12
5.1.2-a_drop5p13 5.1.2-a_drop5p14 5.1.2-a_drop5p15
5.1.2-a_drop5p16 5.1.2-a_drop5p16b 5.1.2-a_drop5p16c
5.1.2-a_drop5p17 5.1.2-a_drop5p4 5.1.2-a_drop5p5
5.1.2-a_drop5p6 5.1.2-a_drop5p7 5.1.2-a_drop5p8
5.1.2-a_drop5p9 5.1.3-a_drop5p17 5.1.3-a_drop5p17b
5.1.3-a_drop5p17c 5.1.4-a_drop5p18 5.1.4-a_drop5p19
5.1.4-a_drop5p20 5.1.4-a_drop6p0 5.1.4-a_drop6p1
5.1.4-a_drop6p2 5.1.5-a_drop5p20 5.2.0-a_drop6p3
5.2.0-a_drop6p4 5.2.0-a_drop6p5 5.2.0-a_drop6p6
5.2.1-a_drop6p10 5.2.1-a_drop6p11 5.2.1-a_drop6p12
5.2.1-a_drop6p6 5.2.1-a_drop6p7 5.2.1-a_drop6p8
5.2.2-a_drop6p13 5.2.2-a_drop6p13-alpha 5.2.2-a_drop6p13b
5.2.2-a_drop6p13c
(this was found by grepping for "mysql," in all historical
versions of configure.in in the trees listed above).
There are 5.1.1-alpha versions that use the new event id's, so we
do not test that version string. So replication from 5.1.1-alpha
with the other event id's to a new version does not work.
Moreover, we can safely ignore the part after drop[56]. This
allows us to simplify the big list above to the following regexes:
5\.1\.[1-5]-a_drop5.*
5\.1\.4-a_drop6.*
5\.2\.[0-2]-a_drop6.*
This is what we test for in the 'if' below.
*/ */
if (post_header_len && if (post_header_len &&
(strncmp(server_version, "5.1.2-a_drop5", 13) == 0 || server_version[0] == '5' && server_version[1] == '.' &&
strncmp(server_version, "5.1.5-a_drop5", 13) == 0 || server_version[3] == '.' &&
strncmp(server_version, "5.2.2-a_drop6", 13) == 0)) strncmp(server_version + 5, "-a_drop", 7) == 0 &&
((server_version[2] == '1' &&
server_version[4] >= '1' && server_version[4] <= '5' &&
server_version[12] == '5') ||
(server_version[2] == '1' &&
server_version[4] == '4' &&
server_version[12] == '6') ||
(server_version[2] == '2' &&
server_version[4] >= '0' && server_version[4] <= '2' &&
server_version[12] == '6')))
{ {
if (number_of_event_types != 22) if (number_of_event_types != 22)
{ {
@ -6026,7 +6095,8 @@ bool sql_ex_info::write_data(IO_CACHE* file)
sql_ex_info::init() sql_ex_info::init()
*/ */
char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format) const char *sql_ex_info::init(const char *buf, const char *buf_end,
bool use_new_format)
{ {
cached_new_format = use_new_format; cached_new_format = use_new_format;
if (use_new_format) if (use_new_format)
@ -6039,12 +6109,11 @@ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format)
the case when we have old format because we will be reusing net buffer the case when we have old format because we will be reusing net buffer
to read the actual file before we write out the Create_file event. to read the actual file before we write out the Create_file event.
*/ */
const char *ptr= buf; if (read_str(&buf, buf_end, &field_term, &field_term_len) ||
if (read_str(&ptr, buf_end, (const char **) &field_term, &field_term_len) || read_str(&buf, buf_end, &enclosed, &enclosed_len) ||
read_str(&ptr, buf_end, (const char **) &enclosed, &enclosed_len) || read_str(&buf, buf_end, &line_term, &line_term_len) ||
read_str(&ptr, buf_end, (const char **) &line_term, &line_term_len) || read_str(&buf, buf_end, &line_start, &line_start_len) ||
read_str(&ptr, buf_end, (const char **) &line_start, &line_start_len) || read_str(&buf, buf_end, &escaped, &escaped_len))
read_str(&ptr, buf_end, (const char **) &escaped, &escaped_len))
return 0; return 0;
opt_flags = *buf++; opt_flags = *buf++;
} }
@ -7646,7 +7715,7 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
/* fill table->record[0] with default values */ /* fill table->record[0] with default values */
if ((error= prepare_record(rli, table, m_width, if ((error= prepare_record(table, m_width,
TRUE /* check if columns have def. values */))) TRUE /* check if columns have def. values */)))
DBUG_RETURN(error); DBUG_RETURN(error);
@ -7964,12 +8033,16 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_ASSERT(m_table && m_table->in_use != NULL); DBUG_ASSERT(m_table && m_table->in_use != NULL);
TABLE *table= m_table; TABLE *table= m_table;
int error; int error= 0;
/* unpack row - missing fields get default values */ /*
rpl_row_tabledefs.test specifies that
if the extra field on the slave does not have a default value
and this is okay with Delete or Update events.
Todo: fix wl3228 hld that requires defauls for all types of events
*/
// TODO: shall we check and report errors here? prepare_record(table, m_width, FALSE);
prepare_record(NULL,table,m_width,FALSE /* don't check errors */);
error= unpack_current_row(rli); error= unpack_current_row(rli);
#ifndef DBUG_OFF #ifndef DBUG_OFF
@ -8191,7 +8264,6 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == HA_ERR_RECORD_DELETED || error == 0); DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == HA_ERR_RECORD_DELETED || error == 0);
goto err; goto err;
} }
ok: ok:
table->default_column_bitmaps(); table->default_column_bitmaps();
DBUG_RETURN(0); DBUG_RETURN(0);

View File

@ -152,11 +152,11 @@ struct old_sql_ex
struct sql_ex_info struct sql_ex_info
{ {
sql_ex_info() {} /* Remove gcc warning */ sql_ex_info() {} /* Remove gcc warning */
char* field_term; const char* field_term;
char* enclosed; const char* enclosed;
char* line_term; const char* line_term;
char* line_start; const char* line_start;
char* escaped; const char* escaped;
int cached_new_format; int cached_new_format;
uint8 field_term_len,enclosed_len,line_term_len,line_start_len, escaped_len; uint8 field_term_len,enclosed_len,line_term_len,line_start_len, escaped_len;
char opt_flags; char opt_flags;
@ -171,7 +171,7 @@ struct sql_ex_info
line_start_len + escaped_len + 6 : 7); line_start_len + escaped_len + 6 : 7);
} }
bool write_data(IO_CACHE* file); bool write_data(IO_CACHE* file);
char* init(char* buf,char* buf_end,bool use_new_format); const char* init(const char* buf, const char* buf_end, bool use_new_format);
bool new_format() bool new_format()
{ {
return ((cached_new_format != -1) ? cached_new_format : return ((cached_new_format != -1) ? cached_new_format :
@ -667,34 +667,35 @@ typedef struct st_print_event_info
@section Log_event_binary_format Binary Format @section Log_event_binary_format Binary Format
Any Log_event saved on disk consists of the following three Any @c Log_event saved on disk consists of the following three
components. components.
@li Common-Header * Common-Header
@li Post-Header * Post-Header
@li Body * Body
The Common-Header, documented below, always has the same form and The Common-Header, documented in the table @ref Table_common_header
length within one version of MySQL. Each event type specifies a "below", always has the same form and length within one version of
form and length of the Post-Header common to all events of the type. MySQL. Each event type specifies a form and length of the
The Body may be of different form and length even for different Post-Header common to all events of the type. The Body may be of
events of the same type. The binary formats of Post-Header and Body different form and length even for different events of the same
are documented separately in each subclass. The binary format of type. The binary formats of Post-Header and Body are documented
Common-Header is as follows. separately in each subclass. The binary format of Common-Header is
as follows.
<table> <table>
<caption>Common-Header</caption> <caption>Common-Header</caption>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Format<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td>timestamp</td> <td>timestamp</td>
<td>4 byte unsigned integer</td> <td>4 byte unsigned integer</td>
<td>The number of seconds since 1970. <td>The time when the query started, in seconds since 1970.
</td> </td>
</tr> </tr>
@ -705,14 +706,14 @@ typedef struct st_print_event_info
</tr> </tr>
<tr> <tr>
<td>master_id</td> <td>server_id</td>
<td>4 byte integer</td> <td>4 byte unsigned integer</td>
<td>Server ID of the server that created the event.</td> <td>Server ID of the server that created the event.</td>
</tr> </tr>
<tr> <tr>
<td>total_size</td> <td>total_size</td>
<td>4 byte integer</td> <td>4 byte unsigned integer</td>
<td>The total size of this event, in bytes. In other words, this <td>The total size of this event, in bytes. In other words, this
is the sum of the sizes of Common-Header, Post-Header, and Body. is the sum of the sizes of Common-Header, Post-Header, and Body.
</td> </td>
@ -720,9 +721,12 @@ typedef struct st_print_event_info
<tr> <tr>
<td>master_position</td> <td>master_position</td>
<td>4 byte integer</td> <td>4 byte unsigned integer</td>
<td>The position of the next event in the master binary log, in <td>The position of the next event in the master binary log, in
bytes from the beginning of the file. bytes from the beginning of the file. In a binlog that is not a
relay log, this is just the position of the next event, in bytes
from the beginning of the file. In a relay log, this is
the position of the next event in the master's binlog.
</td> </td>
</tr> </tr>
@ -736,13 +740,55 @@ typedef struct st_print_event_info
Summing up the numbers above, we see that the total size of the Summing up the numbers above, we see that the total size of the
common header is 19 bytes. common header is 19 bytes.
@subsection Log_event_endianness_and_string_formats Endianness and String Formats @subsection Log_event_format_of_atomic_primitives Format of Atomic Primitives
All numbers, whether they are 16-, 32-, or 64-bit, are stored in - All numbers, whether they are 16-, 24-, 32-, or 64-bit numbers,
little endian, i.e., the least significant byte first. are stored in little endian, i.e., the least significant byte first,
unless otherwise specified.
Strings are stored in various formats. The format of each string is @anchor packed_integer
documented separately. - Some events use a special format for efficient representation of
unsigned integers, called Packed Integer. A Packed Integer has the
capacity of storing up to 8-byte integers, while small integers
still can use 1, 3, or 4 bytes. The first byte indicates how many
bytes are used by the integer, according to the following table:
<table>
<caption>Format of Packed Integer</caption>
<tr>
<th>First byte</th>
<th>Format</th>
</tr>
<tr>
<td>0-250</td>
<td>The first byte is the number (in range 0-250), and no more
bytes are used.</td>
</tr>
<tr>
<td>252</td>
<td>Two more bytes are used. The number is in the range
251-0xffff.</td>
</tr>
<tr>
<td>253</td>
<td>Three more bytes are used. The number is in the range
0xffff-0xffffff.</td>
</tr>
<tr>
<td>254</td>
<td>Eight more bytes are used. The number is in the range
0xffffff-0xffffffffffffffff.</td>
</tr>
</table>
- Strings are stored in various formats. The format of each string
is documented separately.
*/ */
class Log_event class Log_event
{ {
@ -1123,7 +1169,8 @@ protected:
/** /**
@class Query_log_event @class Query_log_event
Logs SQL queries. A @c Query_log_event is created for each query that modifies the
database, unless the query is logged row-based.
@section Query_log_event_binary_format Binary format @section Query_log_event_binary_format Binary format
@ -1134,60 +1181,49 @@ protected:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td>slave_proxy_id</td> <td>slave_proxy_id</td>
<td>4 byte unsigned integer</td> <td>4 byte unsigned integer</td>
<td>An integer identifying the client thread, which is unique on <td>An integer identifying the client thread that issued the
the server. (Note, however, that two threads on different servers query. The id is unique per server. (Note, however, that two
may have the same slave_proxy_id.) This is used when a client threads on different servers may have the same slave_proxy_id.)
thread creates a temporary table. Temporary tables are local to This is used when a client thread creates a temporary table local
the client, and the slave_proxy_id is used to distinguish to the client. The slave_proxy_id is used to distinguish
temporary tables belonging to different clients. temporary tables that belong to different clients.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>exec_time</td> <td>exec_time</td>
<td>4 byte integer</td> <td>4 byte unsigned integer</td>
<td>???TODO</td> <td>The time from when the query started to when it was logged in
the binlog, in seconds.</td>
</tr> </tr>
<tr> <tr>
<td>db_len</td> <td>db_len</td>
<td>1 byte integer</td> <td>1 byte integer</td>
<td>The length of the name of the currently selected <td>The length of the name of the currently selected database.</td>
database.
</td>
</tr> </tr>
<tr> <tr>
<td>error_code</td> <td>error_code</td>
<td>2 byte integer</td> <td>2 byte unsigned integer</td>
<td>Error code generated by the master. If the master fails, the <td>Error code generated by the master. If the master fails, the
slave will fail with the same error code, except for the error slave will fail with the same error code, except for the error
codes ER_DB_CREATE_EXISTS==1007 and ER_DB_DROP_EXISTS==1008. codes ER_DB_CREATE_EXISTS == 1007 and ER_DB_DROP_EXISTS == 1008.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>status_vars_len</td> <td>status_vars_len</td>
<td>2 byte integer</td> <td>2 byte unsigned integer</td>
<td>The length of the status_vars block of the Body, in bytes. See <td>The length of the status_vars block of the Body, in bytes. See
<a href="#query_log_event_status_vars">below</a>. @ref query_log_event_status_vars "below".
</td>
</tr>
<tr>
<td>Post-Header-For-Derived</td>
<td>0 bytes</td>
<td>This field is only written by the subclass
Execute_load_query_log_event. In this base class, it takes 0
bytes. See separate documentation for
Execute_load_query_log_event.
</td> </td>
</tr> </tr>
</table> </table>
@ -1199,19 +1235,19 @@ protected:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td><a name="query_log_event_status_vars" /> status_vars</td> <td>@anchor query_log_event_status_vars status_vars</td>
<td>variable length</td> <td>status_vars_len bytes</td>
<td>Zero or more status variables. Each status variable consists <td>Zero or more status variables. Each status variable consists
of one byte identifying the variable stored, followed by the value of one byte identifying the variable stored, followed by the value
of the variable. The possible variables are listed separately in of the variable. The possible variables are listed separately in
the table below. MySQL always writes events in the order defined the table @ref Table_query_log_event_status_vars "below". MySQL
below; however, it is capable of reading them in any order. always writes events in the order defined below; however, it is
</td> capable of reading them in any order. </td>
</tr> </tr>
<tr> <tr>
@ -1237,13 +1273,14 @@ protected:
The following table lists the status variables that may appear in The following table lists the status variables that may appear in
the status_vars field. the status_vars field.
@anchor Table_query_log_event_status_vars
<table> <table>
<caption>Status variables for Query_log_event</caption> <caption>Status variables for Query_log_event</caption>
<tr> <tr>
<th>Status variable</th> <th>Status variable</th>
<th>1-byte identifier</th> <th>1 byte identifier</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
@ -1251,13 +1288,13 @@ protected:
<td>flags2</td> <td>flags2</td>
<td>Q_FLAGS2_CODE == 0</td> <td>Q_FLAGS2_CODE == 0</td>
<td>4 byte bitfield</td> <td>4 byte bitfield</td>
<td>The flags in thd->options, binary AND-ed with <td>The flags in @c thd->options, binary AND-ed with @c
OPTIONS_WRITTEN_TO_BIN_LOG. The thd->options bitfield contains OPTIONS_WRITTEN_TO_BIN_LOG. The @c thd->options bitfield contains
options for SELECT. OPTIONS_WRITTEN identifies those options that options for "SELECT". @c OPTIONS_WRITTEN identifies those options
need to be written to the binlog (not all do). Specifically, that need to be written to the binlog (not all do). Specifically,
OPTIONS_WRITTEN_TO_BIN_LOG equals (OPTION_AUTO_IS_NULL | @c OPTIONS_WRITTEN_TO_BIN_LOG equals (@c OPTION_AUTO_IS_NULL | @c
OPTION_NO_FOREIGN_KEY_CHECKS | OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NO_FOREIGN_KEY_CHECKS | @c OPTION_RELAXED_UNIQUE_CHECKS |
OPTION_NOT_AUTOCOMMIT), or 0x0c084000 in hex. @c OPTION_NOT_AUTOCOMMIT), or 0x0c084000 in hex.
These flags correspond to the SQL variables SQL_AUTO_IS_NULL, These flags correspond to the SQL variables SQL_AUTO_IS_NULL,
FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, and AUTOCOMMIT, documented in FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, and AUTOCOMMIT, documented in
@ -1271,8 +1308,8 @@ protected:
<tr> <tr>
<td>sql_mode</td> <td>sql_mode</td>
<td>Q_SQL_MODE_CODE == 1</td> <td>Q_SQL_MODE_CODE == 1</td>
<td>8 byte integer</td> <td>8 byte bitfield</td>
<td>The sql_mode variable. See the section "SQL Modes" in the <td>The @c sql_mode variable. See the section "SQL Modes" in the
MySQL manual, and see mysql_priv.h for a list of the possible MySQL manual, and see mysql_priv.h for a list of the possible
flags. Currently (2007-10-04), the following flags are available: flags. Currently (2007-10-04), the following flags are available:
<pre> <pre>
@ -1310,10 +1347,10 @@ protected:
MODE_PAD_CHAR_TO_FULL_LENGTH==0x80000000 MODE_PAD_CHAR_TO_FULL_LENGTH==0x80000000
</pre> </pre>
All these flags are replicated from the server. However, all All these flags are replicated from the server. However, all
flags except MODE_NO_DIR_IN_CREATE are honored by the slave; the flags except @c MODE_NO_DIR_IN_CREATE are honored by the slave;
slave always preserves its old value of MODE_NO_DIR_IN_CREATE. the slave always preserves its old value of @c
For a rationale, see comment in Query_log_event::do_apply_event in MODE_NO_DIR_IN_CREATE. For a rationale, see comment in
log_event.cc. @c Query_log_event::do_apply_event in @c log_event.cc.
This field is always written to the binlog. This field is always written to the binlog.
</td> </td>
@ -1327,7 +1364,7 @@ protected:
</td> </td>
<td>Stores the client's current catalog. Every database belongs <td>Stores the client's current catalog. Every database belongs
to a catalog, the same way that every table belongs to a to a catalog, the same way that every table belongs to a
database. Currently, there is only one catalog, 'std'. database. Currently, there is only one catalog, "std".
This field is written if the length of the catalog is > 0; This field is written if the length of the catalog is > 0;
otherwise it is not written. otherwise it is not written.
@ -1343,7 +1380,7 @@ protected:
auto_increment_offset, in that order. For more information, see auto_increment_offset, in that order. For more information, see
"System variables" in the MySQL manual. "System variables" in the MySQL manual.
This field is written if auto_increment>1; otherwise it is not This field is written if auto_increment > 1. Otherwise, it is not
written. written.
</td> </td>
</tr> </tr>
@ -1351,14 +1388,14 @@ protected:
<tr> <tr>
<td>charset</td> <td>charset</td>
<td>Q_CHARSET_CODE == 4</td> <td>Q_CHARSET_CODE == 4</td>
<td>three 2-byte unsigned integers (i.e., 6 bytes)</td> <td>three 2 byte unsigned integers, totally 2+2+2=6 bytes</td>
<td>The three variables character_set_client, <td>The three variables character_set_client,
collation_connection, and collation_server, in that order. collation_connection, and collation_server, in that order.
`character_set_client' is a code identifying the character set and character_set_client is a code identifying the character set and
collation used by the client to encode the query. collation used by the client to encode the query.
`collation_connection' identifies the character set and collation collation_connection identifies the character set and collation
that the master converts the query to when it receives it; this is that the master converts the query to when it receives it; this is
useful when comparing literal strings. `collation_server' is the useful when comparing literal strings. collation_server is the
default character set and collation used when a new database is default character set and collation used when a new database is
created. created.
@ -1396,9 +1433,9 @@ protected:
<td>Q_LC_TIME_NAMES_CODE == 7</td> <td>Q_LC_TIME_NAMES_CODE == 7</td>
<td>2 byte integer</td> <td>2 byte integer</td>
<td>A code identifying a table of month and day names. The <td>A code identifying a table of month and day names. The
mapping from codes to languages is defined in sql_locale.cc. mapping from codes to languages is defined in @c sql_locale.cc.
This field is written if it is != 0, i.e., if the locale is not This field is written if it is not 0, i.e., if the locale is not
en_US. en_US.
</td> </td>
</tr> </tr>
@ -1409,14 +1446,14 @@ protected:
<td>2 byte integer</td> <td>2 byte integer</td>
<td>The value of the collation_database system variable (in the <td>The value of the collation_database system variable (in the
source code stored in thd->variables.collation_database), which source code stored in @c thd->variables.collation_database), which
holds the code for a (character set, collation) pair as described holds the code for a (character set, collation) pair as described
above (see Q_CHARSET_CODE). above (see Q_CHARSET_CODE).
`collation_database' was used in old versions (???WHEN). Its collation_database was used in old versions (???WHEN). Its value
value was loaded when issuing a "use db" command and could be was loaded when issuing a "use db" query and could be changed by
changed by issuing a "SET collation_database=xxx" command. It issuing a "SET collation_database=xxx" query. It used to affect
used to affect the "LOAD DATA INFILE" and "CREATE TABLE" commands. the "LOAD DATA INFILE" and "CREATE TABLE" commands.
In newer versions, "CREATE TABLE" has been changed to take the In newer versions, "CREATE TABLE" has been changed to take the
character set from the database of the created table, rather than character set from the database of the created table, rather than
@ -1433,17 +1470,17 @@ protected:
@subsection Query_log_event_notes_on_previous_versions Notes on Previous Versions @subsection Query_log_event_notes_on_previous_versions Notes on Previous Versions
@li Status vars were introduced in version 5.0. To read earlier * Status vars were introduced in version 5.0. To read earlier
versions correctly, check the length of the Post-Header. versions correctly, check the length of the Post-Header.
@li The status variable Q_CATALOG_CODE == 2 existed in MySQL 5.0.x, * The status variable Q_CATALOG_CODE == 2 existed in MySQL 5.0.x,
where 0<=x<=3. It was identical to Q_CATALOG_CODE, except that the where 0<=x<=3. It was identical to Q_CATALOG_CODE, except that the
string had a trailing '\0'. The '\0' was removed in 5.0.4 since it string had a trailing '\0'. The '\0' was removed in 5.0.4 since it
was redundant (the string length is stored before the string). The was redundant (the string length is stored before the string). The
Q_CATALOG_CODE will never be written by a new master, but can still Q_CATALOG_CODE will never be written by a new master, but can still
be understood by a new slave. be understood by a new slave.
@li See Q_CHARSET_DATABASE_NUMBER in the table above. * See Q_CHARSET_DATABASE_NUMBER in the table above.
*/ */
class Query_log_event: public Log_event class Query_log_event: public Log_event
@ -1576,7 +1613,8 @@ public: /* !!! Public in this patch to allow old usage */
/** /**
@class Muted_query_log_event @class Muted_query_log_event
Pretends to log SQL queries, but doesn't actually do so. Pretends to log SQL queries, but doesn't actually do so. This is
used internally only and never written to any binlog.
@section Muted_query_log_event_binary_format Binary Format @section Muted_query_log_event_binary_format Binary Format
@ -1603,7 +1641,7 @@ public:
@class Slave_log_event @class Slave_log_event
Note that this class is currently not used at all; no code writes a Note that this class is currently not used at all; no code writes a
Slave_log_event (though some code in repl_failsafe.cc reads @c Slave_log_event (though some code in @c repl_failsafe.cc reads @c
Slave_log_event). So it's not a problem if this code is not Slave_log_event). So it's not a problem if this code is not
maintained. maintained.
@ -1617,7 +1655,7 @@ public:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
@ -1717,26 +1755,27 @@ private:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td>slave_proxy_id</td> <td>slave_proxy_id</td>
<td>4 byte unsigned integer</td> <td>4 byte unsigned integer</td>
<td>An integer identifying the client thread, which is unique on <td>An integer identifying the client thread that issued the
the server. (Note, however, that the same slave_proxy_id may query. The id is unique per server. (Note, however, that two
appear on different servers.) This is used when a client thread threads on different servers may have the same slave_proxy_id.)
creates a temporary table. Temporary tables are local to the This is used when a client thread creates a temporary table local
client, and the slave_proxy_id is used to distinguish temporary to the client. The slave_proxy_id is used to distinguish
tables belonging to different clients. temporary tables that belong to different clients.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>exec_time</td> <td>exec_time</td>
<td>4 byte unsigned integer</td> <td>4 byte unsigned integer</td>
<td>???TODO</td> <td>The time from when the query started to when it was logged in
the binlog, in seconds.</td>
</tr> </tr>
<tr> <tr>
@ -1773,7 +1812,7 @@ private:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
@ -1813,7 +1852,7 @@ private:
<li> In the old format, we know that each string has length 0 or <li> In the old format, we know that each string has length 0 or
1. Therefore, only the first byte of each string is stored. The 1. Therefore, only the first byte of each string is stored. The
order of the strings is the same as in the new format. These five order of the strings is the same as in the new format. These five
bytes are followed by the same 1-byte bitfield as in the new bytes are followed by the same 1 byte bitfield as in the new
format. Finally, a 1 byte bitfield called empty_flags is stored. format. Finally, a 1 byte bitfield called empty_flags is stored.
The low 5 bits of empty_flags indicate which of the five strings The low 5 bits of empty_flags indicate which of the five strings
have length 0. For each of the following flags that is set, the have length 0. For each of the following flags that is set, the
@ -1831,7 +1870,7 @@ private:
<tr> <tr>
<td>field_lens</td> <td>field_lens</td>
<td>num_fields 1-byte unsigned integers</td> <td>num_fields 1 byte unsigned integers</td>
<td>An array of num_fields integers representing the length of <td>An array of num_fields integers representing the length of
each field in the query. (num_fields is from the Post-Header). each field in the query. (num_fields is from the Post-Header).
</td> </td>
@ -1992,11 +2031,13 @@ extern char server_version[SERVER_VERSION_LENGTH];
Start_log_event_v3 is the Start_log_event of binlog format 3 (MySQL 3.23 and Start_log_event_v3 is the Start_log_event of binlog format 3 (MySQL 3.23 and
4.x). 4.x).
Format_description_log_event derives from Start_log_event_v3; it is the
Start_log_event of binlog format 4 (MySQL 5.0), that is, the event that Format_description_log_event derives from Start_log_event_v3; it is
describes the other events' header/postheader lengths. This event is sent by the Start_log_event of binlog format 4 (MySQL 5.0), that is, the
MySQL 5.0 whenever it starts sending a new binlog if the requested position event that describes the other events' Common-Header/Post-Header
is >4 (otherwise if ==4 the event will be sent naturally). lengths. This event is sent by MySQL 5.0 whenever it starts sending
a new binlog if the requested position is >4 (otherwise if ==4 the
event will be sent naturally).
@section Start_log_event_v3_binary_format Binary Format @section Start_log_event_v3_binary_format Binary Format
*/ */
@ -2150,7 +2191,9 @@ protected:
/** /**
@class Intvar_log_event @class Intvar_log_event
Logs special variables related to auto_increment values. An Intvar_log_event will be created just before a Query_log_event,
if the query uses one of the variables LAST_INSERT_ID or INSERT_ID.
Each Intvar_log_event holds the value of one of these variables.
@section Intvar_log_event_binary_format Binary Format @section Intvar_log_event_binary_format Binary Format
@ -2161,12 +2204,12 @@ protected:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td>Type</td> <td>type</td>
<td>1 byte enumeration</td> <td>1 byte enumeration</td>
<td>One byte identifying the type of variable stored. Currently, <td>One byte identifying the type of variable stored. Currently,
two identifiers are supported: LAST_INSERT_ID_EVENT==1 and two identifiers are supported: LAST_INSERT_ID_EVENT==1 and
@ -2182,7 +2225,6 @@ protected:
</table> </table>
*/ */
class Intvar_log_event: public Log_event class Intvar_log_event: public Log_event
{ {
public: public:
@ -2228,15 +2270,34 @@ private:
written in 4.1.1 for PASSWORD() (but the fact that it is written is just a written in 4.1.1 for PASSWORD() (but the fact that it is written is just a
waste, it does not cause bugs). waste, it does not cause bugs).
The state of the random number generation consists of 128 bits,
which are stored internally as two 64-bit numbers.
@section Rand_log_event_binary_format Binary Format @section Rand_log_event_binary_format Binary Format
This event type has no Post-Header. The Body of this event type has This event type has no Post-Header. The Body of this event type has
two components: two components:
@li seed1 (8 bytes): 64 bit random seed1. <table>
@li seed2 (8 bytes): 64 bit random seed2. <caption>Post-Header for Intvar_log_event</caption>
The state of the random number generation consists of 128 bits, <tr>
which are stored internally as two 64-bit numbers. <th>Name</th>
<th>Format</th>
<th>Description</th>
</tr>
<tr>
<td>seed1</td>
<td>8 byte unsigned integer</td>
<td>64 bit random seed1.</td>
</tr>
<tr>
<td>seed2</td>
<td>8 byte unsigned integer</td>
<td>64 bit random seed2.</td>
</tr>
</table>
*/ */
class Rand_log_event: public Log_event class Rand_log_event: public Log_event
@ -2423,14 +2484,14 @@ private:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td>pos</td> <td>position</td>
<td>8 byte integer</td> <td>8 byte integer</td>
<td>???TODO</td> <td>The position within the binlog to rotate to.</td>
</tr> </tr>
</table> </table>
@ -2442,17 +2503,17 @@ private:
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Size<br/></th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td>new_log_ident</td> <td>new_log</td>
<td>variable length string without trailing zero, extending to the <td>variable length string without trailing zero, extending to the
end of the event (determined by the length field of the end of the event (determined by the length field of the
Common-Header) Common-Header)
</td> </td>
<td>???TODO</td> <td>Name of the binlog to rotate to.</td>
</tr> </tr>
</table> </table>
@ -2841,10 +2902,316 @@ char *str_to_hex(char *to, const char *from, uint len);
/** /**
@class Table_map_log_event @class Table_map_log_event
Create a mapping from a (database name, table name) couple to a table In row-based mode, every row operation event is preceded by a
identifier (an integer number). Table_map_log_event which maps a table definition to a number. The
table definition consists of database name, table name, and column
definitions.
@section Table_map_log_event_binary_format Binary Format @section Table_map_log_event_binary_format Binary Format
The Post-Header has the following components:
<table>
<caption>Post-Header for Table_map_log_event</caption>
<tr>
<th>Name</th>
<th>Format</th>
<th>Description</th>
</tr>
<tr>
<td>table_id</td>
<td>6 bytes unsigned integer</td>
<td>The number that identifies the table.</td>
</tr>
<tr>
<td>flags</td>
<td>2 byte bitfield</td>
<td>Reserved for future use; currently always 0.</td>
</tr>
</table>
The Body has the following components:
<table>
<caption>Body for Table_map_log_event</caption>
<tr>
<th>Name</th>
<th>Format</th>
<th>Description</th>
</tr>
<tr>
<td>database_name</td>
<td>one byte string length, followed by null-terminated string</td>
<td>The name of the database in which the table resides. The name
is represented as a one byte unsigned integer representing the
number of bytes in the name, followed by length bytes containing
the database name, followed by a terminating 0 byte. (Note the
redundancy in the representation of the length.) </td>
</tr>
<tr>
<td>table_name</td>
<td>one byte string length, followed by null-terminated string</td>
<td>The name of the table, encoded the same way as the database
name above.</td>
</tr>
<tr>
<td>column_count</td>
<td>@ref packed_integer "Packed Integer"</td>
<td>The number of columns in the table, represented as a packed
variable-length integer.</td>
</tr>
<tr>
<td>column_type</td>
<td>List of column_count 1 byte enumeration values</td>
<td>The type of each column in the table, listed from left to
right. Each byte is mapped to a column type according to the
enumeration type enum_field_types defined in mysql_com.h. The
mapping of types to numbers is listed in the table @ref
Table_table_map_log_event_column_types "below" (along with
description of the associated metadata field). </td>
</tr>
<tr>
<td>metadata_length</td>
<td>@ref packed_integer "Packed Integer"</td>
<td>The length of the following metadata block</td>
</tr>
<tr>
<td>metadata</td>
<td>list of metadata for each column</td>
<td>For each column from left to right, a chunk of data who's
length and semantics depends on the type of the column. The
length and semantics for the metadata for each column are listed
in the table @ref Table_table_map_log_event_column_types
"below".</td>
</tr>
<tr>
<td>null_bits</td>
<td>column_count bits, rounded up to nearest byte</td>
<td>For each column, a bit indicating whether data in the column
can be NULL or not. The number of bytes needed for this is
int((column_count+7)/8). The flag for the first column from the
left is in the least-significant bit of the first byte, the second
is in the second least significant bit of the first byte, the
ninth is in the least significant bit of the second byte, and so
on. </td>
</tr>
</table>
The table below lists all column types, along with the numerical
identifier for it and the size and interpretation of meta-data used
to describe the type.
@anchor Table_table_map_log_event_column_types
<table>
<caption>Table_map_log_event column types: numerical identifier and
metadata</caption>
<tr>
<th>Name</th>
<th>Identifier</th>
<th>Size of metadata in bytes</th>
<th>Description of metadata</th>
</tr>
<tr>
<td>MYSQL_TYPE_DECIMAL</td><td>0</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_TINY</td><td>1</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_SHORT</td><td>2</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_LONG</td><td>3</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_FLOAT</td><td>4</td>
<td>1 byte</td>
<td>1 byte unsigned integer, representing the "pack_length", which
is equal to sizeof(float) on the server from which the event
originates.</td>
</tr>
<tr>
<td>MYSQL_TYPE_DOUBLE</td><td>5</td>
<td>1 byte</td>
<td>1 byte unsigned integer, representing the "pack_length", which
is equal to sizeof(double) on the server from which the event
originates.</td>
</tr>
<tr>
<td>MYSQL_TYPE_NULL</td><td>6</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_TIMESTAMP</td><td>7</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_LONGLONG</td><td>8</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_INT24</td><td>9</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_DATE</td><td>10</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_TIME</td><td>11</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_DATETIME</td><td>12</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td>MYSQL_TYPE_YEAR</td><td>13</td>
<td>0</td>
<td>No column metadata.</td>
</tr>
<tr>
<td><i>MYSQL_TYPE_NEWDATE</i></td><td><i>14</i></td>
<td>&ndash;</td>
<td><i>This enumeration value is only used internally and cannot
exist in a binlog.</i></td>
</tr>
<tr>
<td>MYSQL_TYPE_VARCHAR</td><td>15</td>
<td>2 bytes</td>
<td>2 byte unsigned integer representing the maximum length of
the string.</td>
</tr>
<tr>
<td>MYSQL_TYPE_BIT</td><td>16</td>
<td>2 bytes</td>
<td>A 1 byte unsigned int representing the length in bits of the
bitfield (0 to 64), followed by a 1 byte unsigned int
representing the number of bytes occupied by the bitfield. The
number of bytes is either int((length+7)/8) or int(length/8).</td>
</tr>
<tr>
<td>MYSQL_TYPE_NEWDECIMAL</td><td>246</td>
<td>2 bytes</td>
<td>A 1 byte unsigned int representing the precision, followed
by a 1 byte unsigned int representing the number of decimals.</td>
</tr>
<tr>
<td><i>MYSQL_TYPE_ENUM</i></td><td><i>247</i></td>
<td>&ndash;</td>
<td><i>This enumeration value is only used internally and cannot
exist in a binlog.</i></td>
</tr>
<tr>
<td><i>MYSQL_TYPE_SET</i></td><td><i>248</i></td>
<td>&ndash;</td>
<td><i>This enumeration value is only used internally and cannot
exist in a binlog.</i></td>
</tr>
<tr>
<td>MYSQL_TYPE_TINY_BLOB</td><td>249</td>
<td>&ndash;</td>
<td><i>This enumeration value is only used internally and cannot
exist in a binlog.</i></td>
</tr>
<tr>
<td><i>MYSQL_TYPE_MEDIUM_BLOB</i></td><td><i>250</i></td>
<td>&ndash;</td>
<td><i>This enumeration value is only used internally and cannot
exist in a binlog.</i></td>
</tr>
<tr>
<td><i>MYSQL_TYPE_LONG_BLOB</i></td><td><i>251</i></td>
<td>&ndash;</td>
<td><i>This enumeration value is only used internally and cannot
exist in a binlog.</i></td>
</tr>
<tr>
<td>MYSQL_TYPE_BLOB</td><td>252</td>
<td>1 byte</td>
<td>The pack length, i.e., the number of bytes needed to represent
the length of the blob: 1, 2, 3, or 4.</td>
</tr>
<tr>
<td>MYSQL_TYPE_VAR_STRING</td><td>253</td>
<td>2 bytes</td>
<td>This is used to store both strings and enumeration values.
The first byte is a enumeration value storing the <i>real
type</i>, which may be either MYSQL_TYPE_VAR_STRING or
MYSQL_TYPE_ENUM. The second byte is a 1 byte unsigned integer
representing the field size, i.e., the number of bytes needed to
store the length of the string.</td>
</tr>
<tr>
<td>MYSQL_TYPE_STRING</td><td>254</td>
<td>2 bytes</td>
<td>The first byte is always MYSQL_TYPE_VAR_STRING (i.e., 253).
The second byte is the field size, i.e., the number of bytes in
the representation of size of the string: 3 or 4.</td>
</tr>
<tr>
<td>MYSQL_TYPE_GEOMETRY</td><td>255</td>
<td>1 byte</td>
<td>The pack length, i.e., the number of bytes needed to represent
the length of the geometry: 1, 2, 3, or 4.</td>
</tr>
</table>
*/ */
class Table_map_log_event : public Log_event class Table_map_log_event : public Log_event
{ {
@ -3131,6 +3498,8 @@ protected:
ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT); ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols, int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
&m_curr_row_end, &m_master_reclength); &m_curr_row_end, &m_master_reclength);
if (m_curr_row_end > m_rows_end)
my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT); ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);
return result; return result;
} }
@ -3408,7 +3777,7 @@ protected:
<caption>Incident event format</caption> <caption>Incident event format</caption>
<tr> <tr>
<th>Symbol</th> <th>Symbol</th>
<th>Size<br/>(bytes)</th> <th>Format</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>

View File

@ -2078,7 +2078,7 @@ Old_rows_log_event::write_row(const Relay_log_info *const rli,
/* fill table->record[0] with default values */ /* fill table->record[0] with default values */
if ((error= prepare_record(rli, table, m_width, if ((error= prepare_record(table, m_width,
TRUE /* check if columns have def. values */))) TRUE /* check if columns have def. values */)))
DBUG_RETURN(error); DBUG_RETURN(error);
@ -2289,7 +2289,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
/* unpack row - missing fields get default values */ /* unpack row - missing fields get default values */
// TODO: shall we check and report errors here? // TODO: shall we check and report errors here?
prepare_record(NULL,table,m_width,FALSE /* don't check errors */); prepare_record(table, m_width, FALSE /* don't check errors */);
error= unpack_current_row(rli); error= unpack_current_row(rli);
#ifndef DBUG_OFF #ifndef DBUG_OFF

View File

@ -1873,9 +1873,9 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache)
/* It's safe to broadcast outside a lock (COND... is not deleted here) */ /* It's safe to broadcast outside a lock (COND... is not deleted here) */
DBUG_PRINT("signal", ("Broadcasting COND_thread_count")); DBUG_PRINT("signal", ("Broadcasting COND_thread_count"));
my_thread_end();
(void) pthread_cond_broadcast(&COND_thread_count); (void) pthread_cond_broadcast(&COND_thread_count);
my_thread_end();
pthread_exit(0); pthread_exit(0);
DBUG_RETURN(0); // Impossible DBUG_RETURN(0); // Impossible
} }

View File

@ -307,17 +307,15 @@ unpack_row(Relay_log_info const *rli,
If @c check is true, fields are explicitly initialized only if they have If @c check is true, fields are explicitly initialized only if they have
default value or can be NULL. Otherwise error is reported. default value or can be NULL. Otherwise error is reported.
@param log Used to report errors.
@param table Table whose record[0] buffer is prepared. @param table Table whose record[0] buffer is prepared.
@param skip Number of columns for which default value initialization @param skip Number of columns for which default value initialization
should be skipped. should be skipped.
@param check Indicates if errors should be checked when setting default @param check Indicates if errors should be checked when setting default
values. values.
@returns 0 on success. @returns 0 on success or a handler level error code
*/ */
int prepare_record(const Slave_reporting_capability *const log, int prepare_record(TABLE *const table,
TABLE *const table,
const uint skip, const bool check) const uint skip, const bool check)
{ {
DBUG_ENTER("prepare_record"); DBUG_ENTER("prepare_record");
@ -337,14 +335,8 @@ int prepare_record(const Slave_reporting_capability *const log,
if (check && ((f->flags & mask) == mask)) if (check && ((f->flags & mask) == mask))
{ {
DBUG_ASSERT(log); my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), f->field_name);
error= ER_NO_DEFAULT_FOR_FIELD; error = HA_ERR_ROWS_EVENT_APPLY;
log->report(ERROR_LEVEL, error,
"Field `%s` of table `%s`.`%s` "
"has no default value and cannot be NULL",
f->field_name, table->s->db.str,
table->s->table_name.str);
my_error(error, MYF(0), f->field_name);
} }
else else
f->set_default(); f->set_default();

View File

@ -30,8 +30,7 @@ int unpack_row(Relay_log_info const *rli,
uchar const **const row_end, ulong *const master_reclength); uchar const **const row_end, ulong *const master_reclength);
// Fill table's record[0] with default values. // Fill table's record[0] with default values.
int prepare_record(const Slave_reporting_capability *const, TABLE *const, int prepare_record(TABLE *const, const uint =0, const bool =FALSE);
const uint =0, const bool =FALSE);
#endif #endif
#endif #endif

View File

@ -6119,3 +6119,5 @@ ER_SLAVE_AMBIGOUS_EXEC_MODE
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement." eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement."
ER_SLAVE_CORRUPT_EVENT
eng "Corrupted replication event was detected"

View File

@ -1337,14 +1337,15 @@ bool show_master_info(THD* thd, Master_info* mi)
protocol->prepare_for_resend(); protocol->prepare_for_resend();
/* /*
TODO: we read slave_running without run_lock, whereas these variables slave_running can be accessed without run_lock but not other
are updated under run_lock and not data_lock. In 5.0 we should lock non-volotile members like mi->io_thd, which is guarded by the mutex.
run_lock on top of data_lock (with good order).
*/ */
pthread_mutex_lock(&mi->run_lock);
protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin);
pthread_mutex_unlock(&mi->run_lock);
pthread_mutex_lock(&mi->data_lock); pthread_mutex_lock(&mi->data_lock);
pthread_mutex_lock(&mi->rli.data_lock); pthread_mutex_lock(&mi->rli.data_lock);
protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin);
protocol->store(mi->host, &my_charset_bin); protocol->store(mi->host, &my_charset_bin);
protocol->store(mi->user, &my_charset_bin); protocol->store(mi->user, &my_charset_bin);
protocol->store((uint32) mi->port); protocol->store((uint32) mi->port);

View File

@ -80,8 +80,8 @@ class Master_info;
mi->rli does not either. mi->rli does not either.
In Master_info: run_lock, data_lock In Master_info: run_lock, data_lock
run_lock protects all information about the run state: slave_running, and the run_lock protects all information about the run state: slave_running, thd
existence of the I/O thread (to stop/start it, you need this mutex). and the existence of the I/O thread to stop/start it, you need this mutex).
data_lock protects some moving members of the struct: counters (log name, data_lock protects some moving members of the struct: counters (log name,
position) and relay log (MYSQL_BIN_LOG object). position) and relay log (MYSQL_BIN_LOG object).

Some files were not shown because too many files have changed in this diff Show More