diff options
author | unknown <msvensson@devsrv-b.mysql.com> | 2006-02-28 11:17:40 +0100 |
---|---|---|
committer | unknown <msvensson@devsrv-b.mysql.com> | 2006-02-28 11:17:40 +0100 |
commit | 701b69914421935de129ea9c7e4ce8cc0afe1969 (patch) | |
tree | 213fe06b059798792c4838652be50d0d2c9915fe /mysql-test/t/federated.test | |
parent | 85e54a08c4fc468ab89f8df27bc981027cb22e6c (diff) | |
download | mariadb-git-701b69914421935de129ea9c7e4ce8cc0afe1969.tar.gz |
Bug#17377 Federated Engine returns wrong Data, always the rows with the highest ID
- Always make rnd_pos reposition the cursor in the fetched result set.
mysql-test/r/federated.result:
Update test result
mysql-test/t/federated.test:
Add test for bug#17377
sql/ha_federated.cc:
Remove the "scan_flag" variable. rnd_pos should always move to a new position in the result set.
The "scan" flag in rnd_init will protect from the old result set being
closed and a new fecthed. I think the "scan_flag" was added before check of the "scan" argument in rnd_init was added.
sql/ha_federated.h:
Remove class variable "scan_flag"
Diffstat (limited to 'mysql-test/t/federated.test')
-rw-r--r-- | mysql-test/t/federated.test | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index d1e03f8a05a..80b31c610a2 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1255,4 +1255,59 @@ INSERT INTO federated.t1 VALUES (); SELECT LAST_INSERT_ID(); SELECT * FROM federated.t1; +# +# Bug#17377 Federated Engine returns wrong Data, always the rows +# with the highest ID +# + +connection slave; + +--disable_warnings +DROP TABLE IF EXISTS federated.bug_17377_table; +--enable_warnings + +CREATE TABLE federated.bug_17377_table ( +`fld_cid` bigint(20) NOT NULL auto_increment, +`fld_name` varchar(255) NOT NULL default '', +`fld_parentid` bigint(20) NOT NULL default '0', +`fld_delt` int(1) NOT NULL default '0', +PRIMARY KEY (`fld_cid`), +KEY `fld_parentid` (`fld_parentid`), +KEY `fld_delt` (`fld_delt`), +KEY `fld_cid` (`fld_cid`) +) ENGINE=MyISAM; + +# Insert some test-data +insert into federated.bug_17377_table( fld_name ) +values +("Mats"), ("Sivert"), ("Sigvard"), ("Torgny"), ("Torkel"); + +connection master; +--disable_warnings +DROP TABLE IF EXISTS federated.t1; +--enable_warnings + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.t1 ( +`fld_cid` bigint(20) NOT NULL auto_increment, +`fld_name` varchar(255) NOT NULL default '', +`fld_parentid` bigint(20) NOT NULL default '0', +`fld_delt` int(1) NOT NULL default '0', +PRIMARY KEY (`fld_cid`), +KEY `fld_parentid` (`fld_parentid`), +KEY `fld_delt` (`fld_delt`), +KEY `fld_cid` (`fld_cid`) +) ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/bug_17377_table'; + +select * from federated.t1 where fld_parentid=0 and fld_delt=0 +order by fld_name; + +select * from federated.t1 where fld_parentid=0 and fld_delt=0; + +DROP TABLE federated.t1; +connection slave; +DROP TABLE federated.bug_17377_table; + + source include/federated_cleanup.inc; |