mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 10:56:12 +01:00 
			
		
		
		
	 401ae95a60
			
		
	
	
	401ae95a60
	
	
	
		
			
			Item_func_not_all::print() either uses Item_func::print() or directly invokes args[0]->print(). Thus the precedence should be either the one of Item_func or of args[0]. Item_allany_subselect::print() prints args[0], then a comparison op, then a subquery. That is, the precedence should be the one of a comparison.
		
			
				
	
	
		
			78 lines
		
	
	
	
		
			2.9 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
	
		
			2.9 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # Bug#6726: NOT BETWEEN parse failure
 | |
| #
 | |
| create table t1 (a int, b int);
 | |
| insert into t1 values (1,2), (2,3), (3,4), (4,5);
 | |
| select * from t1 where a not between 1 and 2;
 | |
| a	b
 | |
| 3	4
 | |
| 4	5
 | |
| select * from t1 where a not between 1 and 2 and b not between 3 and 4;
 | |
| a	b
 | |
| 4	5
 | |
| drop table t1;
 | |
| #
 | |
| # MDEV-13673 Bad result in view
 | |
| #
 | |
| explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1);
 | |
| id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 | |
| 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 | |
| Warnings:
 | |
| 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)`
 | |
| #
 | |
| # MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s)
 | |
| #
 | |
| create table t1 (i int, j int);
 | |
| insert t1 values (1,1),(2,2);
 | |
| create view v1 as select (2, 3) not in (select i, j from t1);
 | |
| select * from v1;
 | |
| (2, 3) not in (select i, j from t1)
 | |
| 1
 | |
| show create view v1;
 | |
| View	v1
 | |
| 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)`
 | |
| character_set_client	latin1
 | |
| collation_connection	latin1_swedish_ci
 | |
| drop view v1;
 | |
| drop table t1;
 | |
| #
 | |
| # MDEV-23656 view: removal of parentheses results in wrong result
 | |
| #
 | |
| create table t1 (a int, b decimal(10,2));
 | |
| insert into t1 values (1, 10.2);
 | |
| create view v1 as select avg(b) / (2 + a) from t1;
 | |
| show create view v1;
 | |
| View	v1
 | |
| Create View	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select avg(`t1`.`b`) / (2 + `t1`.`a`) AS `avg(b) / (2 + a)` from `t1`
 | |
| character_set_client	latin1
 | |
| collation_connection	latin1_swedish_ci
 | |
| drop view v1;
 | |
| drop table t1;
 | |
| #
 | |
| # MDEV-17408 VIEW is incorrectly defined for a combination of = and BETWEEN
 | |
| #
 | |
| create view v1 as select 1 like (now() between '2000-01-01' and '2012-12-12' );
 | |
| show create view v1;
 | |
| View	v1
 | |
| Create View	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 like (current_timestamp() between '2000-01-01' and '2012-12-12') AS `1 like (now() between '2000-01-01' and '2012-12-12' )`
 | |
| character_set_client	latin1
 | |
| collation_connection	latin1_swedish_ci
 | |
| drop view v1;
 | |
| #
 | |
| # MDEV-30082 View definition losing brackets changes semantics of the query and causes wrong result
 | |
| #
 | |
| create table t1 (a varchar(1), b bool) engine=myisam;
 | |
| insert into t1 values ('u',1),('s',1);
 | |
| select * from t1 where t1.b in (t1.a <= all (select 'a'));
 | |
| a	b
 | |
| create view v as select * from t1 where t1.b in (t1.a <= all (select 'a'));
 | |
| select * from v;
 | |
| a	b
 | |
| show create view v;
 | |
| View	Create View	character_set_client	collation_connection
 | |
| v	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`b` = (`t1`.`a` <= all (select 'a'))	latin1	latin1_swedish_ci
 | |
| drop view v;
 | |
| drop table t1;
 | |
| #
 | |
| # End of 10.3 results
 | |
| #
 |