1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Merge mysql.com:/nfsdisk1/lars/bk/mysql-5.1

into  mysql.com:/nfsdisk1/lars/bk/mysql-5.1-new-rpl
This commit is contained in:
lars/lthalmann@dl145k.mysql.com
2007-07-02 17:45:46 +02:00
118 changed files with 2006 additions and 746 deletions

View File

@@ -1,6 +1,11 @@
# Test to test how logging is done depending on the capabilities of
# the engines. Unfortunately, we don't have a good row-only logging
# engine, and NDB does not really cut is since it is also
# self-logging. I'm using it nevertheless.
source include/have_blackhole.inc;
source include/have_ndb.inc;
source include/have_binlog_format_mixed_or_row.inc;
source include/have_log_bin.inc;
CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
@@ -15,9 +20,6 @@ INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
# I cannot use these statements since the rows logged to the NDB table
# eventually shows up in the binary log. I use them anyway, since once
# BUG#29222 is fixed, there will be a difference here.
echo *** Please look in binlog_multi_engine.test if you have a diff here ****;
START TRANSACTION;
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
@@ -40,6 +42,8 @@ INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
error ER_BINLOG_LOGGING_IMPOSSIBLE;
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
# Not possible to test this since NDB writes its own binlog, which
# might cause it to be out of sync with the results from MyISAM.
@@ -67,6 +71,8 @@ INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
error ER_BINLOG_LOGGING_IMPOSSIBLE;
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
error ER_BINLOG_LOGGING_IMPOSSIBLE;
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
# Not possible to test this since NDB writes its own binlog, which
# might cause it to be out of sync with the results from MyISAM.

View File

@@ -594,4 +594,22 @@ select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1';
drop table t1;
#
# Bug#28925 GROUP_CONCAT inserts wrong separators for a ucs2 column
#
create table t1 (a char(1) character set ucs2);
insert into t1 values ('a'),('b'),('c');
select hex(group_concat(a)) from t1;
select collation(group_concat(a)) from t1;
drop table t1;
set names latin1;
create table t1 (a char(1) character set latin1);
insert into t1 values ('a'),('b'),('c');
set character_set_connection=ucs2;
select hex(group_concat(a separator ',')) from t1;
select collation(group_concat(a separator ',')) from t1;
drop table t1;
set names latin1;
--echo End of 5.0 tests

View File

@@ -15,6 +15,16 @@ DROP TABLE IF EXISTS t1;
create table t1 (a int);
drop table t1;
--echo End of 4.1 tests
#
# Bug #28925 GROUP_CONCAT inserts wrong separators for a ucs2 column
# Check that GROUP_CONCAT works fine with --default-character-set=ucs2
#
create table t1 (a char(1) character set latin1);
insert into t1 values ('a'),('b'),('c');
select hex(group_concat(a)) from t1;
drop table t1;
#
# Bug #27643: query failed : 1114 (The table '' is full)
#

View File

@@ -19,7 +19,6 @@ im_instance_conf : Bug#20294 2007-05-30 alik Instance manager tests
im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance.
im_instance_conf : BUG#28743 Instance manager generates warnings in test suite
im_utils : BUG#28743 Instance manager generates warnings in test suite
innodb : Disabling test case awaiting reply from Innobase
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
@@ -35,6 +34,8 @@ rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fa
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
#rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB
rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a
rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case
ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper
@@ -52,5 +53,4 @@ im_options_set : Bug#20294: Instance manager tests fail randomly
im_options_unset : Bug#20294: Instance manager tests fail randomly
mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage
rpl_udf : Bug#28993 rpl_udf test causes server crash and valgrind warning in pushbuild
rpl_ndb_circular : Bug#29233 rpl_ndb_circular fails randomly
ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild

View File

@@ -13,6 +13,11 @@
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source include/have_log_bin.inc
# Disabling it temporarily for statement-based logging since some
# tests are not safe while binlog is on.
-- source include/have_binlog_format_mixed_or_row.inc
#
# Small basic test with ignore
@@ -774,7 +779,7 @@ CREATE TABLE `t2` (
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
reset master;
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
UPDATE t2,t1 SET t2.a=t1.a+2;
# check
select * from t2 /* must be (3,1), (4,4) */;
@@ -786,7 +791,7 @@ delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
insert into t2 values (1,2),(3,4),(4,4);
reset master;
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
show master status /* there must be no UPDATE query event */;

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
let $engine_type=ndbcluster;
--source include/loaddata_autocom.inc

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
#

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc
@@ -11,6 +9,9 @@
drop table if exists t1, t2;
--enable_warnings
connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
# Workaround for Bug#27644
# ndb: connecting api node/mysqld may "steal" node_id from running mysqld
# - let ndb_waiter use a fixed node id so "steal" cannot happen
@@ -28,8 +29,14 @@ insert into t1 values (1);
--exec $NDB_MGM --no-defaults -e "all restart" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
# Wait for mysqld to reconnect and exit from readonly mode
# Should preferrably be a "while (!"select ndb_readonly")" loop
sleep 2;
--disable_query_log
--connection con1
--source include/ndb_not_readonly.inc
--connection con2
--source include/ndb_not_readonly.inc
--enable_query_log
--connection server1
--error 1297
insert into t1 values (2);
--error 1296
@@ -48,8 +55,13 @@ select * from t2 order by a limit 3;
--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
# to ensure mysqld has connected again, and recreated system tables
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster ndb_apply_status >> $NDB_TOOLS_OUTPUT
sleep 2;
--disable_query_log
--connection con1
--source include/ndb_not_readonly.inc
--connection con2
--source include/ndb_not_readonly.inc
--enable_query_log
--connection server2
--error ER_NO_SUCH_TABLE
select * from t2;
@@ -67,8 +79,13 @@ reset master;
--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
# to ensure mysqld has connected again, and recreated system tables
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster ndb_apply_status >> $NDB_TOOLS_OUTPUT
sleep 2;
--disable_query_log
--connection con1
--source include/ndb_not_readonly.inc
--connection con2
--source include/ndb_not_readonly.inc
--enable_query_log
--connection server1
--error ER_NO_SUCH_TABLE
select * from t2;

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,4 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/have_binlog_format_row.inc

View File

@@ -0,0 +1,33 @@
#
# test different behavior of ndb using different binlog formats
#
-- source include/have_blackhole.inc
-- source include/have_ndb.inc
-- source include/have_log_bin.inc
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
#
# Bug #29222 Statement mode replicates both statement and
# rows when writing to an NDB table
#
CREATE TABLE t1 (m INT, n INT) ENGINE=MYISAM;
CREATE TABLE t2 (b INT, c INT) ENGINE=BLACKHOLE;
CREATE TABLE t3 (e INT, f INT) ENGINE=NDB;
RESET MASTER;
SET SESSION BINLOG_FORMAT=STATEMENT;
INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c;
# A transaction here is not necessary, but I wanted to group the bad statements
START TRANSACTION;
INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f;
UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c;
COMMIT;
--source include/show_binlog_events.inc
DROP TABLE t1, t2, t3;

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/have_binlog_format_row.inc

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/have_binlog_format_row.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_query_log

View File

@@ -1,5 +1,4 @@
-- source include/have_query_cache.inc
-- source include/have_binlog_format_row.inc
-- source include/have_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_query_cache.inc
-- source include/have_binlog_format_row.inc
-- source include/have_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,6 +1,4 @@
-- source include/have_query_cache.inc
-- source include/have_binlog_format_row.inc
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,6 +1,4 @@
-- source include/have_query_cache.inc
-- source include/have_binlog_format_row.inc
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -40,7 +40,6 @@
##############################################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc
-- source include/not_embedded.inc

View File

@@ -5,7 +5,6 @@
########################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -13,7 +13,6 @@
#################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1;

View File

@@ -27,7 +27,6 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1;

View File

@@ -6,7 +6,6 @@
########################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS test.t1;

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3;

View File

@@ -26,7 +26,6 @@
# gives a better idea of what the test is about
###########################################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS test.t1;

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
SET storage_engine=ndbcluster;
--source include/gis_generic.inc
set engine_condition_pushdown = on;

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
connect (con1,localhost,root,,);

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,6 +1,5 @@
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
#--disable_abort_on_error
#
# Simple test for the partition storage engine

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1;

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
#
# Simple test for the partition storage engine
# Focuses on range partitioning tests

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
#--disable_abort_on_error
#
# Simple test for the partition storage engine

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings
@@ -286,7 +285,7 @@ CREATE TABLE t2 (
var1 int(2) NOT NULL,
var2 int(2) NOT NULL,
PRIMARY KEY (var1)
) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
DELIMITER |;

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
#

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,3 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_multi_ndb.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,6 +1,5 @@
# Tests which involve triggers and NDB storage engine
--source include/have_ndb.inc
--source include/have_binlog_format_row.inc
--source include/not_embedded.inc
#
@@ -19,8 +18,8 @@ drop table if exists t1, t2, t3, t4, t5;
--enable_warnings
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
create table t2 (op char(1), a int not null, b decimal (63,30));
create table t3 select 1 as i;
create table t2 (op char(1), a int not null, b decimal (63,30)) engine=ndb;
create table t3 engine=ndb select 1 as i;
create table t4 (a int not null primary key, b int) engine=ndb;
create table t5 (a int not null primary key, b int) engine=ndb;

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
--source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
--source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
--disable_warnings

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/have_ndbapi_examples.inc
--disable_warnings

View File

@@ -11,7 +11,6 @@
use test;
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
let $type= 'NDB' ;
-- source include/ps_create.inc
-- source include/ps_renew.inc

View File

@@ -5,7 +5,7 @@
# By JBM 2004-02-15 #
#####################################
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_master-slave.inc
-- source include/have_log_bin.inc
let $engine_type=NDB;
-- source extra/rpl_tests/rpl_commit_after_flush.test

View File

@@ -0,0 +1 @@
--default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1

View File

@@ -0,0 +1,42 @@
--source include/have_ucs2.inc
--source include/have_ndb.inc
--source include/ndb_master-slave.inc
#
# MySQL Bug#15276: MySQL ignores collation-server
#
show variables like 'collation_server';
#
# Check that NDB replication doesn't explode with default charset
# being multibyte.
#
# Theorised that this could be a problem when dealing with:
# Bug #27404 util thd mysql_parse sig11 when mysqld default multibyte charset
#
# Sort of related to:
# Bug#18004 Connecting crashes server when default charset is UCS2
#
#
show variables like "%character_set_ser%";
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (a int) ENGINE=NDB;
drop table t1;
--connection master
CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
`nom` char(4) default NULL,
`prenom` char(4) default NULL,
PRIMARY KEY (`nid`))
ENGINE=ndbcluster;
INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
select * from t1 order by nid;
--sync_slave_with_master
# connect to slave and ensure data it there.
--connection slave
select * from t1 order by nid;

View File

@@ -9,7 +9,7 @@
--source include/have_binlog_format_row.inc
--source include/ndb_default_cluster.inc
--source include/not_embedded.inc
--source include/big_test.inc
#--source include/big_test.inc
#--source include/have_ndb_extra.inc
--source include/ndb_master-slave.inc
@@ -98,7 +98,7 @@ SELECT DISTINCT FILE_NAME, FILE_TYPE, TABLESPACE_NAME, LOGFILE_GROUP_NAME
connection master;
CREATE INDEX t1_i ON t1(c2, c3);
#Bug 18039
#CREATE UNIQUE INDEX t1_i2 ON t1(c2);
CREATE UNIQUE INDEX t1_i2 ON t1(c2);
ALTER TABLE t1 ADD c4 TIMESTAMP;
ALTER TABLE t1 ADD c5 DOUBLE;
ALTER TABLE t1 ADD INDEX (c5);
@@ -170,7 +170,7 @@ SELECT * FROM t1 ORDER BY c1 LIMIT 5;
connection slave;
SHOW CREATE TABLE t1;
# Bug 18094
#SELECT * FROM t1 ORDER BY c1 LIMIT 5;
SELECT * FROM t1 ORDER BY c1 LIMIT 5;
SELECT * FROM t1 where c1 = 1;
connection master;
@@ -198,163 +198,19 @@ connection master;
CREATE TABLESPACE ts2
ADD DATAFILE 'datafile03.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 10M
ENGINE=NDB;
ALTER TABLESPACE ts2
ADD DATAFILE 'datafile04.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 5M
ENGINE=NDB;
###### CLEAN UP SECTION ##############
DROP DATABASE IF EXISTS tpcb;
CREATE DATABASE tpcb;
######## Creat Table Section #########
--echo *********** Create TPCB Tables *****************
CREATE TABLE tpcb.account
(id INT, bid INT, balance DECIMAL(10,2),
filler CHAR(255), PRIMARY KEY(id))
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;
let engine_type=NDBCLUSTER;
let table_space=ts2;
let format='RBR';
CREATE TABLE tpcb.branch
(bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
PRIMARY KEY(bid))
ENGINE=NDB;
CREATE TABLE tpcb.teller
(tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
PRIMARY KEY(tid))
TABLESPACE ts2 STORAGE DISK
ENGINE=NDB;
CREATE TABLE tpcb.history
(id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
tid INT, bid INT, amount DECIMAL(10,2),
tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
filler CHAR(80),PRIMARY KEY (id))
TABLESPACE ts2 STORAGE DISK
ENGINE=NDB;
--echo ********* Create Procedures and Functions ************
delimiter |;
CREATE PROCEDURE tpcb.load()
BEGIN
DECLARE acct INT DEFAULT 1000;
DECLARE brch INT DEFAULT 100;
DECLARE tell INT DEFAULT 1000;
DECLARE tmp INT DEFAULT 100;
WHILE brch > 0 DO
SET tmp = 100;
WHILE tmp > 0 DO
INSERT INTO tpcb.account VALUES (acct, brch, 0.0, "FRESH ACCOUNT");
SET acct = acct - 1;
SET tmp = tmp -1;
END WHILE;
INSERT INTO tpcb.branch VALUES (brch, 0.0, "FRESH BRANCH");
SET brch = brch - 1;
END WHILE;
WHILE tell > 0 DO
INSERT INTO tpcb.teller VALUES (tell, 0.0, "FRESH TELLER");
SET tell = tell - 1;
END WHILE;
END|
CREATE FUNCTION tpcb.account_id () RETURNS INT
BEGIN
DECLARE num INT;
DECLARE ran INT;
SELECT RAND() * 10 INTO ran;
IF (ran < 2)
THEN
SELECT RAND() * 10 INTO num;
ELSEIF (ran < 4)
THEN
SELECT RAND() * 100 INTO num;
ELSE
SELECT RAND() * 1000 INTO num;
END IF;
IF (num < 1)
THEN
RETURN 1;
END IF;
RETURN num;
END|
CREATE FUNCTION tpcb.teller_id () RETURNS INT
BEGIN
DECLARE num INT;
DECLARE ran INT;
SELECT RAND() * 10 INTO ran;
IF (ran < 2)
THEN
SELECT RAND() * 10 INTO num;
ELSEIF (ran < 5)
THEN
SELECT RAND() * 100 INTO num;
ELSE
SELECT RAND() * 1000 INTO num;
END IF;
IF (num < 1)
THEN
RETURN 1;
END IF;
RETURN num;
END|
CREATE PROCEDURE tpcb.trans()
BEGIN
DECLARE acct INT DEFAULT 0;
DECLARE brch INT DEFAULT 0;
DECLARE tell INT DEFAULT 0;
DECLARE bal DECIMAL(10,2) DEFAULT 0.0;
DECLARE amount DECIMAL(10,2) DEFAULT 1.00;
DECLARE test INT DEFAULT 0;
DECLARE bbal DECIMAL(10,2) DEFAULT 0.0;
DECLARE tbal DECIMAL(10,2) DEFAULT 0.0;
DECLARE local_uuid VARCHAR(255);
DECLARE local_user VARCHAR(255);
DECLARE local_time TIMESTAMP;
SELECT RAND() * 10 INTO test;
SELECT tpcb.account_id() INTO acct;
SELECT tpcb.teller_id() INTO tell;
SELECT account.balance INTO bal FROM tpcb.account WHERE id = acct;
SELECT account.bid INTO brch FROM tpcb.account WHERE id = acct;
SELECT teller.balance INTO tbal FROM tpcb.teller WHERE tid = tell;
SELECT branch.balance INTO bbal FROM tpcb.branch WHERE bid = brch;
IF (test < 5)
THEN
SET bal = bal + amount;
SET bbal = bbal + amount;
SET tbal = tbal + amount;
UPDATE tpcb.account SET balance = bal, filler = 'account updated'
WHERE id = acct;
UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
WHERE bid = brch;
UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
WHERE tid = tell;
ELSE
SET bal = bal - amount;
SET bbal = bbal - amount;
SET tbal = tbal - amount;
UPDATE tpcb.account SET balance = bal, filler = 'account updated'
WHERE id = acct;
UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
WHERE bid = brch;
UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
WHERE tid = tell;
END IF;
SET local_uuid=UUID();
SET local_user=USER();
SET local_time= NOW();
INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, local_time,local_user,
local_uuid,'completed trans');
END|
delimiter ;|
--source include/tpcb_disk_data.inc
--echo ****** TEST 2 test time *********************************
USE tpcb;
@@ -372,15 +228,16 @@ SELECT COUNT(*) FROM account;
--echo ******** Run in some transactions ***************
connection master;
let $j= 1000;
let $j= 100;
--disable_query_log
while ($j)
{
CALL tpcb.trans();
eval CALL tpcb.trans($format);
dec $j;
}
--enable_query_log
--echo ***** Time to try slave sync ***********
--echo **** Must make sure slave is clean *****
--connection slave
@@ -421,11 +278,11 @@ connection master;
SELECT COUNT(*) FROM history;
let $j= 1000;
let $j= 100;
--disable_query_log
while ($j)
{
CALL tpcb.trans();
eval CALL tpcb.trans($format);
dec $j;
}
--enable_query_log
@@ -464,11 +321,11 @@ SELECT COUNT(*) FROM account;
--echo ***** Add some more records to master *********
connection master;
let $j= 1000;
let $j= 100;
--disable_query_log
while ($j)
{
CALL tpcb.trans();
eval CALL tpcb.trans($format);
dec $j;
}
--enable_query_log
@@ -484,17 +341,18 @@ while ($j)
--echo ***** Finsh the slave sync process *******
--disable_query_log
# 1. 2. 3.
--sync_slave_with_master
--source include/ndb_setup_slave.inc
--enable_query_log
# 4.
--echo * 4. *
connection master;
let $j= 1000;
let $j= 100;
--disable_query_log
while ($j)
{
CALL tpcb.trans();
eval CALL tpcb.trans($format);
dec $j;
}
--enable_query_log
@@ -507,15 +365,6 @@ START SLAVE;
--echo **** We should be ready to continue on *************
connection master;
let $j= 50;
--disable_query_log
while ($j)
{
CALL tpcb.trans();
dec $j;
}
--enable_query_log
--echo ****** Let's make sure we match *******
--echo ***** MASTER *******
USE tpcb;

View File

@@ -2,8 +2,8 @@
-- source include/have_ndb.inc
-- source include/have_innodb.inc
-- source include/have_binlog_format_row.inc
-- source include/ndb_master-slave.inc
-- source include/have_log_bin.inc
create table t1 (a int, unique(a)) engine=ndbcluster;
create table t2 (a int, unique(a)) engine=innodb;

View File

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

View File

@@ -0,0 +1,36 @@
#############################################
#Authors: TU and Jeb
#Date: 2007/04
#Purpose: Generic replication to cluster
# and ensuring that the ndb_apply_status
# table is updated.
#############################################
# Notes:
# include/select_ndb_apply_status.inc
# Selects out the log name, start & end pos
# from the ndb_apply_status table
#
# include/show_binlog_using_logname.inc
# To select out 1 row from offset 1
# from the start position in the binlog whose
# name is = log_name
#
# include/tpcb.inc
# Creates DATABASE tpcb, the tables and
# stored procedures for loading the DB
# and for running transactions against DB.
##############################################
## Includes ##
--disable_query_log
--source include/have_ndb.inc
--source include/have_innodb.inc
--source include/have_binlog_format_mixed.inc
--source include/ndb_master-slave.inc
--enable_query_log
let $off_set = 9;
let $rpl_format = 'MIX';
--source extra/rpl_tests/rpl_ndb_apply_status.test

View File

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

View File

@@ -1,70 +1,35 @@
#############################################
#Authors: TU and Jeb
#Date: 2007/04
#Purpose: Generic replication to cluster
# and ensuring that the ndb_apply_status
# table is updated.
#############################################
# Notes:
# include/select_ndb_apply_status.inc
# Selects out the log name, start & end pos
# from the ndb_apply_status table
#
# include/show_binlog_using_logname.inc
# To select out 1 row from offset 1
# from the start position in the binlog whose
# name is = log_name
#
# include/tpcb.inc
# Creates DATABASE tpcb, the tables and
# stored procedures for loading the DB
# and for running transactions against DB.
##############################################
## Includes ##
--disable_query_log
--source include/have_ndb.inc
--source include/have_innodb.inc
--source include/have_binlog_format_mixed_or_statement.inc
--source include/have_binlog_format_statement.inc
--source include/ndb_master-slave.inc
--connection master
create table t1 (a int key, b int) engine innodb;
create table t2 (a int key, b int) engine innodb;
--sync_slave_with_master
--connection slave
alter table t1 engine ndb;
alter table t2 engine ndb;
# We need MIXED mode on the slave in the event that there are
# statements coming in from the master. In this case, NDB can only
# handle row-based format, so it has to be possible to switch to
# this.
STOP SLAVE;
SET GLOBAL BINLOG_FORMAT=MIXED;
START SLAVE;
# check binlog position without begin
--connection master
insert into t1 values (1,2);
--sync_slave_with_master
--connection slave
--replace_column 1 <start_pos> 2 <end_pos>
select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
--let $start_pos = `select @start_pos`
--let $end_pos = `select @end_pos`
--connection master
# here is actually a bug, since there is no begin statement, the
# query is autocommitted, and end_pos shows end of the insert and not
# end of the commit
--replace_result $start_pos <start_pos>
--replace_column 5 #
--eval show binlog events from $start_pos limit 1
--replace_result $start_pos <start_pos> $end_pos <end_pos>
--replace_column 2 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $start_pos limit 1,1
# check binlog position with begin
--connection master
begin;
insert into t1 values (2,3);
insert into t2 values (3,4);
commit;
--sync_slave_with_master
--connection slave
--replace_column 1 <start_pos> 2 <end_pos>
select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
--let $start_pos = `select @start_pos`
--let $end_pos = `select @end_pos`
--connection master
--replace_result $start_pos <start_pos>
--replace_column 5 #
--eval show binlog events from $start_pos limit 1
--replace_result $start_pos <start_pos>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $start_pos limit 1,2
--replace_result $start_pos <start_pos> $end_pos <end_pos>
--replace_column 2 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--eval show binlog events from $start_pos limit 3,1
--enable_query_log
let $off_set = 6;
let $rpl_format = 'SBR';
--source extra/rpl_tests/rpl_ndb_apply_status.test

View File

@@ -1,5 +1,4 @@
-- source include/have_ndb.inc
-- source include/have_binlog_format_row.inc
#
# Bug#20573 Strict mode auto-increment