diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-12-29 22:29:02 +0100 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-12-29 22:29:02 +0100 |
commit | d9fcec5acdbe5aa06428dfbb9b828ebef845e7ca (patch) | |
tree | 96f5c41ff90fbef130a09e858e225f572d37f0e6 | |
parent | 3759df08ebb51c4af8afa961215407d71fe58ae5 (diff) | |
download | mariadb-git-d9fcec5acdbe5aa06428dfbb9b828ebef845e7ca.tar.gz |
Make test results stable (they weren't, because filesort() used to read
from a heap temptable, which uses pointers to records (that is, byte*
pointers) as rowids.
This meant that for rows with the same sort key value, the order
was determined by memory layout.
-rw-r--r-- | mysql-test/r/fulltext_order_by.result | 36 | ||||
-rw-r--r-- | mysql-test/t/fulltext_order_by.test | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result index 2085e7ea885..9203f40ba6c 100644 --- a/mysql-test/r/fulltext_order_by.result +++ b/mysql-test/r/fulltext_order_by.result @@ -44,24 +44,24 @@ a FORMAT(MATCH (message) AGAINST ('steve'),6) SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 7 1 -SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; -a rel -1 0.000000 -5 0.000000 -2 0.000000 -6 0.000000 -3 0.000000 -7 0.895690 -4 0.905873 -SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; -a rel -1 0 -2 0 -3 0 -5 0 -6 0 -4 1 -7 1 +SELECT IF(a=7,'steve-is-cool',IF(a=4,'cool', 'other')), FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; +IF(a=7,'steve-is-cool',IF(a=4,'cool', 'other')) rel +other 0.000000 +other 0.000000 +other 0.000000 +other 0.000000 +other 0.000000 +steve-is-cool 0.895690 +cool 0.905873 +SELECT IF(a=7,'steve-is-cool',IF(a=4,'cool', 'other')), MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; +IF(a=7,'steve-is-cool',IF(a=4,'cool', 'other')) rel +other 0 +other 0 +other 0 +other 0 +other 0 +steve-is-cool 1 +cool 1 alter table t1 add key m (message); explain SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message; id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test index 814cd4a5954..6a5c7eb1615 100644 --- a/mysql-test/t/fulltext_order_by.test +++ b/mysql-test/t/fulltext_order_by.test @@ -28,8 +28,8 @@ SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATC SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1; # ORDER BY MATCH -SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; -SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; +SELECT IF(a=7,'steve-is-cool',IF(a=4,'cool', 'other')), FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; +SELECT IF(a=7,'steve-is-cool',IF(a=4,'cool', 'other')), MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; # # BUG#6635 - test_if_skip_sort_order() thought it can skip filesort |