Post merge fixes.
mysql-test/r/sp.result: Enabled the cs test as it works now. mysql-test/t/sp.test: Enabled the cs test as it works now.
This commit is contained in:
parent
2a25cf793f
commit
cfd69393e4
@ -27,7 +27,7 @@ call foo();
|
||||
PROCEDURE foo does not exist
|
||||
drop procedure if exists foo;
|
||||
Warnings:
|
||||
Warning 1256 PROCEDURE foo does not exist
|
||||
Warning 1257 PROCEDURE foo does not exist
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
leave bar;
|
||||
|
@ -327,9 +327,17 @@ drop procedure into_dumpfile;
|
||||
create procedure create_select(x char(16), y int)
|
||||
begin
|
||||
insert into test.t1 values (x, y);
|
||||
create table test.t2 select * from test.t1;
|
||||
insert into test.t2 values (concat(x, "2"), y+2);
|
||||
create table test.t3 select * from test.t1;
|
||||
insert into test.t3 values (concat(x, "2"), y+2);
|
||||
end;
|
||||
drop table if exists t3;
|
||||
call create_select("cs", 90);
|
||||
select * from t1, t3;
|
||||
id data id data
|
||||
cs 90 cs 90
|
||||
cs 90 cs2 92
|
||||
drop table if exists t3;
|
||||
delete from t1;
|
||||
drop procedure create_select;
|
||||
create function e() returns double
|
||||
return 2.7182818284590452354;
|
||||
|
@ -298,7 +298,7 @@ set sql_log_bin=1;
|
||||
set sql_log_off=1;
|
||||
set sql_log_update=1;
|
||||
Warnings:
|
||||
Note 1266 The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored.
|
||||
Note 1267 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;
|
||||
|
@ -22,48 +22,48 @@ create function func1() returns int
|
||||
return 42|
|
||||
|
||||
# Can't create recursively
|
||||
--error 1254
|
||||
--error 1255
|
||||
create procedure foo()
|
||||
create procedure bar() set @x=3|
|
||||
--error 1254
|
||||
--error 1255
|
||||
create procedure foo()
|
||||
create function bar() returns double return 2.3|
|
||||
|
||||
# Already exists
|
||||
--error 1255
|
||||
--error 1256
|
||||
create procedure proc1()
|
||||
set @x = 42|
|
||||
--error 1255
|
||||
--error 1256
|
||||
create function func1() returns int
|
||||
return 42|
|
||||
|
||||
# Does not exist
|
||||
--error 1256
|
||||
--error 1257
|
||||
alter procedure foo|
|
||||
--error 1256
|
||||
--error 1257
|
||||
alter function foo|
|
||||
--error 1256
|
||||
--error 1257
|
||||
drop procedure foo|
|
||||
--error 1256
|
||||
--error 1257
|
||||
drop function foo|
|
||||
--error 1256
|
||||
--error 1257
|
||||
call foo()|
|
||||
drop procedure if exists foo|
|
||||
|
||||
# LEAVE/ITERATE with no match
|
||||
--error 1259
|
||||
--error 1260
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
leave bar;
|
||||
end loop|
|
||||
--error 1259
|
||||
--error 1260
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
iterate bar;
|
||||
end loop|
|
||||
|
||||
# Redefining label
|
||||
--error 1260
|
||||
--error 1261
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
foo: loop
|
||||
@ -72,14 +72,14 @@ foo: loop
|
||||
end loop foo|
|
||||
|
||||
# End label mismatch
|
||||
--error 1261
|
||||
--error 1262
|
||||
create procedure foo()
|
||||
foo: loop
|
||||
set @x=2;
|
||||
end loop bar|
|
||||
|
||||
# Referring to undef variable
|
||||
--error 1262
|
||||
--error 1263
|
||||
create procedure foo(out x int)
|
||||
begin
|
||||
declare y int;
|
||||
@ -87,17 +87,17 @@ begin
|
||||
end|
|
||||
|
||||
# We require INTO in SELECTs (for now; this might change in the future)
|
||||
--error 1263
|
||||
--error 1264
|
||||
create procedure foo(x int)
|
||||
select * from test.t1|
|
||||
|
||||
# RETURN in FUNCTION only
|
||||
--error 1264
|
||||
--error 1265
|
||||
create procedure foo()
|
||||
return 42|
|
||||
|
||||
# Doesn't allow queries in FUNCTIONs (for now :-( )
|
||||
--error 1265
|
||||
--error 1266
|
||||
create function foo() returns int
|
||||
begin
|
||||
declare x int;
|
||||
|
@ -390,18 +390,22 @@ drop procedure into_dumpfile|
|
||||
create procedure create_select(x char(16), y int)
|
||||
begin
|
||||
insert into test.t1 values (x, y);
|
||||
create table test.t2 select * from test.t1;
|
||||
insert into test.t2 values (concat(x, "2"), y+2);
|
||||
create table test.t3 select * from test.t1;
|
||||
insert into test.t3 values (concat(x, "2"), y+2);
|
||||
end|
|
||||
|
||||
# This doesn't work right now. It suffers from the same problem as the ones
|
||||
# above, but the fix caused create.test to hang. :-(
|
||||
#call create_select("cs", 90)|
|
||||
#select * from t1, t2|
|
||||
#delete from t1|
|
||||
#drop table t2|
|
||||
--disable_warnings
|
||||
drop table if exists t3|
|
||||
--enable_warnings
|
||||
call create_select("cs", 90)|
|
||||
select * from t1, t3|
|
||||
--disable_warnings
|
||||
drop table if exists t3|
|
||||
--enable_warnings
|
||||
delete from t1|
|
||||
drop procedure create_select|
|
||||
|
||||
|
||||
# A minimal, constant FUNCTION.
|
||||
create function e() returns double
|
||||
return 2.7182818284590452354|
|
||||
@ -574,7 +578,7 @@ begin
|
||||
end|
|
||||
|
||||
# This isn't the fastest way in the world to compute prime numbers, so
|
||||
# don't be too ambition. ;-)
|
||||
# don't be too ambitious. ;-)
|
||||
call ip(200)|
|
||||
# We don't want to select the entire table here, just pick a few
|
||||
# examples.
|
||||
|
13
sql/sp.cc
13
sql/sp.cc
@ -306,7 +306,11 @@ sp_add_fun_to_lex(LEX *lex, LEX_STRING fun)
|
||||
|
||||
while ((fn= li++))
|
||||
{
|
||||
if (my_strncasecmp(system_charset_info, fn, fun.str, fun.length) == 0)
|
||||
uint len= strlen(fn);
|
||||
|
||||
if (my_strnncoll(system_charset_info,
|
||||
(const uchar *)fn, len,
|
||||
(const uchar *)fun.str, fun.length) == 0)
|
||||
break;
|
||||
}
|
||||
if (! fn)
|
||||
@ -389,7 +393,12 @@ sp_find_cached_function(THD *thd, char *name, uint namelen)
|
||||
|
||||
while ((sp= li++))
|
||||
{
|
||||
if (my_strncasecmp(system_charset_info, name, sp->name(), namelen) == 0)
|
||||
uint len;
|
||||
const uchar *n= (const uchar *)sp->name(&len);
|
||||
|
||||
if (my_strnncoll(system_charset_info,
|
||||
(const uchar *)name, namelen,
|
||||
n, len) == 0)
|
||||
break;
|
||||
}
|
||||
return sp;
|
||||
|
@ -56,13 +56,10 @@ sp_pcontext::find_pvar(LEX_STRING *name)
|
||||
while (i-- > 0)
|
||||
{
|
||||
sp_pvar_t *p= find_pvar(i);
|
||||
uint len= (p->name.length > name->length ?
|
||||
p->name.length : name->length);
|
||||
|
||||
if (my_strncasecmp(system_charset_info,
|
||||
name->str,
|
||||
p->name.str,
|
||||
len) == 0)
|
||||
if (my_strnncoll(system_charset_info,
|
||||
(const uchar *)name->str, name->length,
|
||||
(const uchar *)p->name.str, p->name.length) == 0)
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user