After merge fixes.

This commit is contained in:
ingo/mydev@chilla.local 2006-07-21 10:43:10 +02:00
parent 18a76a953c
commit 84f3623b3d
3 changed files with 27 additions and 27 deletions

View file

@ -1603,6 +1603,22 @@ fld_cid fld_name fld_parentid fld_delt
5 Torkel 0 0
DROP TABLE federated.t1;
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;
create table federated.t1 (a int, b int, c int);
drop table if exists federated.t1;
@ -1717,22 +1733,6 @@ id c1 c2
9 abc ppc
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 DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;

View file

@ -1396,6 +1396,7 @@ drop table t1;
# for ON INSERT triggers only. Tests for other types of triggers reside
# in ndb_trigger.test.
#
connection slave;
--disable_warnings
drop table if exists federated.t1;
--enable_warnings

View file

@ -1775,7 +1775,7 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
it.
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
and updated timestamp field. You can do these for federated by doing these:
if (table->timestamp_on_update_now)
@ -1801,7 +1801,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
this.
*/
bool has_a_primary_key= test(table->s->primary_key != MAX_KEY);
/*
/*
buffers for following strings
*/
char field_value_buffer[STRING_BUFFER_USUAL_SIZE];
@ -1820,7 +1820,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
sizeof(where_buffer),
&my_charset_bin);
DBUG_ENTER("ha_federated::update_row");
/*
/*
set string lengths to 0 to avoid misc chars in string
*/
field_value.length(0);
@ -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))
{
update_string.append((*field)->field_name);
update_string.append(FEDERATED_EQ);
if ((*field)->is_null())
update_string.append(FEDERATED_NULL);
else
@ -1859,11 +1862,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
field_value.length(0);
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);
new_field_value.length(0);
}
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)
else
{
where_string.append(FEDERATED_EQ);
(*field)->val_str(&old_field_value,
(*field)->val_str(&field_value,
(char*) (old_data + (*field)->offset()));
(*field)->quote_data(&old_field_value);
where_string.append(old_field_value);
old_field_value.length(0);
(*field)->quote_data(&field_value);
where_string.append(field_value);
field_value.length(0);
}
where_string.append(FEDERATED_AND);
}