Commit 04fc2d9e authored by mats@mysql.com's avatar mats@mysql.com

Merge mysql.com:/home/bkroot/mysql-5.1-new

into  mysql.com:/home/bk/b17400-mysql-5.1-new
parents 1921fa59 405ebbf2
......@@ -41,7 +41,7 @@ SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
# Must give injector thread a little time to get update
# into the binlog other wise we will miss the update.
sleep 3;
sleep 10;
sync_slave_with_master;
--echo --- Check Update on slave ---
......
......@@ -30,7 +30,7 @@ rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of c
rpl_ndb_myisam2ndb : BUG#18094 2006-03-16 mats Slave caches invalid table definition after atlters causes select failure
rpl_ndb_relay_space : BUG#16993 2006-02-16 jmiller RBR: ALTER TABLE ZEROFILL AUTO_INCREMENT is not replicated correctly
rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
rpl_row_basic_7ndb : BUG#17400 2006-04-09 brian Cluster Replication: delete & update of rows in table without pk fails on slave.
#rpl_row_basic_7ndb : BUG#17400 2006-04-09 brian Cluster Replication: delete & update of rows in table without pk fails on slave.
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
rpl_row_inexist_tbl : BUG#18948 2006-03-09 mats Disabled since patch makes this test wait forever
......
#######################################
# Author: JBM #
# Date: 2006-03-09 #
# Purpose: To test the replication of #
# Cluster Disk Data using partitions #
#######################################
--source include/have_ndb.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
--echo --- Doing pre test cleanup ---
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_query_log
# Start by creating a logfile group
##################################
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB;
###################################################
# Create a tablespace connected to the logfile group
###################################################
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB;
#################################################################
--echo --- Start test 2 partition RANGE testing --
--echo --- Do setup --
#################################################
# Requirment: Create table that is partitioned #
# by range on year i.e. year(t) and replicate #
# basice operations such at insert, update #
# delete between 2 different storage engines #
# Alter table and ensure table is handled #
# Correctly on the slave #
#################################################
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
y YEAR, t DATE)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB
PARTITION BY RANGE (YEAR(t))
(PARTITION p0 VALUES LESS THAN (1901),
PARTITION p1 VALUES LESS THAN (1946),
PARTITION p2 VALUES LESS THAN (1966),
PARTITION p3 VALUES LESS THAN (1986),
PARTITION p4 VALUES LESS THAN (2005),
PARTITION p5 VALUES LESS THAN MAXVALUE);
--echo --- Show table on master ---
SHOW CREATE TABLE t1;
--echo --- Show table on slave --
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- Check that simple Alter statements are replicated correctly ---
ALTER TABLE t1 MODIFY vc VARCHAR(255);
--echo --- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
--echo --- Make sure that our tables on slave are still same engine ---
--echo --- and that the alter statements replicated correctly ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--enable_query_log
--source include/rpl_multi_engine3.inc
--echo --- End test 2 partition RANGE testing ---
--echo --- Do Cleanup ---
DROP TABLE IF EXISTS t1;
########################################################
--echo --- Start test 3 partition LIST testing ---
--echo --- Do setup ---
#################################################
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
y YEAR, t DATE)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB
PARTITION BY LIST(id)
(PARTITION p0 VALUES IN (2, 4),
PARTITION p1 VALUES IN (42, 142));
--echo --- Test 3 Alter to add partition ---
ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
--echo --- Show table on master ---
SHOW CREATE TABLE t1;
--echo --- Show table on slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- Check that simple Alter statements are replicated correctly ---
ALTER TABLE t1 MODIFY vc VARCHAR(255);
--echo --- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
--echo --- Make sure that our tables on slave are still same engine ---
--echo --- and that the alter statements replicated correctly ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- End test 3 partition LIST testing ---
--echo --- Do Cleanup --
DROP TABLE IF EXISTS t1;
########################################################
--echo --- Start test 4 partition HASH testing ---
--echo --- Do setup ---
#################################################
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
y YEAR, t DATE)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB
PARTITION BY HASH( YEAR(t) )
PARTITIONS 4;
--echo --- show that tables have been created correctly ---
SHOW CREATE TABLE t1;
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- Check that simple Alter statements are replicated correctly ---
ALTER TABLE t1 MODIFY vc VARCHAR(255);
--echo --- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
--echo --- Make sure that our tables on slave are still same engine ---
--echo --- and that the alter statements replicated correctly ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- End test 4 partition HASH testing ---
--echo --- Do Cleanup --
DROP TABLE IF EXISTS t1;
########################################################
--echo --- Start test 5 partition by key testing ---
--echo --- Create Table Section ---
#################################################
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
y YEAR, t DATE,PRIMARY KEY(id))
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB
PARTITION BY KEY()
PARTITIONS 4;
--echo --- Show that tables on master are ndbcluster tables ---
SHOW CREATE TABLE t1;
--echo --- Show that tables on slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
# Okay lets see how it holds up to table changes
--echo --- Check that simple Alter statements are replicated correctly ---
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
--echo --- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
--echo --- Make sure that our tables on slave are still right type ---
--echo --- and that the alter statements replicated correctly ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- Check that simple Alter statements are replicated correctly ---
ALTER TABLE t1 MODIFY vc VARCHAR(255);
--echo --- Show the new improved table on the master ---
SHOW CREATE TABLE t1;
--echo --- Make sure that our tables on slave are still same engine ---
--echo --- and that the alter statements replicated correctly ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
--echo --- Perform basic operation on master ---
--echo --- and ensure replicated correctly ---
--source include/rpl_multi_engine3.inc
--echo --- End test 5 key partition testing ---
--echo --- Do Cleanup ---
DROP TABLE IF EXISTS t1;
# End of 5.1 test case
......@@ -6579,18 +6579,6 @@ int Delete_rows_log_event::do_before_row_operations(TABLE *table)
if (!m_memory)
return HA_ERR_OUT_OF_MEM;
if (table->s->keys > 0)
{
/* We have a key: search the table using the index */
if (!table->file->inited)
error= table->file->ha_index_init(0, FALSE);
}
else
{
/* We doesn't have a key: search the table using rnd_next() */
error= table->file->ha_rnd_init(1);
}
return error;
}
......@@ -6638,6 +6626,20 @@ int Delete_rows_log_event::do_exec_row(TABLE *table)
{
DBUG_ASSERT(table != NULL);
if (table->s->keys > 0)
{
/* We have a key: search the table using the index */
if (!table->file->inited)
if (int error= table->file->ha_index_init(0, FALSE))
return error;
}
else
{
/* We doesn't have a key: search the table using rnd_next() */
if (int error= table->file->ha_rnd_init(1))
return error;
}
int error= find_and_fetch_row(table, m_key);
if (error)
return error;
......@@ -6649,6 +6651,11 @@ int Delete_rows_log_event::do_exec_row(TABLE *table)
*/
error= table->file->ha_delete_row(table->record[0]);
/*
Have to restart the scan to be able to fetch the next row.
*/
table->file->ha_index_or_rnd_end();
return error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment