Skip to content

Commit 71a5857

Browse files
committed
cleanup: move precedence tests into precedence_bugs.test
1 parent 2cd5df8 commit 71a5857

File tree

8 files changed

+61
-51
lines changed

8 files changed

+61
-51
lines changed

mysql-test/r/func_math.result

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,8 +1766,3 @@ select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1);
17661766
select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678');
17671767
CRC32(NULL) CRC32('') CRC32('MySQL') CRC32('mysql') CRC32('01234567') CRC32('012345678')
17681768
NULL 0 3259397556 2501908538 763378421 939184570
1769-
explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1);
1770-
id select_type table type possible_keys key key_len ref rows filtered Extra
1771-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
1772-
Warnings:
1773-
Note 1003 select 3 - 2 + 1 AS `(3-2)+1`,3 / 2 * 1 AS `(3/2)*1`,3 - (2 + 1) AS `3-(2+1)`,3 / (2 * 1) AS `3/(2*1)`

mysql-test/r/func_test.result

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,6 @@ NULL
273273
select mod(NULL, 2.0) as 'NULL';
274274
NULL
275275
NULL
276-
create table t1 (a int, b int);
277-
insert into t1 values (1,2), (2,3), (3,4), (4,5);
278-
select * from t1 where a not between 1 and 2;
279-
a b
280-
3 4
281-
4 5
282-
select * from t1 where a not between 1 and 2 and b not between 3 and 4;
283-
a b
284-
4 5
285-
drop table t1;
286276
SELECT GREATEST(1,NULL) FROM DUAL;
287277
GREATEST(1,NULL)
288278
NULL

mysql-test/r/precedence_bugs.result

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,41 @@
11
#
2+
# Bug#6726: NOT BETWEEN parse failure
3+
#
4+
create table t1 (a int, b int);
5+
insert into t1 values (1,2), (2,3), (3,4), (4,5);
6+
select * from t1 where a not between 1 and 2;
7+
a b
8+
3 4
9+
4 5
10+
select * from t1 where a not between 1 and 2 and b not between 3 and 4;
11+
a b
12+
4 5
13+
drop table t1;
14+
#
15+
# MDEV-13673 Bad result in view
16+
#
17+
explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1);
18+
id select_type table type possible_keys key key_len ref rows filtered Extra
19+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
20+
Warnings:
21+
Note 1003 select 3 - 2 + 1 AS `(3-2)+1`,3 / 2 * 1 AS `(3/2)*1`,3 - (2 + 1) AS `3-(2+1)`,3 / (2 * 1) AS `3/(2*1)`
22+
#
23+
# MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s)
24+
#
25+
create table t1 (i int, j int);
26+
insert t1 values (1,1),(2,2);
27+
create view v1 as select (2, 3) not in (select i, j from t1);
28+
select * from v1;
29+
(2, 3) not in (select i, j from t1)
30+
1
31+
show create view v1;
32+
View v1
33+
Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select !((2,3) in (select `t1`.`i`,`t1`.`j` from `t1`)) AS `(2, 3) not in (select i, j from t1)`
34+
character_set_client latin1
35+
collation_connection latin1_swedish_ci
36+
drop view v1;
37+
drop table t1;
38+
#
239
# MDEV-23656 view: removal of parentheses results in wrong result
340
#
441
create table t1 (a int, b decimal(10,2));

mysql-test/r/view.result

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6649,17 +6649,6 @@ INSERT INTO v (f1, f3) VALUES (1,1), (2,2);
66496649
ERROR HY000: Can not modify more than one base table through a join view 'test.v'
66506650
drop view v;
66516651
drop tables t1,t2,t3;
6652-
create table t1 (i int, j int);
6653-
insert t1 values (1,1),(2,2);
6654-
create view v1 as select (2, 3) not in (select i, j from t1);
6655-
select * from v1;
6656-
(2, 3) not in (select i, j from t1)
6657-
1
6658-
show create view v1;
6659-
View Create View character_set_client collation_connection
6660-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select !((2,3) in (select `t1`.`i`,`t1`.`j` from `t1`)) AS `(2, 3) not in (select i, j from t1)` latin1 latin1_swedish_ci
6661-
drop view v1;
6662-
drop table t1;
66636652
#
66646653
# MDEV-10704: Assertion `field->field->table == table_arg'
66656654
# failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&,

mysql-test/t/func_math.test

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,3 @@ select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1);
792792
--echo #
793793

794794
select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678');
795-
796-
#
797-
# MDEV-13673 Bad result in view
798-
#
799-
explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1);

mysql-test/t/func_test.test

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,6 @@ select mod(NULL, 2) as 'NULL';
141141
select mod(NULL, 2.0) as 'NULL';
142142

143143

144-
#
145-
# Bug#6726: NOT BETWEEN parse failure
146-
#
147-
create table t1 (a int, b int);
148-
insert into t1 values (1,2), (2,3), (3,4), (4,5);
149-
select * from t1 where a not between 1 and 2;
150-
select * from t1 where a not between 1 and 2 and b not between 3 and 4;
151-
drop table t1;
152-
153144
#
154145
# Test for bug #12791: one of the arguments of LEAST/GREATEST is NULL
155146
#

mysql-test/t/precedence_bugs.test

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
--echo #
2+
--echo # Bug#6726: NOT BETWEEN parse failure
3+
--echo #
4+
create table t1 (a int, b int);
5+
insert into t1 values (1,2), (2,3), (3,4), (4,5);
6+
select * from t1 where a not between 1 and 2;
7+
select * from t1 where a not between 1 and 2 and b not between 3 and 4;
8+
drop table t1;
9+
10+
--echo #
11+
--echo # MDEV-13673 Bad result in view
12+
--echo #
13+
explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1);
14+
15+
--echo #
16+
--echo # MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s)
17+
--echo #
18+
create table t1 (i int, j int);
19+
insert t1 values (1,1),(2,2);
20+
create view v1 as select (2, 3) not in (select i, j from t1);
21+
select * from v1;
22+
query_vertical show create view v1;
23+
drop view v1;
24+
drop table t1;
125

226
--echo #
327
--echo # MDEV-23656 view: removal of parentheses results in wrong result

mysql-test/t/view.test

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6362,17 +6362,6 @@ INSERT INTO v (f1, f3) VALUES (1,1), (2,2);
63626362
drop view v;
63636363
drop tables t1,t2,t3;
63646364

6365-
#
6366-
# MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s)
6367-
#
6368-
create table t1 (i int, j int);
6369-
insert t1 values (1,1),(2,2);
6370-
create view v1 as select (2, 3) not in (select i, j from t1);
6371-
select * from v1;
6372-
show create view v1;
6373-
drop view v1;
6374-
drop table t1;
6375-
63766365
--echo #
63776366
--echo # MDEV-10704: Assertion `field->field->table == table_arg'
63786367
--echo # failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&,

0 commit comments

Comments
 (0)