mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-30 04:26:45 +03:00 
			
		
		
		
	- Filesort has an optmization where it reads only columns that are needed before the sorting is done. - When ref(_or_null) is picked by the join optimizer, it may remove parts of WHERE clause that are guaranteed to be true. - However, if we use quick select, we must put all of the range columns into the read set. Not doing so will may cause us to fail to detect the end of the range.
		
			
				
	
	
		
			24 lines
		
	
	
		
			590 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			590 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| #
 | |
| # ORDER BY handling (e.g. filesort) tests that require innodb
 | |
| #
 | |
| -- source include/have_innodb.inc
 | |
| 
 | |
| --disable_warnings
 | |
| drop table if exists t0,t1,t2,t3;
 | |
| --enable_warnings
 | |
| 
 | |
| --echo #
 | |
| --echo # MDEV-6434: Wrong result (extra rows) with ORDER BY, multiple-column index, InnoDB
 | |
| --echo #
 | |
| 
 | |
| CREATE TABLE t1 (a INT, b INT, c INT, d TEXT, KEY idx(a,b,c)) ENGINE=InnoDB;
 | |
| 
 | |
| INSERT INTO t1 (a,c) VALUES
 | |
| (8, 9),(8, 10),(13, 15),(16, 17),(16, 18),(16, 19),(20, 21),
 | |
| (20, 22),(20, 24),(20, 25),(20, 26),(20, 27),(20, 28);
 | |
| 
 | |
| SELECT  * FROM t1 WHERE a = 8 AND (b = 1 OR b IS NULL) ORDER BY c;
 | |
| 
 | |
| DROP TABLE t1;
 | |
| 
 |