diff options
author | unknown <patg@govinda.patg.net> | 2006-07-17 16:45:04 -0700 |
---|---|---|
committer | unknown <patg@govinda.patg.net> | 2006-07-17 16:45:04 -0700 |
commit | 4e06ba9f79725b4ec67be75403f9ea6fae8c2cbf (patch) | |
tree | 56999ccaddd110568aa40c01eb4b66814bfd6257 /mysql-test/t/federated.test | |
parent | 07a13bd9a339b296cadd917212b24c3b953b5a22 (diff) | |
download | mariadb-git-4e06ba9f79725b4ec67be75403f9ea6fae8c2cbf.tar.gz |
"BUG #18764: Delete conditions causing inconsistencies in Federated tables"
Removed logic in ha_federated::write_row, which checks field query ids in the
loop which builds the query to run on the remote server.
mysql-test/r/federated.result:
"BUG #18764: Delete conditions causing inconsistencies in Federated tables"
New test results for test that verifies that one can insert to rows using
"insert into... select * from..", delete
them by id, then immediately insert them in the same way they were originally
inserted.
mysql-test/t/federated.test:
"BUG #18764: Delete conditions causing inconsistencies in Federated tables"
New test that verifies that one can insert to rows using
"insert into... select * from..", delete
them by id, then immediately insert them in the same way they were originally
inserted.
sql/ha_federated.cc:
"BUG #18764: Delete conditions causing inconsistencies in Federated tables"
Removed the logic in ha_federated::write_row which checked the query id of
each field and compared it to the thread query id.
Each field has a query id, and the problem used to be that if I did an insert
no fields specified, the field value would contain the last inserted value
for that field. The way to work around this was to see if the query id for
that field was the same as the current query id or of the rest of the field
query ids. If it wasn't, that told me the query didn't have the field value
specified.
Somewhere from when I wrote that code to now the problem went away, and there
was no longer the need for this logic.
Also removed the bool "has_fields", which needs not exist and using
table->s->fields is sufficient.
Diffstat (limited to 'mysql-test/t/federated.test')
-rw-r--r-- | mysql-test/t/federated.test | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index a8b16edc80a..d6efb870e55 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1365,4 +1365,61 @@ drop table federated.t1, federated.t2; connection slave; drop table federated.t1, federated.t2; +# +# BUG #18764: Delete conditions causing inconsistencies in Federated tables +# +connection slave; +--disable_warnings +DROP TABLE IF EXISTS federated.test; +--enable_warnings +CREATE TABLE federated.test ( + `id` int(11) NOT NULL, + `val1` varchar(255) NOT NULL, + `val2` varchar(255) NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +connection master; +--disable_warnings +DROP TABLE IF EXISTS federated.test_local; +DROP TABLE IF EXISTS federated.test_remote; +--enable_warnings +CREATE TABLE federated.test_local ( + `id` int(11) NOT NULL, + `val1` varchar(255) NOT NULL, + `val2` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +INSERT INTO federated.test_local VALUES (1, 'foo', 'bar'), +(2, 'bar', 'foo'); + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.test_remote ( + `id` int(11) NOT NULL, + `val1` varchar(255) NOT NULL, + `val2` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test'; + +insert into federated.test_remote select * from federated.test_local; + +select * from federated.test_remote; + +delete from federated.test_remote where id in (1,2); + +insert into federated.test_remote select * from federated.test_local; + +select * from federated.test_remote; +--disable_warnings +DROP TABLE federated.test_local; +DROP TABLE federated.test_remote; +--enable_warnings + +connection slave; +--disable_warnings +DROP TABLE federated.test; +--enable_warnings + source include/federated_cleanup.inc; |