diff options
author | unknown <evgen@moonbone.local> | 2005-11-03 13:53:49 +0300 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-11-03 13:53:49 +0300 |
commit | 898f6f283ddbaef5cf5ca7b723f71055330541c3 (patch) | |
tree | 4e0b76e79d5abe2f76cd882b752bd6a0f9805d0a /mysql-test/r/select.result | |
parent | 3cee9661307178e7fd0c19f12930bffa4b8336b9 (diff) | |
download | mariadb-git-898f6f283ddbaef5cf5ca7b723f71055330541c3.tar.gz |
Fix bug #14093 Query takes a lot of time when date format is not valid
Invalid date like 2000-02-32 wasn't converted to int, which lead to not
using index and comparison with field as astring, which results in slow
query execution.
convert_constatn_item() and get_mm_leaf() now forces MODE_INVALID_DATES to
allow such conversion.
sql/item.h:
Fix bug #14093 Query takes a lot of time when date format is not valid
To Item_int_with_ref added method real_item() which returns ref.
sql/item_cmpfunc.cc:
Fix bug #14093 Query takes a lot of time when date format is not valid
convert_constant_item() now allows conversion of invalid dates like 2000-01-32 to int to make it possible to use index when comparing fields with such dates.
sql/opt_range.cc:
Fix bug #14093 Query takes a lot of time when date format is not valid
get_mm_leaf() modified so it allows index usage for comparing fields with invalid dates like 2000-01-32.
mysql-test/r/select.result:
Test case for bug#14093 Query takes a lot of time when date format is not valid
mysql-test/t/select.test:
Test case for bug#14093 Query takes a lot of time when date format is not valid
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r-- | mysql-test/r/select.result | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index cd7c70b603c..7ceedea344f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3193,3 +3193,43 @@ a b c select * from t1 join t2 straight_join t3 on (t1.a=t3.c); a b c drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '2005-09-31'; +f1 f2 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '2005-09-3a'; +f1 f2 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +select * from t1 where f2 <= '2005-09-3a'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; |