diff options
author | igor@rurik.mysql.com <> | 2005-07-16 08:19:20 -0700 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2005-07-16 08:19:20 -0700 |
commit | 6ea960c8d6c8fc00a7a3a1a34e6f095117be02f4 (patch) | |
tree | a5c1d0f3c03176cf88739d5d3fb73d6b9a21f29c /mysql-test | |
parent | 8b0adacbc64f4db3accc72504336d1413dedc28b (diff) | |
download | mariadb-git-6ea960c8d6c8fc00a7a3a1a34e6f095117be02f4.tar.gz |
opt_range.cc:
Fixed bug #11853.
Corrected the code of the range optimization for
NOT IN and NOT BETWEEN.
range.test, range.result:
Fixed bug #11853.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/range.result | 24 | ||||
-rw-r--r-- | mysql-test/t/range.test | 23 |
2 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 6f9b4e41b22..e8e30b3653a 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -744,3 +744,27 @@ a b 1 3 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 (name varchar(15) NOT NULL, KEY idx(name)); +INSERT INTO t1 VALUES ('Betty'), ('Anna'); +SELECT * FROM t1; +name +Anna +Betty +DELETE FROM t1 WHERE name NOT LIKE 'A%a'; +SELECT * FROM t1; +name +Anna +DROP TABLE t1; +CREATE TABLE t1 (a int, KEY idx(a)); +INSERT INTO t1 VALUES (NULL), (1), (2), (3); +SELECT * FROM t1; +a +NULL +1 +2 +3 +DELETE FROM t1 WHERE NOT(a <=> 2); +SELECT * FROM t1; +a +2 +DROP TABLE t1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 3d2285b1633..065cef659b8 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -553,3 +553,26 @@ SELECT a,b FROM v1 WHERE a < 2 and b=3; DROP VIEW v1; DROP TABLE t1; + +# +# Bug #11853: DELETE statement with a NOT (LIKE/<=>) where condition +# for an indexed attribute +# + +CREATE TABLE t1 (name varchar(15) NOT NULL, KEY idx(name)); +INSERT INTO t1 VALUES ('Betty'), ('Anna'); + +SELECT * FROM t1; +DELETE FROM t1 WHERE name NOT LIKE 'A%a'; +SELECT * FROM t1; + +DROP TABLE t1; + +CREATE TABLE t1 (a int, KEY idx(a)); +INSERT INTO t1 VALUES (NULL), (1), (2), (3); + +SELECT * FROM t1; +DELETE FROM t1 WHERE NOT(a <=> 2); +SELECT * FROM t1; + +DROP TABLE t1; |