mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	The problem was that we restored SQL_CACHE, SQL_NO_CACHE flags in SELECT statement from internal structures based on value set later at runtime, not the original value set by the user. The solution is to remember that original value. mysql-test/r/auto_increment.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_compress.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_math.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_system.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_time.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/information_schema.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/query_cache.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/rpl_get_lock.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/rpl_master_pos_wait.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/show_check.result: Add result for bug#17203. mysql-test/r/subselect.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/type_blob.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/variables.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/view.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/t/show_check.test: Add test case for bug#17203. sql/sql_lex.cc: Reset SELECT_LEX::sql_cache together with SELECT_LEX::options. sql/sql_lex.h: Add SELECT_LEX::sql_cache field to store original user setting. sql/sql_select.cc: Output SQL_CACHE and SQL_NO_CACHE depending on stored original user setting. sql/sql_yacc.yy: Make effect of SQL_CACHE and SQL_NO_CACHE mutually exclusive. Ignore SQL_CACHE if SQL_NO_CACHE was used. Remember what was set by the user. Reset SELECT_LEX::sql_cache together with SELECT_LEX::options.
		
			
				
	
	
		
			36 lines
		
	
	
		
			969 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			969 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| stop slave;
 | |
| drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 | |
| reset master;
 | |
| reset slave;
 | |
| drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 | |
| start slave;
 | |
| create table t1(n int);
 | |
| insert into t1 values(get_lock("lock",2));
 | |
| select get_lock("lock",2);
 | |
| get_lock("lock",2)
 | |
| 1
 | |
| select release_lock("lock");
 | |
| release_lock("lock")
 | |
| 1
 | |
| select get_lock("lock",3);
 | |
| get_lock("lock",3)
 | |
| 1
 | |
| select * from t1;
 | |
| n
 | |
| 1
 | |
| select is_free_lock("lock"), is_used_lock("lock") = connection_id();
 | |
| is_free_lock("lock")	is_used_lock("lock") = connection_id()
 | |
| 0	1
 | |
| explain extended select is_free_lock("lock"), is_used_lock("lock");
 | |
| id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 | |
| 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 | |
| Warnings:
 | |
| Note	1003	select is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")`
 | |
| select is_free_lock("lock2");
 | |
| is_free_lock("lock2")
 | |
| 1
 | |
| select is_free_lock(NULL);
 | |
| is_free_lock(NULL)
 | |
| NULL
 | |
| drop table t1;
 |