summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2005-07-16 10:30:25 +0300
committerunknown <timour@mysql.com>2005-07-16 10:30:25 +0300
commit7adfe96d9ebb3428550aeab79f08f5395d0ac44c (patch)
tree9dbce5da93f1f67a1d13bf76921230c0b8e8ef49 /mysql-test/r/select.result
parentb6f3a373700dcfa676a5d9a3c93e63267b6b389a (diff)
downloadmariadb-git-7adfe96d9ebb3428550aeab79f08f5395d0ac44c.tar.gz
Added test for Bug #11521
"Negative integer keys incorrectly substituted for 0 during range analysis." The problem is that the range optimizer incorrectly replaces any negative constant with '0' for all types except BIGINT because the method save_in_field() casts negative integers to non-negative. This causes incorrect query results where (0 = any_negative_number). The problem caused by this bug is fixed by the patch for BUG#11185. That patch constitutes an optimization due to which the problem code is never called with negative constants. This patch adds a test so we are sure that the problem does not reappear. mysql-test/r/select.result: Test for BUG#11521. mysql-test/t/select.test: Test for BUG#11521.
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 5c0616f9e54..6c9ec9d8297 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2570,3 +2570,15 @@ f2
1
NULL
drop table t1,t2;
+create table t2 (a tinyint unsigned);
+create index t2i on t2(a);
+insert into t2 values (0), (254), (255);
+explain select * from t2 where a > -1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index
+select * from t2 where a > -1;
+a
+0
+254
+255
+drop table t2;