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.
		
			
				
	
	
		
			98 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			98 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| select database();
 | |
| database()
 | |
| test
 | |
| select charset(database());
 | |
| charset(database())
 | |
| utf8
 | |
| select database() = "test";
 | |
| database() = "test"
 | |
| 1
 | |
| select database() = _utf8"test";
 | |
| database() = _utf8"test"
 | |
| 1
 | |
| select database() = _latin1"test";
 | |
| database() = _latin1"test"
 | |
| 1
 | |
| select user() like "%@%";
 | |
| user() like "%@%"
 | |
| 1
 | |
| select user() like _utf8"%@%";
 | |
| user() like _utf8"%@%"
 | |
| 1
 | |
| select user() like _latin1"%@%";
 | |
| user() like _latin1"%@%"
 | |
| 1
 | |
| select charset(user());
 | |
| charset(user())
 | |
| utf8
 | |
| select version()>="3.23.29";
 | |
| version()>="3.23.29"
 | |
| 1
 | |
| select version()>=_utf8"3.23.29";
 | |
| version()>=_utf8"3.23.29"
 | |
| 1
 | |
| select version()>=_latin1"3.23.29";
 | |
| version()>=_latin1"3.23.29"
 | |
| 1
 | |
| select charset(version());
 | |
| charset(version())
 | |
| utf8
 | |
| explain extended select database(), user();
 | |
| 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 database() AS `database()`,user() AS `user()`
 | |
| create table t1 (version char(40)) select database(), user(), version() as 'version';
 | |
| show create table t1;
 | |
| Table	Create Table
 | |
| t1	CREATE TABLE `t1` (
 | |
|   `database()` varchar(34) character set utf8 default NULL,
 | |
|   `user()` varchar(77) character set utf8 NOT NULL default '',
 | |
|   `version` char(40) default NULL
 | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 | |
| drop table t1;
 | |
| select charset(charset(_utf8'a')), charset(collation(_utf8'a'));
 | |
| charset(charset(_utf8'a'))	charset(collation(_utf8'a'))
 | |
| utf8	utf8
 | |
| select collation(charset(_utf8'a')), collation(collation(_utf8'a'));
 | |
| collation(charset(_utf8'a'))	collation(collation(_utf8'a'))
 | |
| utf8_general_ci	utf8_general_ci
 | |
| create table t1 select charset(_utf8'a'), collation(_utf8'a');
 | |
| show create table t1;
 | |
| Table	Create Table
 | |
| t1	CREATE TABLE `t1` (
 | |
|   `charset(_utf8'a')` varchar(64) character set utf8 NOT NULL default '',
 | |
|   `collation(_utf8'a')` varchar(64) character set utf8 NOT NULL default ''
 | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 | |
| drop table t1;
 | |
| select TRUE,FALSE,NULL;
 | |
| TRUE	FALSE	NULL
 | |
| 1	0	NULL
 | |
| create table t1 (c1 char(5)) character set=latin1;
 | |
| insert into t1 values('row 1');
 | |
| insert into t1 values('row 2');
 | |
| insert into t1 values('row 3');
 | |
| select concat(user(), '--', c1) from t1;
 | |
| concat(user(), '--', c1)
 | |
| root@localhost--row 1
 | |
| root@localhost--row 2
 | |
| root@localhost--row 3
 | |
| select concat(database(), '--', c1) from t1;
 | |
| concat(database(), '--', c1)
 | |
| test--row 1
 | |
| test--row 2
 | |
| test--row 3
 | |
| drop table t1;
 | |
| create table t1 (a char(10)) character set latin1;
 | |
| select * from t1 where a=version();
 | |
| a
 | |
| select * from t1 where a=database();
 | |
| a
 | |
| select * from t1 where a=user();
 | |
| a
 | |
| insert into t1 values ('a');
 | |
| select left(concat(a,version()),1) from t1;
 | |
| left(concat(a,version()),1)
 | |
| a
 | |
| drop table t1;
 |