Commit a7df512a authored by unknown's avatar unknown

many fixes


libmysql/libmysql.c:
  Fixes a very rare bug when variable name (without '_') and it's 
  value are at the very end of the config file.
  
  I have tested it , but would liek little mobster to test it further
mysql-test/r/union.result:
  results for union test that proves that EXPLAIN UNION bugs are fixed
mysql-test/t/union.test:
  additional tests for EXPLAIN on UNION's that have previously failed
sql/sql_yacc.yy:
  Some small fixes for newer parsers.
  Only unsigned int yystacksize remains to be fixed.
  This I leave to Monty.
  Present fixes are only aesthetic and do not harm.
parent ca218618
...@@ -737,7 +737,7 @@ static void mysql_read_default_options(struct st_mysql_options *options, ...@@ -737,7 +737,7 @@ static void mysql_read_default_options(struct st_mysql_options *options,
*end=0; /* Remove '=' */ *end=0; /* Remove '=' */
} }
/* Change all '_' in variable name to '-' */ /* Change all '_' in variable name to '-' */
for (end= *option ; (end= strcend(end,'_')) ; ) for (end= *option ; (end= strcend(end,'_')) && *end ; )
*end= '-'; *end= '-';
switch (find_type(*option+2,&option_types,2)) { switch (find_type(*option+2,&option_types,2)) {
case 1: /* port */ case 1: /* port */
......
...@@ -86,6 +86,21 @@ explain select a,b from t1 union all select a,b from t2; ...@@ -86,6 +86,21 @@ explain select a,b from t1 union all select a,b from t2;
table type possible_keys key key_len ref rows Extra table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4 t1 ALL NULL NULL NULL NULL 4
t2 ALL NULL NULL NULL NULL 4 t2 ALL NULL NULL NULL NULL 4
explain select xx from t1 union select 1;
Unknown column 'xx' in 'field list'
explain select a,b from t1 union select 1;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
0 0 No tables used
explain select 1 union select a,b from t1 union select 1;
table type possible_keys key key_len ref rows Extra
0 0 No tables used
t1 ALL NULL NULL NULL NULL 4
0 0 No tables used
explain select a,b from t1 union select 1 limit 0;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
0 0 Impossible WHERE
select a,b from t1 into outfile 'skr' union select a,b from t2; select a,b from t1 into outfile 'skr' union select a,b from t2;
Wrong usage of UNION and INTO Wrong usage of UNION and INTO
select a,b from t1 order by a union select a,b from t2; select a,b from t1 order by a union select a,b from t2;
......
...@@ -24,6 +24,12 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g ...@@ -24,6 +24,12 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
# Test some error conditions with UNION # Test some error conditions with UNION
explain select a,b from t1 union all select a,b from t2; explain select a,b from t1 union all select a,b from t2;
--error 1054
explain select xx from t1 union select 1;
explain select a,b from t1 union select 1;
explain select 1 union select a,b from t1 union select 1;
explain select a,b from t1 union select 1 limit 0;
--error 1221 --error 1221
select a,b from t1 into outfile 'skr' union select a,b from t2; select a,b from t1 into outfile 'skr' union select a,b from t2;
......
...@@ -1928,7 +1928,7 @@ opt_else: ...@@ -1928,7 +1928,7 @@ opt_else:
| ELSE expr { $$= $2; } | ELSE expr { $$= $2; }
when_list: when_list:
{ Select->when_list.push_front(new List<Item>) } { Select->when_list.push_front(new List<Item>); }
when_list2 when_list2
{ $$= Select->when_list.pop(); } { $$= Select->when_list.pop(); }
...@@ -2031,7 +2031,7 @@ opt_key_definition: ...@@ -2031,7 +2031,7 @@ opt_key_definition:
} }
key_usage_list: key_usage_list:
key_or_index { Select->interval_list.empty() } '(' key_usage_list2 ')' key_or_index { Select->interval_list.empty(); } '(' key_usage_list2 ')'
{ $$= &Select->interval_list; } { $$= &Select->interval_list; }
key_usage_list2: key_usage_list2:
...@@ -2637,7 +2637,7 @@ describe: ...@@ -2637,7 +2637,7 @@ describe:
YYABORT; YYABORT;
} }
opt_describe_column opt_describe_column
| describe_command select { Lex->select_lex.options|= SELECT_DESCRIBE }; | describe_command select { Lex->select_lex.options|= SELECT_DESCRIBE; }
describe_command: describe_command:
...@@ -3077,7 +3077,7 @@ set: ...@@ -3077,7 +3077,7 @@ set:
lex->select->select_limit=lex->thd->default_select_limit; lex->select->select_limit=lex->thd->default_select_limit;
lex->tx_isolation=lex->thd->tx_isolation; lex->tx_isolation=lex->thd->tx_isolation;
lex->option_type=0; lex->option_type=0;
lex->option_list.empty() lex->option_list.empty();
} }
option_value_list option_value_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment