From 674c8165ea4b3430f397d84b0c79642de7b12ce4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 10:15:11 +0200 Subject: Bug#9112 - Merge table with composite index producing invalid results with some queries The problem was an ab-use of last_rkey_length. Formerly we saved the packed key length (of the search key) in this element. But in certain cases it got replaced by the (packed) result key length. Now we use a new element of MI_INFO to save the packed key length of the search key. myisam/mi_dbug.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Fixed the recognition of NULL values in _mi_print_key(). myisam/mi_rkey.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Saved the packed key length in a new element of MI_INFO. myisam/mi_search.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Added a comment and trace prints. myisam/myisamdef.h: Bug#9112 - Merge table with composite index producing invalid results with some queries Added a new element to store the packed key length for use by the MyISAMMRG engine. myisammrg/myrg_rkey.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Changed to use the new element of MI_INFO to get at the packed key length. mysql-test/r/merge.result: Bug#9112 - Merge table with composite index producing invalid results with some queries The test result. mysql-test/t/merge.test: Bug#9112 - Merge table with composite index producing invalid results with some queries The test case. --- mysql-test/r/merge.result | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mysql-test/r/merge.result') diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 3585b8b0018..6cfde286351 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -619,3 +619,29 @@ INSERT TABLE 't1' isn't allowed in FROM table list create table t3 engine=merge union=(t1, t2) select * from t2; INSERT TABLE 't2' isn't allowed in FROM table list drop table t1, t2; +create table t1 ( +a double(16,6), +b varchar(10), +index (a,b) +) engine=merge union=(t2,t3); +create table t2 ( +a double(16,6), +b varchar(10), +index (a,b) +) engine=myisam; +create table t3 ( +a double(16,6), +b varchar(10), +index (a,b) +) engine=myisam; +insert into t2 values ( null, ''); +insert into t2 values ( 9999999999.999999, ''); +insert into t3 select * from t2; +select min(a), max(a) from t1; +min(a) max(a) +9999999999.999998 9999999999.999998 +flush tables; +select min(a), max(a) from t1; +min(a) max(a) +9999999999.999998 9999999999.999998 +drop table t1, t2, t3; -- cgit v1.2.1