List: | Commits | « Previous MessageNext Message » | |
From: | Guilhem Bichot | Date: | March 13 2009 2:10pm |
Subject: | bzr commit into mysql-6.0 branch (guilhem:2726) Bug#42297 Bug#42298 Bug#42299 Bug#42681 Bug#42683 Bug#43527 Bug#43530 Bug#43552 Bug#43620 Bug#43623 | ||
View as plain text |
#At file:///home/mysql_src/bzrrepos/mysql-6.0-maria/ based on revid:guilhem@stripped 2726 Guilhem Bichot 2009-03-13 Fix for multiple symptoms sharing the same cause: BUG#42297 Maria: crash in multi-range-read code BUG#42298 Maria: SELECT with join returns no rows BUG#42299 Maria: SELECT using cp1251-table returns no rows BUG#42681 Maria returns duplicate rows with range access on 'date type BUG#42683 Maria returns wrong results for <= NULL and <> NULL BUG#43527 Maria returns no rows on multi range access with limit clause BUG#43530 Maria has Issues with range select <>, < with -ve range values on signed index BUG#43552 Maria returned wrong rows with range access on float BUG#43620 Maria throws 'Got error 176 from storage engine' on a range query BUG#43623 Maria returns no rows with date index on range access >, >=, BETWEEN @ mysql-test/suite/maria/r/maria.result after fixing the bug, we can see one more row in the result. Ah, if we had paid attention to maria.result when we added this straight_join test, we would have caught the bug immediately. @ mysql-test/suite/maria/r/maria4.result result @ mysql-test/suite/maria/t/maria4.test test for fixed bugs. All its pieces would fail (errno 176, missing rows, too many rows) without the entire bugfix of ma_rkey.c @ storage/maria/ma_rkey.c Because of missing (), icp_res was inverted compared to the result of ma_check_index_cond(), which wasn't desired (0==0 -> 1, 1==0 -> 0). We would go to "err:" wrongly and thus pick up the value of my_errno which was left from previous functions (for example, 176 left by the ha_tina CSV log write at start of statement!); sometimes the errno would be returned to client, sometimes it would just cause a matching row to be missed. This fixed BUG#42297 BUG#42298. But was not enough for BUG#43552: - icp_res==2 was not converted to "key not found", causing non-matching rows to be returned. Now the usage of icp_res is closer to ma_rnext.c and ma_rnext_same.c. added: mysql-test/suite/maria/r/maria4.result mysql-test/suite/maria/t/maria4.test modified: mysql-test/suite/maria/r/maria.result storage/maria/ma_key.c storage/maria/ma_rkey.c === modified file 'mysql-test/suite/maria/r/maria.result' --- a/mysql-test/suite/maria/r/maria.result 2009-02-13 16:30:54 +0000 +++ b/mysql-test/suite/maria/r/maria.result 2009-03-13 14:10:43 +0000 @@ -574,6 +574,7 @@ commit; select straight_join * from t1,t2 force index (primary) where t1.a=t2.a; a a b 1 1 1 +2 2 1 unlock tables; drop table t1,t2; set autocommit=1; === added file 'mysql-test/suite/maria/r/maria4.result' --- a/mysql-test/suite/maria/r/maria4.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/maria/r/maria4.result 2009-03-13 14:10:43 +0000 @@ -0,0 +1,253 @@ +set global storage_engine=Maria; +set session storage_engine=Maria; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, filler char(200), key(a)); +insert into t2 select C.a*2, 'no' from t1 A, t1 B, t1 C; +insert into t2 select C.a*2+1, 'yes' from t1 C; +select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18); +a filler +1 yes +11 yes +13 yes +15 yes +17 yes +19 yes +3 yes +5 yes +7 yes +9 yes +drop table t1,t2; +CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b)); +INSERT INTO t1 (a, b) VALUES +( 'ppfcz1', 'DE'), ( 'ppfcz1', 'FR'); +CREATE TABLE t2 (a varchar(32), b int(11), c float, d double, +UNIQUE KEY a (a,b,c)); +INSERT INTO t2 (a, b, c, d) VALUES +( 'ppfcz1', 14, 5, 48.5), ( 'ppfcz1', 14, 6, 52.5); +SELECT t1.a,t2.a,t2.c,t2.d FROM t1, t2 +WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'; +a a c d +ppfcz1 ppfcz1 6 52.5 +drop table t1,t2; +CREATE TABLE t1(c1 FLOAT(10,5) UNSIGNED NOT NULL, c2 FLOAT(10,5) SIGNED NULL, c3 FLOAT, c4 INT, UNIQUE INDEX idx(c1,c2)); +INSERT INTO t1 VALUES('00100.05000','-00100.05000','00100.05000',1); +INSERT INTO t1(c1) VALUES('12345.000009'); +INSERT INTO t1 VALUES('99999.99999','-99999.99999','99999.99999',3); +DELETE FROM t1 WHERE c1='100000.00000' AND c2='-100000.00000'; +INSERT INTO t1 VALUES('100000.000002','-100000.000002','100000.000002',5); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 +insert into t1 values ("0.0","0.0","0.0",7),("01.0","01.0","01.0",10); +insert into t1 values ("-.1","-.1","-.1",13); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +insert into t1 values ("+111111111.11","+111111111.11","+111111111.11",19); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 +SELECT * FROM t1; +c1 c2 c3 c4 +0.00000 -0.10000 -0.1 13 +0.00000 0.00000 0 7 +1.00000 1.00000 1 10 +100.05000 -100.05000 100.05 1 +100000.00000 -100000.00000 100000 5 +100000.00000 100000.00000 111111000 19 +12345.00000 NULL NULL NULL +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2; +c1 c2 c3 c4 +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 LIMIT 2; +c1 c2 c3 c4 +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 DESC; +c1 c2 c3 c4 +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 DESC LIMIT 2; +c1 c2 c3 c4 +DROP TABLE t1; +CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, PRIMARY KEY(c1), UNIQUE INDEX(c2)); +CREATE TABLE t2(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, PRIMARY KEY(c1,c2)); +CREATE TABLE t3(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, UNIQUE INDEX idx(c1,c2)); +INSERT INTO t1 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c1' at row 2 +Note 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t2 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c1' at row 2 +Note 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t3 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c1' at row 2 +Note 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t1 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t2 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t3 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t1 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t2 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t3 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +SET TIMESTAMP=1233216687; +INSERT INTO t1 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +INSERT INTO t2 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +INSERT INTO t3 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +INSERT INTO t2 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t3 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c2' at row 2 +INSERT INTO t1 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); +INSERT INTO t3 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); +INSERT INTO t1(c1,c2) VALUES('08/01/17',NULL); +DELETE FROM t1 WHERE c1='08/01/17' AND c2 IS NULL; +INSERT INTO t1 VALUES('','','08-01-04','08/01/05') /* Inserts zero dates for '' strings */; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t2 VALUES('2008-04-31','2008-04-31','08-01-06','08/01/07') /* Inserts zero dates for invalid dates */; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t3 VALUES('10:45:15','10:45:15','08-01-08','08/1/9') /* Inserts zero dates for invalid dates */; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +INSERT INTO t2 VALUES('0000-00-00','08-01-06','08-01-06','08/01/07'); +INSERT INTO t3 VALUES('08-01-06','00-00-00','08-01-08','08/1/9'); +SELECT * FROM t1; +c1 c2 c3 c4 +0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 +1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 +1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 +1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 +1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 +1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t2; +c1 c2 c3 c4 +0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 +0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 +1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 +1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 +1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 +1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 +1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t3; +c1 c2 c3 c4 +0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 +1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 +1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 +1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 +1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 +1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 +2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1; +c1 c2 c3 c4 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; +c1 c2 c3 c4 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1; +c1 c2 c3 c4 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; +c1 c2 c3 c4 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2; +c1 c2 c3 c4 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; +c1 c2 c3 c4 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2; +c1 c2 c3 c4 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 +SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; +c1 c2 c3 c4 +1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; +c1 c2 c3 c4 +1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 +SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; +c1 c2 c3 c4 +1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 +1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 +SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2; +c1 c2 c3 c4 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 +2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 +SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 LIMIT 2; +c1 c2 c3 c4 +2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 +2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 +DROP TABLE t1,t2,t3; === added file 'mysql-test/suite/maria/t/maria4.test' --- a/mysql-test/suite/maria/t/maria4.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/maria/t/maria4.test 2009-03-13 14:10:43 +0000 @@ -0,0 +1,138 @@ +-- source include/have_maria.inc + +let $engine_type= Maria; +let $default_engine=`select @@global.storage_engine`; +eval set global storage_engine=$engine_type; +eval set session storage_engine=$engine_type; + +# We start with tests for problems which were due to the Index Condition +# Pushdown implementation. + +# BUG#42297 func_in.test failing with engine=maria +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, filler char(200), key(a)); + +insert into t2 select C.a*2, 'no' from t1 A, t1 B, t1 C; +insert into t2 select C.a*2+1, 'yes' from t1 C; +--sorted_result +select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18); + +drop table t1,t2; + +# BUG#42298 "SELECT with join returns no rows" + +# Reduced testcase used to give 1030: Got error 176 from +# storage engine +CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b)); +INSERT INTO t1 (a, b) VALUES +( 'ppfcz1', 'DE'), ( 'ppfcz1', 'FR'); +CREATE TABLE t2 (a varchar(32), b int(11), c float, d double, + UNIQUE KEY a (a,b,c)); +INSERT INTO t2 (a, b, c, d) VALUES +( 'ppfcz1', 14, 5, 48.5), ( 'ppfcz1', 14, 6, 52.5); +--sorted_result +SELECT t1.a,t2.a,t2.c,t2.d FROM t1, t2 +WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'; +drop table t1,t2; + +# BUG#43552 Maria returned wrong rows with range access on float + +CREATE TABLE t1(c1 FLOAT(10,5) UNSIGNED NOT NULL, c2 FLOAT(10,5) SIGNED NULL, c3 FLOAT, c4 INT, UNIQUE INDEX idx(c1,c2)); +INSERT INTO t1 VALUES('00100.05000','-00100.05000','00100.05000',1); +INSERT INTO t1(c1) VALUES('12345.000009'); +INSERT INTO t1 VALUES('99999.99999','-99999.99999','99999.99999',3); +DELETE FROM t1 WHERE c1='100000.00000' AND c2='-100000.00000'; +INSERT INTO t1 VALUES('100000.000002','-100000.000002','100000.000002',5); +insert into t1 values ("0.0","0.0","0.0",7),("01.0","01.0","01.0",10); +insert into t1 values ("-.1","-.1","-.1",13); +insert into t1 values ("+111111111.11","+111111111.11","+111111111.11",19); +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2; +--sorted_result +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 LIMIT 2; +--sorted_result +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 DESC; +--sorted_result +SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 DESC LIMIT 2; +DROP TABLE t1; + +# BUG#43623 Maria returns no rows with date index on range access >, +# >=, BETWEEN + +CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, PRIMARY KEY(c1), UNIQUE INDEX(c2)); +CREATE TABLE t2(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, PRIMARY KEY(c1,c2)); +CREATE TABLE t3(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, UNIQUE INDEX idx(c1,c2)); + +# As a string in either 'YYYY-MM-DD HH:MM:SS', 'YY-MM-DD HH:MM:SS', 'YYYY-MM-DD' or 'YY-MM-DD' format +INSERT INTO t1 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); +INSERT INTO t2 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); +INSERT INTO t3 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); + +# As a string with no delimiters in either 'YYYYMMDDHHMMSS', 'YYMMDDHHMMSS', 'YYYYMMDD' or 'YYMMDD' format +INSERT INTO t1 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); +INSERT INTO t2 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); +INSERT INTO t3 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); + +# As a number in either YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD or YYMMDD format +INSERT INTO t1 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); +INSERT INTO t2 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); +INSERT INTO t3 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); + +# As the result of a function +SET TIMESTAMP=1233216687; # 2009-01-29 13:41:27 +INSERT INTO t1 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); +INSERT INTO t2 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); +INSERT INTO t3 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); + +# Insert duplicates for parts of the clustered key/unique index +INSERT INTO t2 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); +INSERT INTO t3 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); + +# Insert permissible NULLs +INSERT INTO t1 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); +INSERT INTO t3 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); + +# Insert duplicate NULLs to unique column +INSERT INTO t1(c1,c2) VALUES('08/01/17',NULL); +DELETE FROM t1 WHERE c1='08/01/17' AND c2 IS NULL; + +# Insert empty string '', would be converted to zero value of the appropriate type +INSERT INTO t1 VALUES('','','08-01-04','08/01/05') /* Inserts zero dates for '' strings */; + +# Insert invalid dates, would be converted to zero value of the appropriate type +INSERT INTO t2 VALUES('2008-04-31','2008-04-31','08-01-06','08/01/07') /* Inserts zero dates for invalid dates */; +INSERT INTO t3 VALUES('10:45:15','10:45:15','08-01-08','08/1/9') /* Inserts zero dates for invalid dates */; + +# Insert zero dates +INSERT INTO t2 VALUES('0000-00-00','08-01-06','08-01-06','08/01/07'); +INSERT INTO t3 VALUES('08-01-06','00-00-00','08-01-08','08/1/9'); + +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; +--sorted_result +SELECT * FROM t3; + +SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1; +SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; +SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1; +SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; +SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2; +SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; +SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2; +SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; +SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; +SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; +SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2; +SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 LIMIT 2; +DROP TABLE t1,t2,t3; + +--disable_result_log +--disable_query_log +eval set global storage_engine=$default_engine; +--enable_result_log +--enable_query_log === modified file 'storage/maria/ma_key.c' --- a/storage/maria/ma_key.c 2009-01-25 16:59:07 +0000 +++ b/storage/maria/ma_key.c 2009-03-13 14:10:43 +0000 @@ -628,6 +628,7 @@ static int _ma_put_key_in_record(registe DBUG_RETURN(0); err: + DBUG_PRINT("info",("error")); DBUG_RETURN(1); /* Crashed row */ } /* _ma_put_key_in_record */ === modified file 'storage/maria/ma_rkey.c' --- a/storage/maria/ma_rkey.c 2008-09-05 06:10:12 +0000 +++ b/storage/maria/ma_rkey.c 2009-03-13 14:10:43 +0000 @@ -113,7 +113,7 @@ int maria_rkey(MARIA_HA *info, uchar *bu not satisfied with an out-of-range condition. */ if ((*share->row_is_visible)(info) && - (icp_res= ma_check_index_cond(info, inx, buf) != 0)) + ((icp_res= ma_check_index_cond(info, inx, buf)) != 0)) break; /* The key references a concurrently inserted record. */ @@ -158,7 +158,7 @@ int maria_rkey(MARIA_HA *info, uchar *bu } } while (!(*share->row_is_visible)(info) || - (icp_res= ma_check_index_cond(info, inx, buf) == 0)); + ((icp_res= ma_check_index_cond(info, inx, buf)) == 0)); } } if (share->lock_key_trees) @@ -166,6 +166,11 @@ int maria_rkey(MARIA_HA *info, uchar *bu if (info->cur_row.lastpos == HA_OFFSET_ERROR || (icp_res != 1)) { + if (icp_res == 2) + { + info->cur_row.lastpos= HA_OFFSET_ERROR; + my_errno= HA_ERR_KEY_NOT_FOUND; + } fast_ma_writeinfo(info); goto err; } Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20090313141043-73a6mr7hsrqm3djc.bundle
Thread | ||
---|---|---|
• bzr commit into mysql-6.0 branch (guilhem:2726) Bug#42297 Bug#42298Bug#42299 Bug#42681 Bug#42683 Bug#43527 Bug#43530 Bug#43552 Bug#43620Bug#43623 | Guilhem Bichot | 13 Mar |