mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
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.
This commit is contained in:
parent
c3cb46908c
commit
f3c3c9c341
3 changed files with 40 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue