diff options
author | Sergey Vojtovich <svoj@sun.com> | 2009-09-10 11:58:13 +0500 |
---|---|---|
committer | Sergey Vojtovich <svoj@sun.com> | 2009-09-10 11:58:13 +0500 |
commit | 48ecd65c52f37ba970c0a7e4a74ce9c0f2a11375 (patch) | |
tree | 564fe9681266ab3518d0541a0f87ee06388fe68a | |
parent | eb7a3fc9cbd0ef7138cb72890fe8e196dd82d83c (diff) | |
parent | a7de20574749ececbe8492f340f6ddc7be1544fa (diff) | |
download | mariadb-git-48ecd65c52f37ba970c0a7e4a74ce9c0f2a11375.tar.gz |
Local merge.
-rw-r--r-- | mysql-test/r/archive.result | 11 | ||||
-rw-r--r-- | mysql-test/t/archive.test | 13 | ||||
-rw-r--r-- | storage/archive/ha_archive.cc | 2 |
3 files changed, 25 insertions, 1 deletions
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 3271e2f46d4..e865d775c6a 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12706,3 +12706,14 @@ INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; DATA_LENGTH AVG_ROW_LENGTH 8700 4350 DROP TABLE t1; +SET @save_join_buffer_size= @@join_buffer_size; +SET @@join_buffer_size= 8228; +CREATE TABLE t1(a CHAR(255)) ENGINE=archive; +INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), +('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), +('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +SELECT COUNT(t1.a) FROM t1, t1 a, t1 b, t1 c, t1 d, t1 e; +COUNT(t1.a) +729 +DROP TABLE t1; +SET @@join_buffer_size= @save_join_buffer_size; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index afb8e413b2c..aad3d19455d 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1610,3 +1610,16 @@ INSERT INTO t1 VALUES(1, 'sampleblob1'),(2, 'sampleblob2'); SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; DROP TABLE t1; + +# +# BUG#46961 - archive engine loses rows during self joining select! +# +SET @save_join_buffer_size= @@join_buffer_size; +SET @@join_buffer_size= 8228; +CREATE TABLE t1(a CHAR(255)) ENGINE=archive; +INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), + ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), + ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +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; diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 49bf036c5a6..981814628f9 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -993,6 +993,7 @@ int ha_archive::rnd_init(bool scan) /* We rewind the file so that we can read from the beginning if scan */ if (scan) { + scan_rows= stats.records; DBUG_PRINT("info", ("archive will retrieve %llu rows", (unsigned long long) scan_rows)); @@ -1461,7 +1462,6 @@ int ha_archive::info(uint flag) stats.records= share->rows_recorded; pthread_mutex_unlock(&share->mutex); - scan_rows= stats.records; stats.deleted= 0; DBUG_PRINT("ha_archive", ("Stats rows is %d\n", (int)stats.records)); |