After merge fixes.

parent 18a76a95
...@@ -1603,6 +1603,22 @@ fld_cid fld_name fld_parentid fld_delt ...@@ -1603,6 +1603,22 @@ fld_cid fld_name fld_parentid fld_delt
5 Torkel 0 0 5 Torkel 0 0
DROP TABLE federated.t1; DROP TABLE federated.t1;
DROP TABLE federated.bug_17377_table; DROP TABLE federated.bug_17377_table;
create table t1 (id int not null auto_increment primary key, val int);
create table t1
(id int not null auto_increment primary key, val int) engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
insert into t1 values (1,0),(2,0);
update t1 set val = NULL where id = 1;
select * from t1;
id val
1 NULL
2 0
select * from t1;
id val
1 NULL
2 0
drop table t1;
drop table t1;
drop table if exists federated.t1; drop table if exists federated.t1;
create table federated.t1 (a int, b int, c int); create table federated.t1 (a int, b int, c int);
drop table if exists federated.t1; drop table if exists federated.t1;
...@@ -1717,22 +1733,6 @@ id c1 c2 ...@@ -1717,22 +1733,6 @@ id c1 c2
9 abc ppc 9 abc ppc
drop table federated.t1, federated.t2; drop table federated.t1, federated.t2;
drop table federated.t1, federated.t2; drop table federated.t1, federated.t2;
create table t1 (id int not null auto_increment primary key, val int);
create table t1
(id int not null auto_increment primary key, val int) engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
insert into t1 values (1,0),(2,0);
update t1 set val = NULL where id = 1;
select * from t1;
id val
1 NULL
2 0
select * from t1;
id val
1 NULL
2 0
drop table t1;
drop table t1;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated; DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
......
...@@ -1396,6 +1396,7 @@ drop table t1; ...@@ -1396,6 +1396,7 @@ drop table t1;
# for ON INSERT triggers only. Tests for other types of triggers reside # for ON INSERT triggers only. Tests for other types of triggers reside
# in ndb_trigger.test. # in ndb_trigger.test.
# #
connection slave;
--disable_warnings --disable_warnings
drop table if exists federated.t1; drop table if exists federated.t1;
--enable_warnings --enable_warnings
......
...@@ -1775,7 +1775,7 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt) ...@@ -1775,7 +1775,7 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
it. it.
Keep in mind that the server can do updates based on ordering if an ORDER BY Keep in mind that the server can do updates based on ordering if an ORDER BY
clause was used. Consecutive ordering is not guarenteed. clause was used. Consecutive ordering is not guaranteed.
Currently new_data will not have an updated auto_increament record, or Currently new_data will not have an updated auto_increament record, or
and updated timestamp field. You can do these for federated by doing these: and updated timestamp field. You can do these for federated by doing these:
if (table->timestamp_on_update_now) if (table->timestamp_on_update_now)
...@@ -1847,6 +1847,9 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) ...@@ -1847,6 +1847,9 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
{ {
if (bitmap_is_set(table->write_set, (*field)->field_index)) if (bitmap_is_set(table->write_set, (*field)->field_index))
{ {
update_string.append((*field)->field_name);
update_string.append(FEDERATED_EQ);
if ((*field)->is_null()) if ((*field)->is_null())
update_string.append(FEDERATED_NULL); update_string.append(FEDERATED_NULL);
else else
...@@ -1859,11 +1862,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) ...@@ -1859,11 +1862,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
field_value.length(0); field_value.length(0);
tmp_restore_column_map(table->read_set, old_map); tmp_restore_column_map(table->read_set, old_map);
} }
update_string.append((*field)->field_name);
update_string.append(FEDERATED_EQ);
update_string.append(new_field_value);
update_string.append(FEDERATED_COMMA); update_string.append(FEDERATED_COMMA);
new_field_value.length(0);
} }
if (bitmap_is_set(table->read_set, (*field)->field_index)) if (bitmap_is_set(table->read_set, (*field)->field_index))
...@@ -1874,11 +1873,11 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) ...@@ -1874,11 +1873,11 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
else else
{ {
where_string.append(FEDERATED_EQ); where_string.append(FEDERATED_EQ);
(*field)->val_str(&old_field_value, (*field)->val_str(&field_value,
(char*) (old_data + (*field)->offset())); (char*) (old_data + (*field)->offset()));
(*field)->quote_data(&old_field_value); (*field)->quote_data(&field_value);
where_string.append(old_field_value); where_string.append(field_value);
old_field_value.length(0); field_value.length(0);
} }
where_string.append(FEDERATED_AND); where_string.append(FEDERATED_AND);
} }
......
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