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

Post-merge fixes.

parent 337238b7
...@@ -762,7 +762,7 @@ Variable_name Value ...@@ -762,7 +762,7 @@ 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 44 Qcache_inserts 48
show status like "Qcache_hits"; show status like "Qcache_hits";
Variable_name Value Variable_name Value
Qcache_hits 12 Qcache_hits 12
...@@ -775,7 +775,7 @@ Variable_name Value ...@@ -775,7 +775,7 @@ 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 45 Qcache_inserts 49
show status like "Qcache_hits"; show status like "Qcache_hits";
Variable_name Value Variable_name Value
Qcache_hits 13 Qcache_hits 13
......
...@@ -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 1281 PROCEDURE foo does not exist Warning 1282 PROCEDURE foo does not exist
create procedure foo() create procedure foo()
foo: loop foo: loop
leave bar; leave bar;
......
...@@ -533,7 +533,7 @@ drop procedure hndlr4; ...@@ -533,7 +533,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 1305 set done = 1; declare continue handler for 1306 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;
...@@ -560,7 +560,7 @@ create table t3 ( s char(16), i int ); ...@@ -560,7 +560,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 1305 set done = 1; declare continue handler for 1306 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;
......
...@@ -345,7 +345,7 @@ set sql_log_bin=1; ...@@ -345,7 +345,7 @@ set sql_log_bin=1;
set sql_log_off=1; set sql_log_off=1;
set sql_log_update=1; set sql_log_update=1;
Warnings: Warnings:
Note 1291 The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored. Note 1292 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_low_priority_updates=1;
set sql_max_join_size=200; set sql_max_join_size=200;
select @@sql_max_join_size,@@max_join_size; select @@sql_max_join_size,@@max_join_size;
......
...@@ -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 1279 --error 1280
create procedure foo() create procedure foo()
create procedure bar() set @x=3| create procedure bar() set @x=3|
--error 1279 --error 1280
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 1280 --error 1281
create procedure proc1() create procedure proc1()
set @x = 42| set @x = 42|
--error 1280 --error 1281
create function func1() returns int create function func1() returns int
return 42| return 42|
...@@ -51,32 +51,32 @@ drop procedure proc1| ...@@ -51,32 +51,32 @@ drop procedure proc1|
drop function func1| drop function func1|
# Does not exist # Does not exist
--error 1281 --error 1282
alter procedure foo| alter procedure foo|
--error 1281 --error 1282
alter function foo| alter function foo|
--error 1281 --error 1282
drop procedure foo| drop procedure foo|
--error 1281 --error 1282
drop function foo| drop function foo|
--error 1281 --error 1282
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 1284 --error 1285
create procedure foo() create procedure foo()
foo: loop foo: loop
leave bar; leave bar;
end loop| end loop|
--error 1284 --error 1285
create procedure foo() create procedure foo()
foo: loop foo: loop
iterate bar; iterate bar;
end loop| end loop|
# Redefining label # Redefining label
--error 1285 --error 1286
create procedure foo() create procedure foo()
foo: loop foo: loop
foo: loop foo: loop
...@@ -85,14 +85,14 @@ foo: loop ...@@ -85,14 +85,14 @@ foo: loop
end loop foo| end loop foo|
# End label mismatch # End label mismatch
--error 1286 --error 1287
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 1287 --error 1288
create procedure foo(out x int) create procedure foo(out x int)
begin begin
declare y int; declare y int;
...@@ -106,17 +106,17 @@ begin ...@@ -106,17 +106,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 1288 --error 1289
call foo()| call foo()|
drop procedure foo| drop procedure foo|
# RETURN in FUNCTION only # RETURN in FUNCTION only
--error 1289 --error 1290
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 1290 --error 1291
create function foo() returns int create function foo() returns int
begin begin
declare x int; declare x int;
...@@ -130,19 +130,19 @@ create procedure p(x int) ...@@ -130,19 +130,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 1294 --error 1295
call p()| call p()|
--error 1294 --error 1295
call p(1, 2)| call p(1, 2)|
--error 1294 --error 1295
select f()| select f()|
--error 1294 --error 1295
select f(1, 2)| select f(1, 2)|
drop procedure p| drop procedure p|
drop function f| drop function f|
--error 1295 --error 1296
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;
...@@ -156,7 +156,7 @@ begin ...@@ -156,7 +156,7 @@ begin
end if; end if;
end| end|
--error 1295 --error 1296
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;
...@@ -171,7 +171,7 @@ begin ...@@ -171,7 +171,7 @@ begin
end if; end if;
end| end|
--error 1296 --error 1297
create function f(val int) returns int create function f(val int) returns int
begin begin
declare x int; declare x int;
...@@ -189,12 +189,12 @@ begin ...@@ -189,12 +189,12 @@ begin
end if; end if;
end| end|
--error 1297 --error 1298
select f(10)| select f(10)|
drop function f| drop function f|
--error 1298 --error 1299
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);
...@@ -203,7 +203,7 @@ begin ...@@ -203,7 +203,7 @@ begin
close c; close c;
end| end|
--error 1299 --error 1300
create procedure p() create procedure p()
begin begin
declare x int; declare x int;
...@@ -213,7 +213,7 @@ begin ...@@ -213,7 +213,7 @@ begin
close c; close c;
end| end|
--error 1300 --error 1301
create procedure p() create procedure p()
begin begin
declare c cursor for select * from test.t; declare c cursor for select * from test.t;
...@@ -235,7 +235,7 @@ begin ...@@ -235,7 +235,7 @@ begin
open c; open c;
close c; close c;
end| end|
--error 1301 --error 1302
call p()| call p()|
drop procedure p| drop procedure p|
...@@ -247,7 +247,7 @@ begin ...@@ -247,7 +247,7 @@ begin
close c; close c;
close c; close c;
end| end|
--error 1302 --error 1303
call p()| call p()|
drop procedure p| drop procedure p|
...@@ -259,7 +259,7 @@ drop table if exists t1| ...@@ -259,7 +259,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 1303 --error 1304
create procedure p() create procedure p()
begin begin
declare c cursor for select * from t1; declare c cursor for select * from t1;
...@@ -279,7 +279,7 @@ begin ...@@ -279,7 +279,7 @@ begin
fetch c into x; fetch c into x;
close c; close c;
end| end|
--error 1304 --error 1305
call p()| call p()|
drop procedure p| drop procedure p|
...@@ -294,7 +294,7 @@ begin ...@@ -294,7 +294,7 @@ begin
fetch c into x, y, z; fetch c into x, y, z;
close c; close c;
end| end|
--error 1304 --error 1305
call p()| call p()|
drop procedure p| drop procedure p|
......
...@@ -636,7 +636,7 @@ drop procedure hndlr4| ...@@ -636,7 +636,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 1305 set done = 1; declare continue handler for 1306 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;
...@@ -665,7 +665,7 @@ create table t3 ( s char(16), i int )| ...@@ -665,7 +665,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 1305 set done = 1; declare continue handler for 1306 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;
......
...@@ -544,14 +544,14 @@ Item_in_subselect::single_value_transformer(JOIN *join, ...@@ -544,14 +544,14 @@ Item_in_subselect::single_value_transformer(JOIN *join,
func == &Item_bool_func2::lt_creator)); func == &Item_bool_func2::lt_creator));
} }
// left expression belong to outer select // left expression belong to outer select
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(); thd->lex->current_select= up= current->return_after_parsing();
if (left_expr->fix_fields(thd, up->get_table_list(), 0)) if (left_expr->fix_fields(thd, up->get_table_list(), 0))
{ {
thd->lex.current_select= current; thd->lex->current_select= current;
DBUG_RETURN(RES_ERROR); DBUG_RETURN(RES_ERROR);
} }
thd->lex.current_select= current; thd->lex->current_select= current;
substitution= (*func)(left_expr, subs); substitution= (*func)(left_expr, subs);
DBUG_RETURN(RES_OK); DBUG_RETURN(RES_OK);
} }
......
...@@ -1086,12 +1086,11 @@ static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi) ...@@ -1086,12 +1086,11 @@ static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi)
BINLOG_FORMAT_323_GEQ_57 ; BINLOG_FORMAT_323_GEQ_57 ;
break; break;
case '4': case '4':
case '5':
mi->old_format = BINLOG_FORMAT_CURRENT; mi->old_format = BINLOG_FORMAT_CURRENT;
break; break;
default: default:
/* 5.0 is not supported */ errmsg = "Master reported unrecognized MySQL version";
errmsg = "Master reported an unrecognized MySQL version. Note that 4.0 \
slaves can't replicate a 5.0 or newer master.";
break; break;
} }
......
...@@ -3024,6 +3024,8 @@ mysql_execute_command(THD *thd) ...@@ -3024,6 +3024,8 @@ mysql_execute_command(THD *thd)
if (!(res = mysql_create_function(thd,&lex->udf))) if (!(res = mysql_create_function(thd,&lex->udf)))
send_ok(thd); send_ok(thd);
#else #else
res= -1;
#endif
break; break;
} }
#ifndef NO_EMBEDDED_ACCESS_CHECKS #ifndef NO_EMBEDDED_ACCESS_CHECKS
...@@ -3344,7 +3346,7 @@ mysql_execute_command(THD *thd) ...@@ -3344,7 +3346,7 @@ mysql_execute_command(THD *thd)
LINT_INIT(smrx); LINT_INIT(smrx);
// In case the arguments are subselects... // In case the arguments are subselects...
if (tables && ((res= check_table_access(thd, SELECT_ACL, tables)) || if (tables && ((res= check_table_access(thd, SELECT_ACL, tables, 0)) ||
(res= open_and_lock_tables(thd, tables)))) (res= open_and_lock_tables(thd, tables))))
{ {
break; break;
...@@ -3425,7 +3427,7 @@ mysql_execute_command(THD *thd) ...@@ -3425,7 +3427,7 @@ mysql_execute_command(THD *thd)
udf_func *udf = find_udf(lex->udf.name.str, lex->udf.name.length); udf_func *udf = find_udf(lex->udf.name.str, lex->udf.name.length);
if (udf) if (udf)
{ {
if (check_access(thd, DELETE_ACL, "mysql", 0, 1)) if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 0))
goto error; goto error;
if (!(res = mysql_drop_function(thd,&lex->udf.name))) if (!(res = mysql_drop_function(thd,&lex->udf.name)))
{ {
......
...@@ -1800,7 +1800,6 @@ int mysql_discard_or_import_tablespace(THD *thd, ...@@ -1800,7 +1800,6 @@ int mysql_discard_or_import_tablespace(THD *thd,
error=1; error=1;
if (error) if (error)
goto err; goto err;
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
......
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