diff options
author | unknown <jimw@mysql.com> | 2006-06-26 16:59:52 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2006-06-26 16:59:52 -0700 |
commit | f3c3c9c34189a5ccdacf62aec50e55c197223148 (patch) | |
tree | 84961f642176c7b7f9ebabf891de929435990458 /mysql-test/t/federated.test | |
parent | c3cb46908c30895e0aafa0f7602370240a3c5a98 (diff) | |
download | mariadb-git-f3c3c9c34189a5ccdacf62aec50e55c197223148.tar.gz |
Bug #16494: Updates that set a column to NULL fail sometimes
When building the UPDATE query to send to the remote server, the
federated storage engine built the query incorrectly if it was updating
a field to be NULL.
Thanks to Bjrn Steinbrink for an initial patch for the problem.
mysql-test/r/federated.result:
Add new results
mysql-test/t/federated.test:
Add new regression test
sql/ha_federated.cc:
Fix logic of how fields are added to SET and WHERE clauses of an
UPDATE statement. Fields that were NULL were being handled incorrectly.
Also reorganizes the code a little bit so the update of the two
clauses is consistent.
Diffstat (limited to 'mysql-test/t/federated.test')
-rw-r--r-- | mysql-test/t/federated.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 80b31c610a2..d24caf1aa08 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1309,5 +1309,22 @@ DROP TABLE federated.t1; connection slave; DROP TABLE federated.bug_17377_table; +# +# Bug #16494: Updates that set a column to NULL fail sometimes +# +connection slave; +create table t1 (id int not null auto_increment primary key, val int); +connection master; +eval create table t1 + (id int not null auto_increment primary key, val int) engine=federated + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +insert into t1 values (1,0),(2,0); +update t1 set val = NULL where id = 1; +select * from t1; +connection slave; +select * from t1; +drop table t1; +connection master; +drop table t1; source include/federated_cleanup.inc; |