summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <mats@mysql.com>2006-05-11 11:14:15 +0200
committerunknown <mats@mysql.com>2006-05-11 11:14:15 +0200
commit6ca368ebdc6ad5fc5f42a316cf2b80d43bca0a79 (patch)
treec4b1d58d3eb3b4f11bcfd9ffdb003d09998a9dcb
parentc27d98b575fd55b6ba5974c20bd0bd3e788e6819 (diff)
parent464538acab3b47a4c16a4c3809a67832ca1366ee (diff)
downloadmariadb-git-6ca368ebdc6ad5fc5f42a316cf2b80d43bca0a79.tar.gz
Merge mysqldev@production.mysql.com:my/mysql-5.1-release
into mysql.com:/home/bk/b17400-mysql-5.1-new sql/log_event.cc: Auto merged
-rw-r--r--mysql-test/r/rpl_bit_npk.result68
-rw-r--r--mysql-test/t/disabled.def4
-rw-r--r--mysql-test/t/rpl_bit_npk.test28
-rw-r--r--mysql-test/t/rpl_ndb_innodb2ndb-slave.opt2
-rw-r--r--mysql-test/t/rpl_ndb_myisam2ndb-slave.opt2
-rw-r--r--sql/ha_ndbcluster.cc26
-rw-r--r--sql/log_event.cc72
7 files changed, 108 insertions, 94 deletions
diff --git a/mysql-test/r/rpl_bit_npk.result b/mysql-test/r/rpl_bit_npk.result
index 2850e63aabd..9599660f18f 100644
--- a/mysql-test/r/rpl_bit_npk.result
+++ b/mysql-test/r/rpl_bit_npk.result
@@ -56,86 +56,90 @@ INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4
UNLOCK TABLES;
UPDATE test.t1 set x034 = 50 where bit3 = b'000000';
UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0';
-SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
+FROM test.t1
+ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
oSupp sSuppD GSuppDf VNotSupp x034
5 5 3 NULL 1
5 5 3 2 1
-5 5 3 33 1
5 5 3 2 50
5 5 3 33 1
5 5 3 33 1
5 5 3 33 1
5 5 3 33 1
-SELECT hex(bit1) from test.t1;
+5 5 3 33 1
+SELECT hex(bit1) from test.t1 ORDER BY bit1;
hex(bit1)
-3F
-3F
-0
-2A
0
0
0
0
-SELECT hex(bit2) from test.t1;
-hex(bit2)
-3E
0
2A
3F
+3F
+SELECT hex(bit2) from test.t1 ORDER BY bit2;
+hex(bit2)
+0
1
1
1
1
-SELECT hex(bit3) from test.t1;
+2A
+3E
+3F
+SELECT hex(bit3) from test.t1 ORDER BY bit3;
hex(bit3)
-35
-24
-15
0
1
1
1
1
-SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+15
+24
+35
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
+FROM test.t1
+ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
oSupp sSuppD GSuppDf VNotSupp x034
5 5 3 NULL 1
5 5 3 2 1
-5 5 3 33 1
5 5 3 2 50
5 5 3 33 1
5 5 3 33 1
5 5 3 33 1
5 5 3 33 1
-SELECT hex(bit1) from test.t1;
+5 5 3 33 1
+SELECT hex(bit1) from test.t1 ORDER BY bit1;
hex(bit1)
-3F
-3F
-0
-2A
0
0
0
0
-SELECT hex(bit2) from test.t1;
-hex(bit2)
-3E
0
2A
3F
+3F
+SELECT hex(bit2) from test.t1 ORDER BY bit2;
+hex(bit2)
+0
1
1
1
1
-SELECT hex(bit3) from test.t1;
+2A
+3E
+3F
+SELECT hex(bit3) from test.t1 ORDER BY bit3;
hex(bit3)
-35
-24
-15
0
1
1
1
1
+15
+24
+35
CREATE TABLE test.t2 (a INT, b BIT(1));
INSERT INTO test.t2 VALUES (1, b'0');
INSERT INTO test.t2 VALUES (1, b'1');
@@ -144,19 +148,19 @@ CREATE TABLE test.t3 (a INT, b INT);
INSERT INTO test.t3 VALUES (1, NULL);
INSERT INTO test.t3 VALUES (1, 0);
UPDATE test.t3 SET a = 2 WHERE b = 0;
-SELECT a, hex(b) FROM test.t2;
+SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
a hex(b)
1 0
2 1
-SELECT * FROM test.t3;
+SELECT * FROM test.t3 ORDER BY a,b;
a b
1 NULL
2 0
-SELECT a, hex(b) FROM test.t2;
+SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
a hex(b)
1 0
2 1
-SELECT * FROM test.t3;
+SELECT * FROM test.t3 ORDER BY a,b;
a b
1 NULL
2 0
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 288d060b2b5..7cbe4419904 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -27,9 +27,9 @@ rpl_ndb_auto_inc : BUG#17086 2006-02-16 jmiller CR: auto_increment_incre
rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
-rpl_ndb_innodb2ndb : BUG#17400 2006-04-19 tomas Cluster Replication: delete & update of rows in table without pk fails on slave.
+rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
-rpl_ndb_myisam2ndb : BUG#17400 2006-04-19 tomas Cluster Replication: delete & update of rows in table without pk fails on slave.
+rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
diff --git a/mysql-test/t/rpl_bit_npk.test b/mysql-test/t/rpl_bit_npk.test
index 07fc42b09ef..12b587919f9 100644
--- a/mysql-test/t/rpl_bit_npk.test
+++ b/mysql-test/t/rpl_bit_npk.test
@@ -70,18 +70,22 @@ UNLOCK TABLES;
UPDATE test.t1 set x034 = 50 where bit3 = b'000000';
UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0';
-SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
-SELECT hex(bit1) from test.t1;
-SELECT hex(bit2) from test.t1;
-SELECT hex(bit3) from test.t1;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
+ FROM test.t1
+ ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
+SELECT hex(bit1) from test.t1 ORDER BY bit1;
+SELECT hex(bit2) from test.t1 ORDER BY bit2;
+SELECT hex(bit3) from test.t1 ORDER BY bit3;
save_master_pos;
connection slave;
sync_with_master;
-SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
-SELECT hex(bit1) from test.t1;
-SELECT hex(bit2) from test.t1;
-SELECT hex(bit3) from test.t1;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
+ FROM test.t1
+ ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
+SELECT hex(bit1) from test.t1 ORDER BY bit1;
+SELECT hex(bit2) from test.t1 ORDER BY bit2;
+SELECT hex(bit3) from test.t1 ORDER BY bit3;
connection master;
CREATE TABLE test.t2 (a INT, b BIT(1));
@@ -94,14 +98,14 @@ INSERT INTO test.t3 VALUES (1, NULL);
INSERT INTO test.t3 VALUES (1, 0);
UPDATE test.t3 SET a = 2 WHERE b = 0;
-SELECT a, hex(b) FROM test.t2;
-SELECT * FROM test.t3;
+SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
+SELECT * FROM test.t3 ORDER BY a,b;
save_master_pos;
connection slave;
sync_with_master;
-SELECT a, hex(b) FROM test.t2;
-SELECT * FROM test.t3;
+SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
+SELECT * FROM test.t3 ORDER BY a,b;
connection master;
DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt b/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt
index f47e5a7e98f..d6f11dcd7bc 100644
--- a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt
+++ b/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt
@@ -1 +1 @@
---binlog-format=row --default-storage-engine=ndb
+--binlog-format=row --default-storage-engine=ndbcluster
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt b/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt
index f31d53c3cb1..b7990823676 100644
--- a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt
+++ b/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt
@@ -1 +1 @@
---default-storage-engine=ndb --binlog-format=row
+--default-storage-engine=ndbcluster --binlog-format=row
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 89b9ed93d69..5a1d4f48c9b 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -2875,7 +2875,7 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
MY_BITMAP *defined, byte *buf)
{
Field **p_field= table->field, *field= *p_field;
- uint row_offset= (uint) (buf - table->record[0]);
+ my_ptrdiff_t row_offset= buf - table->record[0];
DBUG_ENTER("ndb_unpack_record");
// Set null flag(s)
@@ -2906,24 +2906,34 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
}
else if (field->type() == MYSQL_TYPE_BIT)
{
- byte *save_field_ptr= field->ptr;
- field->ptr= save_field_ptr + row_offset;
+ Field_bit *field_bit= static_cast<Field_bit*>(field);
+
+ /*
+ Move internal field pointer to point to 'buf'. Calling
+ the correct member function directly since we know the
+ type of the object.
+ */
+ field_bit->Field_bit::move_field_offset(row_offset);
if (field->pack_length() < 5)
{
DBUG_PRINT("info", ("bit field H'%.8X",
(*value).rec->u_32_value()));
- ((Field_bit*) field)->store((longlong)
- (*value).rec->u_32_value(), FALSE);
+ field_bit->Field_bit::store((longlong) (*value).rec->u_32_value(),
+ FALSE);
}
else
{
DBUG_PRINT("info", ("bit field H'%.8X%.8X",
*(Uint32*) (*value).rec->aRef(),
*((Uint32*) (*value).rec->aRef()+1)));
- ((Field_bit*) field)->store((longlong)
- (*value).rec->u_64_value(),TRUE);
+ field_bit->Field_bit::store((longlong) (*value).rec->u_64_value(),
+ TRUE);
}
- field->ptr= save_field_ptr;
+ /*
+ Move back internal field pointer to point to original
+ value (usually record[0]).
+ */
+ field_bit->Field_bit::move_field_offset(-row_offset);
DBUG_PRINT("info",("[%u] SET",
(*value).rec->getColumn()->getColumnNo()));
DBUG_DUMP("info", (const char*) field->ptr, field->field_length);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index e958056291f..ab9fa2975a1 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6416,12 +6416,17 @@ static int find_and_fetch_row(TABLE *table, byte *key)
if (table->s->keys > 0)
{
int error;
- /*
- We need to set the null bytes to ensure that the filler bit
- are all set when returning. There are storage engines that
- just set the necessary bits on the bytes and don't set the
- filler bits correctly.
- */
+ /* We have a key: search the table using the index */
+ if (!table->file->inited)
+ if ((error= table->file->ha_index_init(0, FALSE)))
+ return error;
+
+ /*
+ We need to set the null bytes to ensure that the filler bit are
+ all set when returning. There are storage engines that just set
+ the necessary bits on the bytes and don't set the filler bits
+ correctly.
+ */
my_ptrdiff_t const pos=
table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
table->record[1][pos]= 0xFF;
@@ -6430,6 +6435,7 @@ static int find_and_fetch_row(TABLE *table, byte *key)
HA_READ_KEY_EXACT)))
{
table->file->print_error(error, MYF(0));
+ table->file->ha_index_end();
DBUG_RETURN(error);
}
@@ -6448,7 +6454,10 @@ static int find_and_fetch_row(TABLE *table, byte *key)
chose the row to change only using a PK or an UNNI.
*/
if (table->key_info->flags & HA_NOSAME)
+ {
+ table->file->ha_index_end();
DBUG_RETURN(0);
+ }
while (record_compare(table))
{
@@ -6465,15 +6474,26 @@ static int find_and_fetch_row(TABLE *table, byte *key)
if ((error= table->file->index_next(table->record[1])))
{
table->file->print_error(error, MYF(0));
+ table->file->ha_index_end();
DBUG_RETURN(error);
}
}
+
+ /*
+ Have to restart the scan to be able to fetch the next row.
+ */
+ table->file->ha_index_end();
}
else
{
- /* Continue until we find the right record or have made a full loop */
int restart_count= 0; // Number of times scanning has restarted from top
- int error= 0;
+ int error;
+
+ /* We don't have a key: search the table using rnd_next() */
+ if ((error= table->file->ha_rnd_init(1)))
+ return error;
+
+ /* Continue until we find the right record or have made a full loop */
do
{
/*
@@ -6499,11 +6519,17 @@ static int find_and_fetch_row(TABLE *table, byte *key)
default:
table->file->print_error(error, MYF(0));
+ table->file->ha_rnd_end();
DBUG_RETURN(error);
}
}
while (restart_count < 2 && record_compare(table));
+ /*
+ Have to restart the scan to be able to fetch the next row.
+ */
+ table->file->ha_rnd_end();
+
DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);
DBUG_RETURN(error);
}
@@ -6626,20 +6652,6 @@ 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;
@@ -6651,11 +6663,6 @@ 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;
}
@@ -6736,17 +6743,6 @@ int Update_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);
- }
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
return error;