From f3c3c9c34189a5ccdacf62aec50e55c197223148 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Jun 2006 16:59:52 -0700 Subject: Bug #16494: Updates that set a column to NULL fail sometimes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Bjšrn 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. --- mysql-test/t/federated.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/t/federated.test') 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; -- cgit v1.2.1