Commit 5b355ea6 authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

Post-merge fixes.

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