diff options
author | unknown <igor@rurik.mysql.com> | 2005-06-28 07:27:00 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2005-06-28 07:27:00 -0700 |
commit | 1031b871e7d3e5458d026f1811f671c5fd611212 (patch) | |
tree | b88928a6011b1b2b5c7b855d1d711f9ab095b124 /mysql-test/t/range.test | |
parent | 1d937708e8255bf9fb11f90bfc23f9321bf23bd3 (diff) | |
download | mariadb-git-1031b871e7d3e5458d026f1811f671c5fd611212.tar.gz |
range.result, range.test:
Added a test case for bug #10031.
opt_range.cc:
Fixed bug #10031: range condition was not used with
views. Range analyzer did not take into account that
view columns were always referred through Item_ref.
sql/opt_range.cc:
Fixed bug #10031: range condition was not used with
views. Range analyzer did not take into account that
view columns were always referred through Item_ref.
mysql-test/t/range.test:
Added a test case for bug #10031.
mysql-test/r/range.result:
Added a test case for bug #10031.
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r-- | mysql-test/t/range.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index a285a4b312c..3d2285b1633 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -530,3 +530,26 @@ SELECT * FROM t1 WHERE status NOT BETWEEN 'A' AND 'B'; SELECT * FROM t1 WHERE status < 'A' OR status > 'B'; DROP TABLE t1; + +# +# Test for bug #10031: range to be used over a view +# + +CREATE TABLE t1 (a int, b int, primary key(a,b)); + +INSERT INTO t1 VALUES + (1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3),(4,1),(4,2),(4,3); + +CREATE VIEW v1 as SELECT a,b FROM t1 WHERE b=3; + +EXPLAIN SELECT a,b FROM t1 WHERE a < 2 and b=3; +EXPLAIN SELECT a,b FROM v1 WHERE a < 2 and b=3; + +EXPLAIN SELECT a,b FROM t1 WHERE a < 2; +EXPLAIN SELECT a,b FROM v1 WHERE a < 2; + +SELECT a,b FROM t1 WHERE a < 2 and b=3; +SELECT a,b FROM v1 WHERE a < 2 and b=3; + +DROP VIEW v1; +DROP TABLE t1; |