Commit b341356a authored by kroki/tomash@moonlight.intranet's avatar kroki/tomash@moonlight.intranet

Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-merge

into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-runtine-merge
parents aca2c376 069131e2
# Local macros for automake & autoconf # Local macros for automake & autoconf
# A local version of AC_CHECK_SIZEOF that includes sys/types.h
dnl MYSQL_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
AC_DEFUN([MYSQL_CHECK_SIZEOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[AC_TRY_RUN([#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", sizeof($1));
exit(0);
}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [ ])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])
#---START: Used in for client configure #---START: Used in for client configure
AC_DEFUN([MYSQL_TYPE_ACCEPT], AC_DEFUN([MYSQL_TYPE_ACCEPT],
[ac_save_CXXFLAGS="$CXXFLAGS" [ac_save_CXXFLAGS="$CXXFLAGS"
......
...@@ -1687,7 +1687,7 @@ then ...@@ -1687,7 +1687,7 @@ then
AC_MSG_ERROR("MySQL needs a long long type.") AC_MSG_ERROR("MySQL needs a long long type.")
fi fi
# off_t is not a builtin type # off_t is not a builtin type
MYSQL_CHECK_SIZEOF(off_t, 4) AC_CHECK_SIZEOF(off_t, 4)
if test "$ac_cv_sizeof_off_t" -eq 0 if test "$ac_cv_sizeof_off_t" -eq 0
then then
AC_MSG_ERROR("MySQL needs a off_t type.") AC_MSG_ERROR("MySQL needs a off_t type.")
......
...@@ -135,7 +135,13 @@ make_atomic_swap(ptr) ...@@ -135,7 +135,13 @@ make_atomic_swap(ptr)
#undef _atomic_h_cleanup_ #undef _atomic_h_cleanup_
#endif #endif
typedef int32 intptr; /* TODO configure check */ #if SIZEOF_CHARP == SIZEOF_INT
typedef int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG
typedef long intptr;
#else
#error
#endif
#define MY_ATOMIC_OK 0 #define MY_ATOMIC_OK 0
#define MY_ATOMIC_NOT_1CPU 1 #define MY_ATOMIC_NOT_1CPU 1
......
...@@ -2279,7 +2279,7 @@ INSERT INTO t1 VALUES(1), (2), (3), (4), (5); ...@@ -2279,7 +2279,7 @@ INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b // CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
BEGIN SELECT a+b INTO c; end // BEGIN SELECT a+b INTO c; end //
create function bug9056_func2(f1 char binary) returns char binary create function bug9056_func2(f1 char binary) returns char
begin begin
set f1= concat( 'hello', f1 ); set f1= concat( 'hello', f1 );
return f1; return f1;
......
...@@ -1181,3 +1181,8 @@ show authors; ...@@ -1181,3 +1181,8 @@ show authors;
return 42; return 42;
end| end|
ERROR 0A000: Not allowed to return a result set from a function ERROR 0A000: Not allowed to return a result set from a function
drop function if exists bug20701|
create function bug20701() returns varchar(25) binary return "test"|
ERROR 42000: This version of MySQL doesn't yet support 'return value collation'
create function bug20701() returns varchar(25) return "test"|
drop function bug20701|
...@@ -3620,12 +3620,18 @@ call bug11333(10)| ...@@ -3620,12 +3620,18 @@ call bug11333(10)|
drop procedure bug11333| drop procedure bug11333|
drop table t3| drop table t3|
drop function if exists bug9048| drop function if exists bug9048|
create function bug9048(f1 char binary) returns char binary create function bug9048(f1 char binary) returns char
begin begin
set f1= concat( 'hello', f1 ); set f1= concat( 'hello', f1 );
return f1; return f1;
end| end|
drop function bug9048| drop function bug9048|
create function bug9048(f1 char binary) returns char binary
begin
set f1= concat( 'hello', f1 );
return f1;
end|
ERROR 42000: This version of MySQL doesn't yet support 'return value collation'
drop procedure if exists bug12849_1| drop procedure if exists bug12849_1|
create procedure bug12849_1(inout x char) select x into x| create procedure bug12849_1(inout x char) select x into x|
set @var='a'| set @var='a'|
...@@ -4074,7 +4080,7 @@ select res; ...@@ -4074,7 +4080,7 @@ select res;
end| end|
create table t3 (a int)| create table t3 (a int)|
insert into t3 values (0)| insert into t3 values (0)|
create view v1 as select a from t3; create view v1 as select a from t3|
create procedure bug10100pt(level int, lim int) create procedure bug10100pt(level int, lim int)
begin begin
if level < lim then if level < lim then
...@@ -4095,7 +4101,7 @@ else ...@@ -4095,7 +4101,7 @@ else
select * from v1; select * from v1;
end if; end if;
end| end|
prepare stmt2 from "select * from t3;"; prepare stmt2 from "select * from t3;"|
create procedure bug10100pd(level int, lim int) create procedure bug10100pd(level int, lim int)
begin begin
if level < lim then if level < lim then
...@@ -4465,7 +4471,7 @@ Error 1347 'test.v1' is not BASE TABLE ...@@ -4465,7 +4471,7 @@ Error 1347 'test.v1' is not BASE TABLE
Error 1347 'test.v1' is not BASE TABLE Error 1347 'test.v1' is not BASE TABLE
Error 1347 'test.v1' is not BASE TABLE Error 1347 'test.v1' is not BASE TABLE
drop procedure bug13012| drop procedure bug13012|
drop view v1; drop view v1|
select * from t1 order by data| select * from t1 order by data|
id data id data
aa 0 aa 0
......
...@@ -951,7 +951,7 @@ CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b // ...@@ -951,7 +951,7 @@ CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
BEGIN SELECT a+b INTO c; end // BEGIN SELECT a+b INTO c; end //
create function bug9056_func2(f1 char binary) returns char binary create function bug9056_func2(f1 char binary) returns char
begin begin
set f1= concat( 'hello', f1 ); set f1= concat( 'hello', f1 );
return f1; return f1;
......
...@@ -1728,10 +1728,28 @@ begin ...@@ -1728,10 +1728,28 @@ begin
return 42; return 42;
end| end|
#
# BUG#20701: BINARY keyword should be forbidden in stored routines
#
--disable_warnings
drop function if exists bug20701|
--enable_warnings
#
# This was disabled in 5.1.12. See bug #20701
# When collation support in SP is implemented, then this test should
# be removed.
#
--error ER_NOT_SUPPORTED_YET
create function bug20701() returns varchar(25) binary return "test"|
create function bug20701() returns varchar(25) return "test"|
drop function bug20701|
# #
# BUG#NNNN: New bug synopsis # BUG#NNNN: New bug synopsis
# #
#--disable_warnings #--disable_warnings
#drop procedure if exists bugNNNN| #drop procedure if exists bugNNNN|
#drop function if exists bugNNNN|
#--enable_warnings #--enable_warnings
#create procedure bugNNNN... #create procedure bugNNNN...
#create function bugNNNN...
...@@ -4381,12 +4381,23 @@ drop table t3| ...@@ -4381,12 +4381,23 @@ drop table t3|
--disable_warnings --disable_warnings
drop function if exists bug9048| drop function if exists bug9048|
--enable_warnings --enable_warnings
create function bug9048(f1 char binary) returns char binary create function bug9048(f1 char binary) returns char
begin begin
set f1= concat( 'hello', f1 ); set f1= concat( 'hello', f1 );
return f1; return f1;
end| end|
drop function bug9048| drop function bug9048|
#
# This was disabled in 5.1.12. See bug #20701
# When collation support in SP is implemented, then this test should
# be removed.
#
--error ER_NOT_SUPPORTED_YET
create function bug9048(f1 char binary) returns char binary
begin
set f1= concat( 'hello', f1 );
return f1;
end|
# Bug #12849 Stored Procedure: Crash on procedure call with CHAR type # Bug #12849 Stored Procedure: Crash on procedure call with CHAR type
# 'INOUT' parameter # 'INOUT' parameter
...@@ -4940,7 +4951,7 @@ end| ...@@ -4940,7 +4951,7 @@ end|
# a procedure which use tables and recursion # a procedure which use tables and recursion
create table t3 (a int)| create table t3 (a int)|
insert into t3 values (0)| insert into t3 values (0)|
create view v1 as select a from t3; create view v1 as select a from t3|
create procedure bug10100pt(level int, lim int) create procedure bug10100pt(level int, lim int)
begin begin
if level < lim then if level < lim then
...@@ -4963,7 +4974,7 @@ begin ...@@ -4963,7 +4974,7 @@ begin
end if; end if;
end| end|
# dynamic sql & recursion # dynamic sql & recursion
prepare stmt2 from "select * from t3;"; prepare stmt2 from "select * from t3;"|
create procedure bug10100pd(level int, lim int) create procedure bug10100pd(level int, lim int)
begin begin
if level < lim then if level < lim then
...@@ -5258,7 +5269,7 @@ call bug13012()| ...@@ -5258,7 +5269,7 @@ call bug13012()|
call bug13012()| call bug13012()|
call bug13012()| call bug13012()|
drop procedure bug13012| drop procedure bug13012|
drop view v1; drop view v1|
select * from t1 order by data| select * from t1 order by data|
# #
......
...@@ -992,6 +992,7 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp, ...@@ -992,6 +992,7 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp,
} }
DBUG_RETURN(sp->m_first_free_instance); DBUG_RETURN(sp->m_first_free_instance);
} }
level= sp->m_last_cached_sp->m_recursion_level + 1; level= sp->m_last_cached_sp->m_recursion_level + 1;
if (level > depth) if (level > depth)
{ {
...@@ -1161,19 +1162,16 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics) ...@@ -1161,19 +1162,16 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics)
int int
sp_show_create_procedure(THD *thd, sp_name *name) sp_show_create_procedure(THD *thd, sp_name *name)
{ {
int ret= SP_KEY_NOT_FOUND;
sp_head *sp; sp_head *sp;
DBUG_ENTER("sp_show_create_procedure"); DBUG_ENTER("sp_show_create_procedure");
DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str)); DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
if ((sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name, if ((sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name,
&thd->sp_proc_cache, FALSE))) &thd->sp_proc_cache, FALSE)))
{ ret= sp->show_create_procedure(thd);
int ret= sp->show_create_procedure(thd);
DBUG_RETURN(ret); DBUG_RETURN(ret);
}
DBUG_RETURN(SP_KEY_NOT_FOUND);
} }
......
...@@ -1672,6 +1672,17 @@ create_function_tail: ...@@ -1672,6 +1672,17 @@ create_function_tail:
{ {
LEX *lex= Lex; LEX *lex= Lex;
sp_head *sp= lex->sphead; sp_head *sp= lex->sphead;
/*
This was disabled in 5.1.12. See bug #20701
When collation support in SP is implemented, then this test
should be removed.
*/
if (($8 == FIELD_TYPE_STRING || $8 == MYSQL_TYPE_VARCHAR)
&& (lex->type & BINCMP_FLAG))
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "return value collation");
YYABORT;
}
if (sp->fill_field_definition(YYTHD, lex, if (sp->fill_field_definition(YYTHD, lex,
(enum enum_field_types) $8, (enum enum_field_types) $8,
......
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