Commit 62556b00 authored by unknown's avatar unknown
Browse files

Bug#8861 - If Return is a YEAR data type, value is not shown in year format

  Bug partially fixed by 9775/9102 work on SP function return.


mysql-test/r/sp.result:
  Bug#8861
    Test for bug
mysql-test/t/sp.test:
  Bug#8861
    Test for bug
sql/protocol.cc:
  Bug#8861
    Requires change in assertion
parent de8a3b31
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2991,4 +2991,14 @@ select bug9775(1),bug9775(2),bug9775(3),bug9775(4)|
bug9775(1)	bug9775(2)	bug9775(3)	bug9775(4)
a	b	a,b	
drop function bug9775|
drop function if exists bug8861|
create function bug8861(v1 int) returns year return v1|
select bug8861(05)|
bug8861(05)
2005
set @x = bug8861(05)|
select @x|
@x
2005
drop function bug8861|
drop table t1,t2;
+13 −0
Original line number Diff line number Diff line
@@ -3671,6 +3671,19 @@ select bug9775(1),bug9775(2),bug9775(3),bug9775(4)|
drop function bug9775|


#
# BUG#8861: If Return is a YEAR data type, value is not shown in year format
#
--disable_warnings
drop function if exists bug8861|
--enable_warnings
create function bug8861(v1 int) returns year return v1|
select bug8861(05)|
set @x = bug8861(05)|
select @x|
drop function bug8861|


#
# BUG#NNNN: New bug synopsis
#
+1 −0
Original line number Diff line number Diff line
@@ -774,6 +774,7 @@ bool Protocol_simple::store(const char *from, uint length,
#ifndef DEBUG_OFF
  DBUG_ASSERT(field_types == 0 ||
	      field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
              field_types[field_pos] == MYSQL_TYPE_YEAR ||
              field_types[field_pos] == MYSQL_TYPE_BIT ||
              field_types[field_pos] == MYSQL_TYPE_NEWDECIMAL ||
	      (field_types[field_pos] >= MYSQL_TYPE_ENUM &&