mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Post-merge fixes.
mysql-test/r/sp-error.result: Post-merge fixes. Error codes renumbered. mysql-test/r/sp.result: Post-merge fixes. Error codes renumbered. mysql-test/r/variables.result: Post-merge fixes. Error codes renumbered. mysql-test/t/sp-error.test: Post-merge fixes. Error codes renumbered. mysql-test/t/sp.test: Post-merge fixes. Error codes renumbered. sql/item_subselect.cc: Post-merge fixes. thd->lex is a pointer. sql/slave.cc: Post-merge fixes. Undid imported patch that's not 5.0 compatible. sql/sql_parse.cc: Post-merge fixes. Changed access API calls, and fixed merge error. sql/sql_table.cc: Post-merge fixes. No update log in 5.0.
This commit is contained in:
@ -762,7 +762,7 @@ Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 44
|
||||
Qcache_inserts 48
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 12
|
||||
@ -775,7 +775,7 @@ Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 45
|
||||
Qcache_inserts 49
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 13
|
||||
|
@ -35,7 +35,7 @@ call foo();
|
||||
ERROR HY000: PROCEDURE foo does not exist
|
||||
drop procedure if exists foo;
|
||||
Warnings:
|
||||
Warning 1281 PROCEDURE foo does not exist
|
||||
Warning 1282 PROCEDURE foo does not exist
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
leave bar;
|
||||
|
@ -533,7 +533,7 @@ drop procedure hndlr4;
|
||||
create procedure cur1()
|
||||
begin
|
||||
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 a char(16);
|
||||
declare b int;
|
||||
@ -560,7 +560,7 @@ create table t3 ( s char(16), i int );
|
||||
create procedure cur2()
|
||||
begin
|
||||
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 c2 cursor for select i from test.t2;
|
||||
open c1;
|
||||
|
@ -345,7 +345,7 @@ set sql_log_bin=1;
|
||||
set sql_log_off=1;
|
||||
set sql_log_update=1;
|
||||
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_max_join_size=200;
|
||||
select @@sql_max_join_size,@@max_join_size;
|
||||
|
@ -32,18 +32,18 @@ create function func1() returns int
|
||||
return 42|
|
||||
|
||||
# Can't create recursively
|
||||
--error 1279
|
||||
--error 1280
|
||||
create procedure foo()
|
||||
create procedure bar() set @x=3|
|
||||
--error 1279
|
||||
--error 1280
|
||||
create procedure foo()
|
||||
create function bar() returns double return 2.3|
|
||||
|
||||
# Already exists
|
||||
--error 1280
|
||||
--error 1281
|
||||
create procedure proc1()
|
||||
set @x = 42|
|
||||
--error 1280
|
||||
--error 1281
|
||||
create function func1() returns int
|
||||
return 42|
|
||||
|
||||
@ -51,32 +51,32 @@ drop procedure proc1|
|
||||
drop function func1|
|
||||
|
||||
# Does not exist
|
||||
--error 1281
|
||||
--error 1282
|
||||
alter procedure foo|
|
||||
--error 1281
|
||||
--error 1282
|
||||
alter function foo|
|
||||
--error 1281
|
||||
--error 1282
|
||||
drop procedure foo|
|
||||
--error 1281
|
||||
--error 1282
|
||||
drop function foo|
|
||||
--error 1281
|
||||
--error 1282
|
||||
call foo()|
|
||||
drop procedure if exists foo|
|
||||
|
||||
# LEAVE/ITERATE with no match
|
||||
--error 1284
|
||||
--error 1285
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
leave bar;
|
||||
end loop|
|
||||
--error 1284
|
||||
--error 1285
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
iterate bar;
|
||||
end loop|
|
||||
|
||||
# Redefining label
|
||||
--error 1285
|
||||
--error 1286
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
foo: loop
|
||||
@ -85,14 +85,14 @@ foo: loop
|
||||
end loop foo|
|
||||
|
||||
# End label mismatch
|
||||
--error 1286
|
||||
--error 1287
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
set @x=2;
|
||||
end loop bar|
|
||||
|
||||
# Referring to undef variable
|
||||
--error 1287
|
||||
--error 1288
|
||||
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 1288
|
||||
--error 1289
|
||||
call foo()|
|
||||
drop procedure foo|
|
||||
|
||||
# RETURN in FUNCTION only
|
||||
--error 1289
|
||||
--error 1290
|
||||
create procedure foo()
|
||||
return 42|
|
||||
|
||||
# Doesn't allow queries in FUNCTIONs (for now :-( )
|
||||
--error 1290
|
||||
--error 1291
|
||||
create function foo() returns int
|
||||
begin
|
||||
declare x int;
|
||||
@ -130,19 +130,19 @@ create procedure p(x int)
|
||||
create function f(x int) returns int
|
||||
return x+42|
|
||||
|
||||
--error 1294
|
||||
--error 1295
|
||||
call p()|
|
||||
--error 1294
|
||||
--error 1295
|
||||
call p(1, 2)|
|
||||
--error 1294
|
||||
--error 1295
|
||||
select f()|
|
||||
--error 1294
|
||||
--error 1295
|
||||
select f(1, 2)|
|
||||
|
||||
drop procedure p|
|
||||
drop function f|
|
||||
|
||||
--error 1295
|
||||
--error 1296
|
||||
create procedure p(val int, out res int)
|
||||
begin
|
||||
declare x int default 0;
|
||||
@ -156,7 +156,7 @@ begin
|
||||
end if;
|
||||
end|
|
||||
|
||||
--error 1295
|
||||
--error 1296
|
||||
create procedure p(val int, out res int)
|
||||
begin
|
||||
declare x int default 0;
|
||||
@ -171,7 +171,7 @@ begin
|
||||
end if;
|
||||
end|
|
||||
|
||||
--error 1296
|
||||
--error 1297
|
||||
create function f(val int) returns int
|
||||
begin
|
||||
declare x int;
|
||||
@ -189,12 +189,12 @@ begin
|
||||
end if;
|
||||
end|
|
||||
|
||||
--error 1297
|
||||
--error 1298
|
||||
select f(10)|
|
||||
|
||||
drop function f|
|
||||
|
||||
--error 1298
|
||||
--error 1299
|
||||
create procedure p()
|
||||
begin
|
||||
declare c cursor for insert into test.t1 values ("foo", 42);
|
||||
@ -203,7 +203,7 @@ begin
|
||||
close c;
|
||||
end|
|
||||
|
||||
--error 1299
|
||||
--error 1300
|
||||
create procedure p()
|
||||
begin
|
||||
declare x int;
|
||||
@ -213,7 +213,7 @@ begin
|
||||
close c;
|
||||
end|
|
||||
|
||||
--error 1300
|
||||
--error 1301
|
||||
create procedure p()
|
||||
begin
|
||||
declare c cursor for select * from test.t;
|
||||
@ -235,7 +235,7 @@ begin
|
||||
open c;
|
||||
close c;
|
||||
end|
|
||||
--error 1301
|
||||
--error 1302
|
||||
call p()|
|
||||
drop procedure p|
|
||||
|
||||
@ -247,7 +247,7 @@ begin
|
||||
close c;
|
||||
close c;
|
||||
end|
|
||||
--error 1302
|
||||
--error 1303
|
||||
call p()|
|
||||
drop procedure p|
|
||||
|
||||
@ -259,7 +259,7 @@ drop table if exists t1|
|
||||
create table t1 (val int, x float)|
|
||||
insert into t1 values (42, 3.1), (19, 1.2)|
|
||||
|
||||
--error 1303
|
||||
--error 1304
|
||||
create procedure p()
|
||||
begin
|
||||
declare c cursor for select * from t1;
|
||||
@ -279,7 +279,7 @@ begin
|
||||
fetch c into x;
|
||||
close c;
|
||||
end|
|
||||
--error 1304
|
||||
--error 1305
|
||||
call p()|
|
||||
drop procedure p|
|
||||
|
||||
@ -294,7 +294,7 @@ begin
|
||||
fetch c into x, y, z;
|
||||
close c;
|
||||
end|
|
||||
--error 1304
|
||||
--error 1305
|
||||
call p()|
|
||||
drop procedure p|
|
||||
|
||||
|
@ -636,7 +636,7 @@ drop procedure hndlr4|
|
||||
create procedure cur1()
|
||||
begin
|
||||
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 a char(16);
|
||||
declare b int;
|
||||
@ -665,7 +665,7 @@ create table t3 ( s char(16), i int )|
|
||||
create procedure cur2()
|
||||
begin
|
||||
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 c2 cursor for select i from test.t2;
|
||||
|
||||
|
@ -544,14 +544,14 @@ Item_in_subselect::single_value_transformer(JOIN *join,
|
||||
func == &Item_bool_func2::lt_creator));
|
||||
}
|
||||
// left expression belong to outer select
|
||||
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();
|
||||
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);
|
||||
}
|
||||
thd->lex.current_select= current;
|
||||
thd->lex->current_select= current;
|
||||
substitution= (*func)(left_expr, subs);
|
||||
DBUG_RETURN(RES_OK);
|
||||
}
|
||||
|
@ -1086,12 +1086,11 @@ static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi)
|
||||
BINLOG_FORMAT_323_GEQ_57 ;
|
||||
break;
|
||||
case '4':
|
||||
case '5':
|
||||
mi->old_format = BINLOG_FORMAT_CURRENT;
|
||||
break;
|
||||
default:
|
||||
/* 5.0 is not supported */
|
||||
errmsg = "Master reported an unrecognized MySQL version. Note that 4.0 \
|
||||
slaves can't replicate a 5.0 or newer master.";
|
||||
errmsg = "Master reported unrecognized MySQL version";
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3024,6 +3024,8 @@ mysql_execute_command(THD *thd)
|
||||
if (!(res = mysql_create_function(thd,&lex->udf)))
|
||||
send_ok(thd);
|
||||
#else
|
||||
res= -1;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
@ -3344,7 +3346,7 @@ mysql_execute_command(THD *thd)
|
||||
LINT_INIT(smrx);
|
||||
|
||||
// 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))))
|
||||
{
|
||||
break;
|
||||
@ -3425,7 +3427,7 @@ mysql_execute_command(THD *thd)
|
||||
udf_func *udf = find_udf(lex->udf.name.str, lex->udf.name.length);
|
||||
if (udf)
|
||||
{
|
||||
if (check_access(thd, DELETE_ACL, "mysql", 0, 1))
|
||||
if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 0))
|
||||
goto error;
|
||||
if (!(res = mysql_drop_function(thd,&lex->udf.name)))
|
||||
{
|
||||
|
@ -1800,7 +1800,6 @@ int mysql_discard_or_import_tablespace(THD *thd,
|
||||
error=1;
|
||||
if (error)
|
||||
goto err;
|
||||
mysql_update_log.write(thd, thd->query,thd->query_length);
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
|
||||
|
Reference in New Issue
Block a user