Commit afe2186e authored by unknown's avatar unknown

Post-merge fixes.

parent 214ad828
......@@ -808,17 +808,17 @@ Qcache_hits 6
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
DROP TABLE t1;
drop table t1;
create table t1 (a int);
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 48
Qcache_inserts 8
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
Qcache_hits 6
/**/ select * from t1;
a
/**/ select * from t1;
......@@ -828,10 +828,9 @@ Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 49
Qcache_inserts 9
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
drop table t1;
Qcache_hits 7
DROP TABLE t1;
SET GLOBAL query_cache_size=0;
......@@ -35,7 +35,7 @@ call foo();
ERROR HY000: PROCEDURE foo does not exist
drop procedure if exists foo;
Warnings:
Warning 1282 PROCEDURE foo does not exist
Warning 1286 PROCEDURE foo does not exist
create procedure foo()
foo: loop
leave bar;
......
......@@ -606,7 +606,7 @@ create procedure hndlr4()
begin
declare x int default 0;
declare val int; # No default
declare continue handler for 1306 set x=1;
declare continue handler for 1310 set x=1;
select data into val from test.t3 where id='z' limit 1; # No hits
insert into test.t3 values ('z', val);
end;
......@@ -619,7 +619,7 @@ drop procedure hndlr4;
create procedure cur1()
begin
declare done int default 0;
declare continue handler for 1306 set done = 1;
declare continue handler for 1310 set done = 1;
declare c cursor for select * from test.t2;
declare a char(16);
declare b int;
......@@ -646,7 +646,7 @@ create table t3 ( s char(16), i int );
create procedure cur2()
begin
declare done int default 0;
declare continue handler for 1306 set done = 1;
declare continue handler for 1310 set done = 1;
declare c1 cursor for select id,data from test.t1;
declare c2 cursor for select i from test.t2;
open c1;
......
......@@ -32,18 +32,18 @@ create function func1() returns int
return 42|
# Can't create recursively
--error 1280
--error 1284
create procedure foo()
create procedure bar() set @x=3|
--error 1280
--error 1284
create procedure foo()
create function bar() returns double return 2.3|
# Already exists
--error 1281
--error 1285
create procedure proc1()
set @x = 42|
--error 1281
--error 1285
create function func1() returns int
return 42|
......@@ -51,37 +51,37 @@ drop procedure proc1|
drop function func1|
# Does not exist
--error 1282
--error 1286
alter procedure foo|
--error 1282
--error 1286
alter function foo|
--error 1282
--error 1286
drop procedure foo|
--error 1282
--error 1286
drop function foo|
--error 1282
--error 1286
call foo()|
drop procedure if exists foo|
# LEAVE/ITERATE with no match
--error 1285
--error 1289
create procedure foo()
foo: loop
leave bar;
end loop|
--error 1285
--error 1289
create procedure foo()
foo: loop
iterate bar;
end loop|
--error 1285
--error 1289
create procedure foo()
foo: begin
iterate foo;
end|
# Redefining label
--error 1286
--error 1290
create procedure foo()
foo: loop
foo: loop
......@@ -90,14 +90,14 @@ foo: loop
end loop foo|
# End label mismatch
--error 1287
--error 1291
create procedure foo()
foo: loop
set @x=2;
end loop bar|
# Referring to undef variable
--error 1288
--error 1292
create procedure foo(out x int)
begin
declare y int;
......@@ -111,17 +111,17 @@ begin
select name from mysql.proc;
select type from mysql.proc;
end|
--error 1289
--error 1293
call foo()|
drop procedure foo|
# RETURN in FUNCTION only
--error 1290
--error 1294
create procedure foo()
return 42|
# Doesn't allow queries in FUNCTIONs (for now :-( )
--error 1291
--error 1295
create function foo() returns int
begin
declare x int;
......@@ -135,19 +135,19 @@ create procedure p(x int)
create function f(x int) returns int
return x+42|
--error 1295
--error 1299
call p()|
--error 1295
--error 1299
call p(1, 2)|
--error 1295
--error 1299
select f()|
--error 1295
--error 1299
select f(1, 2)|
drop procedure p|
drop function f|
--error 1296
--error 1300
create procedure p(val int, out res int)
begin
declare x int default 0;
......@@ -161,7 +161,7 @@ begin
end if;
end|
--error 1296
--error 1300
create procedure p(val int, out res int)
begin
declare x int default 0;
......@@ -176,7 +176,7 @@ begin
end if;
end|
--error 1297
--error 1301
create function f(val int) returns int
begin
declare x int;
......@@ -194,12 +194,12 @@ begin
end if;
end|
--error 1298
--error 1302
select f(10)|
drop function f|
--error 1299
--error 1303
create procedure p()
begin
declare c cursor for insert into test.t1 values ("foo", 42);
......@@ -208,7 +208,7 @@ begin
close c;
end|
--error 1300
--error 1304
create procedure p()
begin
declare x int;
......@@ -218,7 +218,7 @@ begin
close c;
end|
--error 1301
--error 1305
create procedure p()
begin
declare c cursor for select * from test.t;
......@@ -240,7 +240,7 @@ begin
open c;
close c;
end|
--error 1302
--error 1306
call p()|
drop procedure p|
......@@ -252,11 +252,11 @@ begin
close c;
close c;
end|
--error 1303
--error 1307
call p()|
drop procedure p|
--error 1282
--error 1286
alter procedure bar3 sql security invoker|
--error 1059
alter procedure bar3 name
......@@ -270,7 +270,7 @@ drop table if exists t1|
create table t1 (val int, x float)|
insert into t1 values (42, 3.1), (19, 1.2)|
--error 1304
--error 1308
create procedure p()
begin
declare c cursor for select * from t1;
......@@ -290,7 +290,7 @@ begin
fetch c into x;
close c;
end|
--error 1305
--error 1309
call p()|
drop procedure p|
......@@ -305,34 +305,34 @@ begin
fetch c into x, y, z;
close c;
end|
--error 1305
--error 1309
call p()|
drop procedure p|
--error 1307
--error 1311
create procedure p(in x int, x char(10))
begin
end|
--error 1307
--error 1311
create function p(x int, x char(10))
begin
end|
--error 1308
--error 1312
create procedure p()
begin
declare x float;
declare x int;
end|
--error 1309
--error 1313
create procedure p()
begin
declare c condition for 1064;
declare c condition for 1065;
end|
--error 1310
--error 1314
create procedure p()
begin
declare c cursor for select * from t1;
......
......@@ -727,7 +727,7 @@ create procedure hndlr4()
begin
declare x int default 0;
declare val int; # No default
declare continue handler for 1306 set x=1;
declare continue handler for 1310 set x=1;
select data into val from test.t3 where id='z' limit 1; # No hits
......@@ -746,7 +746,7 @@ drop procedure hndlr4|
create procedure cur1()
begin
declare done int default 0;
declare continue handler for 1306 set done = 1;
declare continue handler for 1310 set done = 1;
declare c cursor for select * from test.t2;
declare a char(16);
declare b int;
......@@ -775,7 +775,7 @@ create table t3 ( s char(16), i int )|
create procedure cur2()
begin
declare done int default 0;
declare continue handler for 1306 set done = 1;
declare continue handler for 1310 set done = 1;
declare c1 cursor for select id,data from test.t1;
declare c2 cursor for select i from test.t2;
......
......@@ -127,7 +127,7 @@ void send_error(THD *thd, uint sql_errno, const char *err)
thd->net.report_error= 0;
/* Abort multi-result sets */
thd->lex.found_colon= 0;
thd->lex->found_colon= 0;
thd->server_status= ~SERVER_MORE_RESULTS_EXISTS;
DBUG_VOID_RETURN;
}
......
......@@ -454,6 +454,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
suv= new Item_func_set_user_var(guv->get_name(), item);
suv->fix_fields(thd, NULL, &item);
suv->fix_length_and_dec();
suv->check();
suv->update();
}
}
......
......@@ -108,7 +108,7 @@ THD::THD():user_time(0), is_fatal_error(0),
used_tables=0;
cuted_fields= sent_row_count= current_stmt_id= 0L;
// Must be reset to handle error with THD's created for init of mysqld
lex.current_select= 0;
lex->current_select= 0;
start_time=(time_t) 0;
current_linfo = 0;
slave_thread = 0;
......
......@@ -66,8 +66,8 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
DBUG_RETURN(1);
}
if (thd->lex.duplicates == DUP_IGNORE)
thd->lex.select_lex.no_error= 1;
if (thd->lex->duplicates == DUP_IGNORE)
thd->lex->select_lex.no_error= 1;
/* Test if the user wants to delete all rows */
if (!using_limit && const_cond && (!conds || conds->val_int()) &&
......
......@@ -1876,7 +1876,7 @@ mysql_execute_command(THD *thd)
char buff[1024];
String str(buff,(uint32) sizeof(buff), system_charset_info);
str.length(0);
thd->lex.unit.print(&str);
thd->lex->unit.print(&str);
str.append('\0');
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_YES, str.ptr());
......
......@@ -1586,7 +1586,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
goto err; // 1
}
if (thd->lex.describe & DESCRIBE_EXTENDED)
if (thd->lex->describe & DESCRIBE_EXTENDED)
{
join->conds_history= join->conds;
join->having_history= (join->having?join->having:join->tmp_having);
......@@ -1597,7 +1597,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
join->exec();
if (thd->lex.describe & DESCRIBE_EXTENDED)
if (thd->lex->describe & DESCRIBE_EXTENDED)
{
select_lex->where= join->conds_history;
select_lex->having= join->having_history;
......@@ -9095,8 +9095,8 @@ void st_select_lex::print(THD *thd, String *str)
//options
if (options & SELECT_STRAIGHT_JOIN)
str->append("straight_join ", 14);
if ((thd->lex.lock_option & TL_READ_HIGH_PRIORITY) &&
(this == &thd->lex.select_lex))
if ((thd->lex->lock_option & TL_READ_HIGH_PRIORITY) &&
(this == &thd->lex->select_lex))
str->append("high_priority ", 14);
if (options & SELECT_DISTINCT)
str->append("distinct ", 9);
......@@ -9108,7 +9108,7 @@ void st_select_lex::print(THD *thd, String *str)
str->append("buffer_result ", 14);
if (options & OPTION_FOUND_ROWS)
str->append("calc_found_rows ", 16);
if (!thd->lex.safe_to_cache_query)
if (!thd->lex->safe_to_cache_query)
str->append("no_cache ", 9);
if (options & OPTION_TO_QUERY_CACHE)
str->append("cache ", 6);
......
......@@ -382,7 +382,7 @@ int st_select_lex_unit::exec()
select_limit_cnt= HA_POS_ERROR; // no limit
if (select_limit_cnt == HA_POS_ERROR)
options&= ~OPTION_FOUND_ROWS;
else if (found_rows_for_union && !thd->lex.describe)
else if (found_rows_for_union && !thd->lex->describe)
options|= OPTION_FOUND_ROWS;
fake_select_lex->ftfunc_list= &empty_list;
fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
......
......@@ -1776,7 +1776,7 @@ sp_case:
else
{ /* Simple case: <caseval> = <whenval> */
Item *var= (Item*) new Item_splocal(ctx->current_framesize()-1);
Item *expr= Item_bool_func2::eq_creator(var, $1);
Item *expr= new Item_func_eq(var, $1);
i= new sp_instr_jump_if_not(ip, expr);
}
......
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