Commit ce16c895 authored by unknown's avatar unknown
Browse files

Merge in fix Bug#3788


mysql-test/r/information_schema.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/sp.result:
  Merge
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parents fe3a425a 1220069c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ Greg@greg-laptop.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
WAX@sergbook.mysql.com
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
acurtis@pcgem.rdg.cyberkinetica.com
administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ select parameter_style, sql_data_access, dtd_identifier
from information_schema.routines;
parameter_style	sql_data_access	dtd_identifier
SQL	CONTAINS SQL	NULL
SQL	CONTAINS SQL	int
SQL	CONTAINS SQL	int(11)
show procedure status;
Db	Name	Type	Definer	Modified	Created	Security_type	Comment
test	sel2	PROCEDURE	root@localhost	#	#	DEFINER	
+26 −4
Original line number Diff line number Diff line
@@ -962,7 +962,7 @@ comment 'Characteristics procedure test'
  return 42|
show create function chistics|
Function	sql_mode	Create Function
chistics		CREATE FUNCTION `test`.`chistics`() RETURNS int
chistics		CREATE FUNCTION `test`.`chistics`() RETURNS int(11)
    DETERMINISTIC
    SQL SECURITY INVOKER
    COMMENT 'Characteristics procedure test'
@@ -975,7 +975,7 @@ no sql
comment 'Characteristics function test'|
show create function chistics|
Function	sql_mode	Create Function
chistics		CREATE FUNCTION `test`.`chistics`() RETURNS int
chistics		CREATE FUNCTION `test`.`chistics`() RETURNS int(11)
    NO SQL
    DETERMINISTIC
    SQL SECURITY INVOKER
@@ -2026,11 +2026,11 @@ bug2564_2 ANSI_QUOTES CREATE PROCEDURE "test"."bug2564_2"()
insert into "t1" values ('foo', 1)
show create function bug2564_3|
Function	sql_mode	Create Function
bug2564_3		CREATE FUNCTION `test`.`bug2564_3`(x int, y int) RETURNS int
bug2564_3		CREATE FUNCTION `test`.`bug2564_3`(x int, y int) RETURNS int(11)
return x || y
show create function bug2564_4|
Function	sql_mode	Create Function
bug2564_4	REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI	CREATE FUNCTION "test"."bug2564_4"(x int, y int) RETURNS int
bug2564_4	REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI	CREATE FUNCTION "test"."bug2564_4"(x int, y int) RETURNS int(11)
return x || y
drop procedure bug2564_1|
drop procedure bug2564_2|
@@ -2095,6 +2095,28 @@ drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|
drop table if exists t3|
drop procedure if exists bug2773|
create function bug2773() returns int return null|
create table t3 as select bug2773()|
show create table t3|
Table	Create Table
t3	CREATE TABLE `t3` (
  `bug2773()` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t3|
drop function bug2773|
drop procedure if exists bug3788|
create function bug3788() returns date return cast("2005-03-04" as date)|
select bug3788()|
bug3788()
2005-03-04
drop function bug3788|
create function bug3788() returns binary(5) return 5|
select bug3788()|
bug3788()
5
drop function bug3788|
drop table if exists t3|
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
drop procedure if exists bug4726|
+29 −0
Original line number Diff line number Diff line
@@ -2546,6 +2546,35 @@ drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|

#
# BUG#2773: Function's data type ignored in stored procedures
#
--disable_warnings
drop table if exists t3|
drop procedure if exists bug2773|
--enable_warnings

create function bug2773() returns int return null|
create table t3 as select bug2773()|
show create table t3|
drop table t3|
drop function bug2773|

#
# BUG#3788: Stored procedure packet error
#
--disable_warnings
drop procedure if exists bug3788|
--enable_warnings

create function bug3788() returns date return cast("2005-03-04" as date)|
select bug3788()|
drop function bug3788|

create function bug3788() returns binary(5) return 5|
select bug3788()|
drop function bug3788|
 

#
# BUG#4726
+1 −1
Original line number Diff line number Diff line
@@ -3521,7 +3521,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference)
  enum_parsing_place place= NO_MATTER;
  SELECT_LEX *current_sel= thd->lex->current_select;

  if (!ref)
  if (!ref || ref == not_found_item)
  {
    SELECT_LEX_UNIT *prev_unit= current_sel->master_unit();
    SELECT_LEX *outer_sel= prev_unit->outer_select();
Loading