3890 Jon Olav Hauglid 2012-02-13
WL#5185 Remove deprecated 5.1 features
Follow-up patch to remove features scheduled for deletion,
but which, by mistake, were not deleted in the original patch.
This patch removes:
- SET OPTION ... (use SET ... instead)
- ONE_SHOT keyword (usage removed by original patch)
Also updates test cases and mysqldump which used the
old SET OPTION syntax.
modified:
client/mysqldump.c
mysql-test/r/group_by.result
mysql-test/r/query_cache.result
mysql-test/r/sp-code.result
mysql-test/r/type_blob.result
mysql-test/suite/opt_trace/r/general2_no_prot.result
mysql-test/suite/opt_trace/r/general2_ps_prot.result
mysql-test/t/group_by.test
mysql-test/t/query_cache.test
mysql-test/t/type_blob.test
sql/lex.h
sql/sql_yacc.yy
tests/mysql_client_test.c
3889 Tor Didriksen 2012-02-13
WL#6160 filesort optimization: use std::stable_sort rather than quicksort
Post-push fix: change sort result.
modified:
mysql-test/suite/funcs_1/r/myisam_views-big.result
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c 2012-01-17 03:54:44 +0000
+++ b/client/mysqldump.c 2012-02-13 15:23:37 +0000
@@ -2501,7 +2501,7 @@ static uint get_table_structure(char *ta
verbose_msg("-- Retrieving table structure for table %s...\n", table);
len= my_snprintf(query_buff, sizeof(query_buff),
- "SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
+ "SET SQL_QUOTE_SHOW_CREATE=%d",
(opt_quoted || opt_keywords));
if (!create_options)
strmov(query_buff+len,
@@ -5172,7 +5172,7 @@ static my_bool get_view_structure(char *
verbose_msg("-- Retrieving view structure for table %s...\n", table);
#ifdef NOT_REALLY_USED_YET
- sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
+ sprintf(insert_pat,"SET SQL_QUOTE_SHOW_CREATE=%d",
(opt_quoted || opt_keywords));
#endif
=== modified file 'mysql-test/r/group_by.result'
--- a/mysql-test/r/group_by.result 2012-02-06 12:47:30 +0000
+++ b/mysql-test/r/group_by.result 2012-02-13 15:23:37 +0000
@@ -512,7 +512,7 @@ a count(*)
NULL 9
3
b 1
-set option big_tables=1;
+set big_tables=1;
select a,count(*) from t1 group by a;
a count(*)
NULL 9
=== modified file 'mysql-test/r/query_cache.result'
--- a/mysql-test/r/query_cache.result 2011-11-10 06:37:03 +0000
+++ b/mysql-test/r/query_cache.result 2012-02-13 15:23:37 +0000
@@ -650,14 +650,14 @@ select * from t1;
a
1
2
-SET OPTION SQL_SELECT_LIMIT=1;
+SET SQL_SELECT_LIMIT=1;
select * from t1;
a
1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
-SET OPTION SQL_SELECT_LIMIT=DEFAULT;
+SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
flush query cache;
reset query cache;
=== modified file 'mysql-test/r/sp-code.result'
--- a/mysql-test/r/sp-code.result 2011-09-20 12:13:07 +0000
+++ b/mysql-test/r/sp-code.result 2012-02-13 15:23:37 +0000
@@ -847,7 +847,7 @@ drop procedure if exists p_20906_b;
create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
show procedure code p_20906_a;
Pos Instruction
-0 stmt 31 "SET @a=@a+1"
+0 stmt 31 "SET @a=@a+1"
1 stmt 31 "SET @b=@b+1"
set @a=1;
set @b=1;
@@ -858,7 +858,7 @@ select @a, @b;
create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
show procedure code p_20906_b;
Pos Instruction
-0 stmt 31 "SET @a=@a+1"
+0 stmt 31 "SET @a=@a+1"
1 stmt 31 "SET @b=@b+1"
2 stmt 31 "SET @c=@c+1"
set @a=1;
=== modified file 'mysql-test/r/type_blob.result'
--- a/mysql-test/r/type_blob.result 2011-07-19 15:11:15 +0000
+++ b/mysql-test/r/type_blob.result 2012-02-13 15:23:37 +0000
@@ -232,7 +232,7 @@ HELLO
HELLO MY
a
hello
-set option big_tables=1;
+set big_tables=1;
select distinct t from t1;
t
NULL
@@ -313,7 +313,7 @@ HELLO
HELLO MY
a
hello
-set option big_tables=0;
+set big_tables=0;
select distinct * from t1;
t c b d
NULL NULL NULL NULL
=== modified file 'mysql-test/suite/opt_trace/r/general2_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_no_prot.result 2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_no_prot.result 2012-02-13 15:23:37 +0000
@@ -1669,7 +1669,7 @@ insert into t1 values(3) {
"steps": [
] /* steps */
} 0 0
-SET @a=(select count(a) from t1 where a>0) {
+SET @a=(select count(a) from t1 where a>0) {
"steps": [
{
"join_preparation": {
@@ -1927,7 +1927,7 @@ jump_if_not 11(15) (case_expr@0 = 2) {
"steps": [
] /* steps */
} 0 0
-SET @b=2 {
+SET @b=2 {
"steps": [
] /* steps */
} 0 0
=== modified file 'mysql-test/suite/opt_trace/r/general2_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_ps_prot.result 2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_ps_prot.result 2012-02-13 15:23:37 +0000
@@ -1685,7 +1685,7 @@ insert into t1 values(3) {
"steps": [
] /* steps */
} 0 0
-SET @a=(select count(a) from t1 where a>0) {
+SET @a=(select count(a) from t1 where a>0) {
"steps": [
{
"join_preparation": {
@@ -1943,7 +1943,7 @@ jump_if_not 11(15) (case_expr@0 = 2) {
"steps": [
] /* steps */
} 0 0
-SET @b=2 {
+SET @b=2 {
"steps": [
] /* steps */
} 0 0
=== modified file 'mysql-test/t/group_by.test'
--- a/mysql-test/t/group_by.test 2012-01-30 13:57:08 +0000
+++ b/mysql-test/t/group_by.test 2012-02-13 15:23:37 +0000
@@ -390,7 +390,7 @@ drop table t1,t2,t3;
create table t1 (a blob null);
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
select a,count(*) from t1 group by a;
-set option big_tables=1;
+set big_tables=1;
select a,count(*) from t1 group by a;
drop table t1;
=== modified file 'mysql-test/t/query_cache.test'
--- a/mysql-test/t/query_cache.test 2011-11-10 06:37:03 +0000
+++ b/mysql-test/t/query_cache.test 2012-02-13 15:23:37 +0000
@@ -438,10 +438,10 @@ create table t1 (a int);
insert into t1 values (1),(2);
show status like "Qcache_queries_in_cache";
select * from t1;
-SET OPTION SQL_SELECT_LIMIT=1;
+SET SQL_SELECT_LIMIT=1;
select * from t1;
show status like "Qcache_queries_in_cache";
-SET OPTION SQL_SELECT_LIMIT=DEFAULT;
+SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
#
=== modified file 'mysql-test/t/type_blob.test'
--- a/mysql-test/t/type_blob.test 2010-11-01 09:52:05 +0000
+++ b/mysql-test/t/type_blob.test 2012-02-13 15:23:37 +0000
@@ -112,7 +112,7 @@ select distinct t from t1 order by t;
select distinct b from t1 order by b;
select t from t1 group by t;
select b from t1 group by b;
-set option big_tables=1;
+set big_tables=1;
select distinct t from t1;
select distinct b from t1;
select distinct t from t1 order by t;
@@ -123,7 +123,7 @@ select distinct c from t1 order by c;
select distinct d from t1 order by d;
select c from t1 group by c;
select d from t1 group by d;
-set option big_tables=0;
+set big_tables=0;
select distinct * from t1;
select t,count(*) from t1 group by t;
select b,count(*) from t1 group by b;
=== modified file 'sql/lex.h'
--- a/sql/lex.h 2011-11-04 16:07:37 +0000
+++ b/sql/lex.h 2012-02-13 15:23:37 +0000
@@ -396,7 +396,6 @@ static SYMBOL symbols[] = {
{ "OLD_PASSWORD", SYM(OLD_PASSWORD)},
{ "ON", SYM(ON)},
{ "ONE", SYM(ONE_SYM)},
- { "ONE_SHOT", SYM(ONE_SHOT_SYM)},
{ "OPEN", SYM(OPEN_SYM)},
{ "OPTIMIZE", SYM(OPTIMIZE)},
{ "OPTIONS", SYM(OPTIONS_SYM)},
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2012-02-13 09:45:43 +0000
+++ b/sql/sql_yacc.yy 2012-02-13 15:23:37 +0000
@@ -1227,7 +1227,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token OFFSET_SYM
%token OLD_PASSWORD
%token ON /* SQL-2003-R */
-%token ONE_SHOT_SYM
%token ONE_SYM
%token OPEN_SYM /* SQL-2003-R */
%token OPTIMIZE
@@ -1526,7 +1525,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
opt_temporary all_or_any opt_distinct
opt_ignore_leaves fulltext_options spatial_type union_option
start_transaction_opts
- union_opt select_derived_init option_type2
+ union_opt select_derived_init
opt_natural_language_mode opt_query_expansion
opt_ev_status opt_ev_on_completion ev_on_completion opt_ev_comment
ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
@@ -1661,7 +1660,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
ref_list opt_match_clause opt_on_update_delete use
opt_delete_options opt_delete_option varchar nchar nvarchar
opt_outer table_list table_name table_alias_ref_list table_alias_ref
- opt_option opt_place
+ opt_place
opt_attribute opt_attribute_list attribute column_list column_list_id
opt_column_list grant_privileges grant_ident grant_list grant_option
object_privilege object_privilege_list user_list rename_list
@@ -13320,7 +13319,7 @@ keyword_sp:
/* Option functions */
set:
- SET opt_option
+ SET
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SET_OPTION;
@@ -13334,11 +13333,6 @@ set:
{}
;
-opt_option:
- /* empty */ {}
- | OPTION {}
- ;
-
option_value_list:
option_type_value
| option_value_list ',' option_type_value
@@ -13372,7 +13366,15 @@ option_type_value:
lex->var_list.empty();
lex->one_shot_set= 0;
lex->autocommit= 0;
- lex->sphead->m_tmp_query= lip->get_tok_start();
+ /*
+ Extract the query statement from the tokenizer. The
+ start is either lip->ptr, if there was no lookahead,
+ lip->tok_start otherwise.
+ */
+ if (yychar == YYEMPTY)
+ lex->sphead->m_tmp_query= lip->get_ptr();
+ else
+ lex->sphead->m_tmp_query= lip->get_tok_start();
}
}
ext_option_value
@@ -13427,16 +13429,12 @@ option_type_value:
;
option_type:
- option_type2 {}
+ /* empty */ { $$= OPT_DEFAULT; }
| GLOBAL_SYM { $$=OPT_GLOBAL; }
| LOCAL_SYM { $$=OPT_SESSION; }
| SESSION_SYM { $$=OPT_SESSION; }
;
-option_type2:
- /* empty */ { $$= OPT_DEFAULT; }
- ;
-
opt_var_type:
/* empty */ { $$=OPT_SESSION; }
| GLOBAL_SYM { $$=OPT_GLOBAL; }
@@ -13453,7 +13451,7 @@ opt_var_ident_type:
ext_option_value:
sys_option_value
- | option_type2 option_value
+ | option_value
;
sys_option_value:
=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c 2011-11-21 11:58:25 +0000
+++ b/tests/mysql_client_test.c 2012-02-13 15:23:37 +0000
@@ -8193,7 +8193,7 @@ static void test_field_misc()
/*
- Test SET OPTION feature with prepare stmts
+ Test SET feature with prepare stmts
bug #85 (reported by mark@stripped)
*/
@@ -8208,7 +8208,7 @@ static void test_set_option()
mysql_autocommit(mysql, TRUE);
/* LIMIT the rows count to 2 */
- rc= mysql_query(mysql, "SET OPTION SQL_SELECT_LIMIT= 2");
+ rc= mysql_query(mysql, "SET SQL_SELECT_LIMIT= 2");
myquery(rc);
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_limit");
@@ -8249,7 +8249,7 @@ static void test_set_option()
/* RESET the LIMIT the rows count to 0 */
if (!opt_silent)
fprintf(stdout, "\n with SQL_SELECT_LIMIT=DEFAULT (prepare)");
- rc= mysql_query(mysql, "SET OPTION SQL_SELECT_LIMIT=DEFAULT");
+ rc= mysql_query(mysql, "SET SQL_SELECT_LIMIT=DEFAULT");
myquery(rc);
stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_limit");
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (jon.hauglid:3889 to 3890) WL#5185 | Jon Olav Hauglid | 14 Feb |