#At file:///data/z/mysql-next-mr-runtime/ based on revid:alik@stripped
2942 Magne Mahre 2009-11-25
Bug#40677 Archive tables joined on primary return no result
Select queries on archive tables when joined on their primary keys
returns no results(empty set)
Archive storage doesn't inform the handler about the fetched record
status when it is found. Fixed the archive storage engine to update
the record status when it fetches successfully
modified:
mysql-test/r/archive.result
mysql-test/t/archive.test
storage/archive/ha_archive.cc
=== modified file 'mysql-test/r/archive.result'
--- a/mysql-test/r/archive.result 2009-09-10 06:58:13 +0000
+++ b/mysql-test/r/archive.result 2009-11-25 18:29:52 +0000
@@ -12717,3 +12717,13 @@ COUNT(t1.a)
729
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
+End of 5.1 tests
+CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(128) NOT NULL, PRIMARY KEY(id)) ENGINE=archive;
+INSERT INTO t1 VALUES(NULL,'a'),(NULL,'a');
+CREATE TABLE t2(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(128) NOT NULL, PRIMARY KEY(id)) ENGINE=archive;
+INSERT INTO t2 VALUES(NULL,'b'),(NULL,'b');
+SELECT t1.id, t2.id, t1.name, t2.name FROM t1,t2 WHERE t1.id = t2.id;
+id id name name
+1 1 a b
+2 2 a b
+DROP TABLE t1,t2;
=== modified file 'mysql-test/t/archive.test'
--- a/mysql-test/t/archive.test 2009-09-10 06:58:13 +0000
+++ b/mysql-test/t/archive.test 2009-11-25 18:29:52 +0000
@@ -1623,3 +1623,15 @@ INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaa
SELECT COUNT(t1.a) FROM t1, t1 a, t1 b, t1 c, t1 d, t1 e;
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
+
+--echo End of 5.1 tests
+
+#
+# BUG#40677 - Archive tables joined on primary return no result
+#
+CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(128) NOT NULL, PRIMARY KEY(id)) ENGINE=archive;
+INSERT INTO t1 VALUES(NULL,'a'),(NULL,'a');
+CREATE TABLE t2(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(128) NOT NULL, PRIMARY KEY(id)) ENGINE=archive;
+INSERT INTO t2 VALUES(NULL,'b'),(NULL,'b');
+SELECT t1.id, t2.id, t1.name, t2.name FROM t1,t2 WHERE t1.id = t2.id;
+DROP TABLE t1,t2;
=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc 2009-11-24 13:54:59 +0000
+++ b/storage/archive/ha_archive.cc 2009-11-25 18:29:52 +0000
@@ -953,7 +953,11 @@ int ha_archive::index_read_idx(uchar *bu
}
if (found)
+ {
+ /* notify handler that a record has been found */
+ table->status= 0;
DBUG_RETURN(0);
+ }
error:
DBUG_RETURN(rc ? rc : HA_ERR_END_OF_FILE);
Attachment: [text/bzr-bundle] bzr/magne.mahre@sun.com-20091125182952-c6132cjnfc0uj0qo.bundle
| Thread |
|---|
| • bzr commit into mysql-5.6-next-mr branch (magne.mahre:2942) Bug#40677 | Magne Mahre | 25 Nov |