Commit c19c546d authored by unknown's avatar unknown

Post-merge fixes.

parent 2c5f063b
......@@ -1248,10 +1248,10 @@ Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 41
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
Qcache_hits 1
/**/ select * from t1;
a
/**/ select * from t1;
......@@ -1261,8 +1261,8 @@ Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 42
Qcache_inserts 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 14
Qcache_hits 2
drop table t1;
......@@ -29,10 +29,10 @@ drop table t1,t2;
CREATE TABLE t1 (
html varchar(5) default NULL,
rin int(11) default '0',
out int(11) default '0'
rout int(11) default '0'
) TYPE=MyISAM;
INSERT INTO t1 VALUES ('1',1,0);
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
html prod
1 0.00
drop table t1;
......@@ -35,7 +35,7 @@ call foo();
ERROR HY000: PROCEDURE foo does not exist
drop procedure if exists foo;
Warnings:
Warning 1272 PROCEDURE foo does not exist
Warning 1275 PROCEDURE foo does not exist
create procedure foo()
foo: loop
leave bar;
......
......@@ -46,8 +46,6 @@ alter table t8 rename t7;
rename table t7 to t9;
drop table t1;
Got one of the listed errors
Warnings:
Note 1008 Can't drop database 'test_mysqltest'; database doesn't exist
Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
......
......@@ -311,7 +311,7 @@ set sql_log_bin=1;
set sql_log_off=1;
set sql_log_update=1;
Warnings:
Note 1282 The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored.
Note 1285 The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored.
set sql_low_priority_updates=1;
set sql_max_join_size=200;
select @@sql_max_join_size,@@max_join_size;
......
......@@ -38,11 +38,11 @@ drop table t1,t2;
CREATE TABLE t1 (
html varchar(5) default NULL,
rin int(11) default '0',
out int(11) default '0'
rout int(11) default '0'
) TYPE=MyISAM;
INSERT INTO t1 VALUES ('1',1,0);
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
drop table t1;
......@@ -32,18 +32,18 @@ create function func1() returns int
return 42|
# Can't create recursively
--error 1270
--error 1273
create procedure foo()
create procedure bar() set @x=3|
--error 1270
--error 1273
create procedure foo()
create function bar() returns double return 2.3|
# Already exists
--error 1271
--error 1274
create procedure proc1()
set @x = 42|
--error 1271
--error 1274
create function func1() returns int
return 42|
......@@ -51,32 +51,32 @@ drop procedure proc1|
drop function func1|
# Does not exist
--error 1272
--error 1275
alter procedure foo|
--error 1272
--error 1275
alter function foo|
--error 1272
--error 1275
drop procedure foo|
--error 1272
--error 1275
drop function foo|
--error 1272
--error 1275
call foo()|
drop procedure if exists foo|
# LEAVE/ITERATE with no match
--error 1275
--error 1278
create procedure foo()
foo: loop
leave bar;
end loop|
--error 1275
--error 1278
create procedure foo()
foo: loop
iterate bar;
end loop|
# Redefining label
--error 1276
--error 1279
create procedure foo()
foo: loop
foo: loop
......@@ -85,14 +85,14 @@ foo: loop
end loop foo|
# End label mismatch
--error 1277
--error 1280
create procedure foo()
foo: loop
set @x=2;
end loop bar|
# Referring to undef variable
--error 1278
--error 1281
create procedure foo(out x int)
begin
declare y int;
......@@ -106,17 +106,17 @@ begin
select name from mysql.proc;
select type from mysql.proc;
end|
--error 1279
--error 1282
call foo()|
drop procedure foo|
# RETURN in FUNCTION only
--error 1280
--error 1283
create procedure foo()
return 42|
# Doesn't allow queries in FUNCTIONs (for now :-( )
--error 1281
--error 1284
create function foo() returns int
begin
declare x int;
......@@ -130,13 +130,13 @@ create procedure p(x int)
create function f(x int) returns int
return x+42|
--error 1285
--error 1288
call p()|
--error 1285
--error 1288
call p(1, 2)|
--error 1285
--error 1288
select f()|
--error 1285
--error 1288
select f(1, 2)|
drop procedure p|
......
......@@ -54,7 +54,7 @@ Item::Item():
command => we should check thd->lex.current_select on zero (thd->lex
can be uninitialised)
*/
if (thd->lex.current_select)
if (thd->lex->current_select)
{
SELECT_LEX_NODE::enum_parsing_place place=
thd->lex->current_select->parsing_place;
......
......@@ -501,7 +501,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
SELECT_LEX_UNIT *unit= select_lex->master_unit();
substitution= optimizer= new Item_in_optimizer(left_expr, this);
SELECT_LEX *current= thd->lex.current_select, *up;
SELECT_LEX *current= thd->lex->current_select, *up;
thd->lex->current_select= up= current->return_after_parsing();
//optimizer never use Item **ref => we can pass 0 as parameter
......@@ -603,7 +603,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
// fix_field of item will be done in time of substituting
substitution= item;
have_to_be_excluded= 1;
if (thd->lex.describe)
if (thd->lex->describe)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
sprintf(warn_buff, ER(ER_SELECT_REDUCED), select_lex->select_number);
......@@ -634,15 +634,15 @@ Item_in_subselect::row_value_transformer(JOIN *join,
SELECT_LEX_UNIT *unit= select_lex->master_unit();
substitution= optimizer= new Item_in_optimizer(left_expr, this);
SELECT_LEX *current= thd->lex.current_select, *up;
thd->lex.current_select= up= current->return_after_parsing();
SELECT_LEX *current= thd->lex->current_select, *up;
thd->lex->current_select= up= current->return_after_parsing();
//optimizer never use Item **ref => we can pass 0 as parameter
if (!optimizer || optimizer->fix_left(thd, up->get_table_list(), 0))
{
thd->lex.current_select= current;
thd->lex->current_select= current;
DBUG_RETURN(ERROR);
}
thd->lex.current_select= current;
thd->lex->current_select= current;
unit->dependent= 1;
}
......
......@@ -2009,7 +2009,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
before MY_INIT(). So we do it here.
*/
mysql_log.init_pthread_objects();
mysql_update_log.init_pthread_objects();
mysql_slow_log.init_pthread_objects();
mysql_bin_log.init_pthread_objects();
......
......@@ -2385,7 +2385,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
thd->server_id = ev->server_id; // use the original server id for logging
thd->set_time(); // time the query
thd->lex.current_select= 0;
thd->lex->current_select= 0;
if (!ev->when)
ev->when = time(NULL);
ev->thd = thd;
......
......@@ -77,12 +77,12 @@ eval_func_item(THD *thd, Item *it, enum enum_field_types type)
default:
{
char buffer[MAX_FIELD_WIDTH];
String tmp(buffer, sizeof(buffer), it->charset());
String tmp(buffer, sizeof(buffer), it->collation.collation);
String *s= it->val_str(&tmp);
DBUG_PRINT("info",("default result: %*s",s->length(),s->c_ptr_quick()));
it= new Item_string(thd->strmake(s->c_ptr_quick(), s->length()),
s->length(), it->charset());
s->length(), it->collation.collation);
break;
}
}
......
......@@ -3867,7 +3867,7 @@ void create_select_for_variable(const char *var_name)
DBUG_ENTER("create_select_for_variable");
thd= current_thd;
lex= &thd->lex;
lex= thd->lex;
mysql_init_select(lex);
lex->sql_command= SQLCOM_SELECT;
tmp.str= (char*) var_name;
......
......@@ -2494,7 +2494,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
tables.db = from->table_cache_key;
error=1;
if (thd->lex.select_lex->setup_ref_array(thd, order_num) ||
if (thd->lex->select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
&tables, fields, all_fields, order) ||
!(sortorder=make_unireg_sortorder(order, &length)) ||
......
......@@ -257,7 +257,7 @@ int st_select_lex_unit::exec()
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{
ha_rows rows= 0;
thd->lex.current_select= sl;
thd->lex->current_select= sl;
if (optimized)
res= sl->join->reinit();
......
......@@ -95,7 +95,7 @@ int mysql_update(THD *thd,
if (setup_tables(update_table_list) ||
setup_conds(thd,update_table_list,&conds) ||
thd->lex.select_lex->setup_ref_array(thd, order_num) ||
thd->lex->select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
&tables, all_fields, all_fields, order) ||
setup_ftfuncs(&thd->lex->select_lex))
......
......@@ -5251,10 +5251,27 @@ opt_var_ident_type:
option_value:
'@' ident_or_text equal expr
{
Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
}
| internal_variable_name equal set_expr_or_default
{
LEX *lex=Lex;
if ($1.var)
{ /* System variable */
lex->var_list.push_back(new set_var(lex->option_type, $1.var,
&$1.base_name, $3));
}
else
{ /* An SP local variable */
sp_pvar_t *spv= lex->spcont->find_pvar(&$1.base_name);
sp_instr_set *i= new sp_instr_set(lex->sphead->instructions(),
spv->offset, $3, spv->type);
lex->sphead->add_instr(i);
spv->isset= TRUE;
}
}
| internal_or_splocal
{}
| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
{
LEX *lex=Lex;
......@@ -5311,12 +5328,25 @@ option_value:
internal_variable_name:
ident
{
sys_var *tmp=find_sys_var($1.str, $1.length);
if (!tmp)
YYABORT;
$$.var= tmp;
$$.base_name.str=0;
$$.base_name.length=0;
LEX *lex= Lex;
sp_pcontext *spc= lex->spcont;
sp_pvar_t *spv;
/* We have to lookup here since local vars can shadow sysvars */
if (!spc || !(spv = spc->find_pvar(&$1)))
{ /* Not an SP local variable */
sys_var *tmp=find_sys_var($1.str, $1.length);
if (!tmp)
YYABORT;
$$.var= tmp;
$$.base_name.str=0;
$$.base_name.length=0;
}
else
{ /* An SP local variable */
$$.var= NULL;
$$.base_name= $1;
}
}
| ident '.' ident
{
......
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