Commit cfd69393 authored by unknown's avatar unknown

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.
parent 2a25cf79
...@@ -27,7 +27,7 @@ call foo(); ...@@ -27,7 +27,7 @@ call foo();
PROCEDURE foo does not exist PROCEDURE foo does not exist
drop procedure if exists foo; drop procedure if exists foo;
Warnings: Warnings:
Warning 1256 PROCEDURE foo does not exist Warning 1257 PROCEDURE foo does not exist
create procedure foo() create procedure foo()
foo: loop foo: loop
leave bar; leave bar;
......
...@@ -327,9 +327,17 @@ drop procedure into_dumpfile; ...@@ -327,9 +327,17 @@ drop procedure into_dumpfile;
create procedure create_select(x char(16), y int) create procedure create_select(x char(16), y int)
begin begin
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
create table test.t2 select * from test.t1; create table test.t3 select * from test.t1;
insert into test.t2 values (concat(x, "2"), y+2); insert into test.t3 values (concat(x, "2"), y+2);
end; 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; drop procedure create_select;
create function e() returns double create function e() returns double
return 2.7182818284590452354; return 2.7182818284590452354;
......
...@@ -298,7 +298,7 @@ set sql_log_bin=1; ...@@ -298,7 +298,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 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_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;
......
...@@ -22,48 +22,48 @@ create function func1() returns int ...@@ -22,48 +22,48 @@ create function func1() returns int
return 42| return 42|
# Can't create recursively # Can't create recursively
--error 1254 --error 1255
create procedure foo() create procedure foo()
create procedure bar() set @x=3| create procedure bar() set @x=3|
--error 1254 --error 1255
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 1255 --error 1256
create procedure proc1() create procedure proc1()
set @x = 42| set @x = 42|
--error 1255 --error 1256
create function func1() returns int create function func1() returns int
return 42| return 42|
# Does not exist # Does not exist
--error 1256 --error 1257
alter procedure foo| alter procedure foo|
--error 1256 --error 1257
alter function foo| alter function foo|
--error 1256 --error 1257
drop procedure foo| drop procedure foo|
--error 1256 --error 1257
drop function foo| drop function foo|
--error 1256 --error 1257
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 1259 --error 1260
create procedure foo() create procedure foo()
foo: loop foo: loop
leave bar; leave bar;
end loop| end loop|
--error 1259 --error 1260
create procedure foo() create procedure foo()
foo: loop foo: loop
iterate bar; iterate bar;
end loop| end loop|
# Redefining label # Redefining label
--error 1260 --error 1261
create procedure foo() create procedure foo()
foo: loop foo: loop
foo: loop foo: loop
...@@ -72,14 +72,14 @@ foo: loop ...@@ -72,14 +72,14 @@ foo: loop
end loop foo| end loop foo|
# End label mismatch # End label mismatch
--error 1261 --error 1262
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 1262 --error 1263
create procedure foo(out x int) create procedure foo(out x int)
begin begin
declare y int; declare y int;
...@@ -87,17 +87,17 @@ begin ...@@ -87,17 +87,17 @@ begin
end| end|
# We require INTO in SELECTs (for now; this might change in the future) # We require INTO in SELECTs (for now; this might change in the future)
--error 1263 --error 1264
create procedure foo(x int) create procedure foo(x int)
select * from test.t1| select * from test.t1|
# RETURN in FUNCTION only # RETURN in FUNCTION only
--error 1264 --error 1265
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 1265 --error 1266
create function foo() returns int create function foo() returns int
begin begin
declare x int; declare x int;
......
...@@ -390,18 +390,22 @@ drop procedure into_dumpfile| ...@@ -390,18 +390,22 @@ drop procedure into_dumpfile|
create procedure create_select(x char(16), y int) create procedure create_select(x char(16), y int)
begin begin
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
create table test.t2 select * from test.t1; create table test.t3 select * from test.t1;
insert into test.t2 values (concat(x, "2"), y+2); insert into test.t3 values (concat(x, "2"), y+2);
end| end|
# This doesn't work right now. It suffers from the same problem as the ones --disable_warnings
# above, but the fix caused create.test to hang. :-( drop table if exists t3|
#call create_select("cs", 90)| --enable_warnings
#select * from t1, t2| call create_select("cs", 90)|
#delete from t1| select * from t1, t3|
#drop table t2| --disable_warnings
drop table if exists t3|
--enable_warnings
delete from t1|
drop procedure create_select| drop procedure create_select|
# A minimal, constant FUNCTION. # A minimal, constant FUNCTION.
create function e() returns double create function e() returns double
return 2.7182818284590452354| return 2.7182818284590452354|
...@@ -574,7 +578,7 @@ begin ...@@ -574,7 +578,7 @@ begin
end| end|
# This isn't the fastest way in the world to compute prime numbers, so # 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)| call ip(200)|
# We don't want to select the entire table here, just pick a few # We don't want to select the entire table here, just pick a few
# examples. # examples.
......
...@@ -306,7 +306,11 @@ sp_add_fun_to_lex(LEX *lex, LEX_STRING fun) ...@@ -306,7 +306,11 @@ sp_add_fun_to_lex(LEX *lex, LEX_STRING fun)
while ((fn= li++)) 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; break;
} }
if (! fn) if (! fn)
...@@ -389,7 +393,12 @@ sp_find_cached_function(THD *thd, char *name, uint namelen) ...@@ -389,7 +393,12 @@ sp_find_cached_function(THD *thd, char *name, uint namelen)
while ((sp= li++)) 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; break;
} }
return sp; return sp;
......
...@@ -56,13 +56,10 @@ sp_pcontext::find_pvar(LEX_STRING *name) ...@@ -56,13 +56,10 @@ sp_pcontext::find_pvar(LEX_STRING *name)
while (i-- > 0) while (i-- > 0)
{ {
sp_pvar_t *p= find_pvar(i); 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, if (my_strnncoll(system_charset_info,
name->str, (const uchar *)name->str, name->length,
p->name.str, (const uchar *)p->name.str, p->name.length) == 0)
len) == 0)
{ {
return p; return p;
} }
......
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