MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:ahristov Date:August 4 2006 1:18pm
Subject:bk commit into 5.1 tree (andrey:1.2245) BUG#20701
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-04 15:17:52+02:00, andrey@lmy004. +5 -0
  Fix for bug#20701 BINARY keyword should be forbidden in stored routines
      
  create function func() returns char(10) binary ...
  is no more possible. This will be reenabled when 
  bug 2676 "DECLARE can't have COLLATE clause in stored procedure"
  is fixed.

  mysql-test/r/sp-error.result@stripped, 2006-08-04 15:17:44+02:00, andrey@lmy004. +5 -0
    update result

  mysql-test/r/sp.result@stripped, 2006-08-04 15:17:44+02:00, andrey@lmy004. +10 -4
    update result

  mysql-test/t/sp-error.test@stripped, 2006-08-04 15:17:44+02:00, andrey@lmy004. +11 -0
    add a test case for bug#20701 BINARY keyword should be forbidden in stored procedures

  mysql-test/t/sp.test@stripped, 2006-08-04 15:17:44+02:00, andrey@lmy004. +10 -4
    Fix test case which uses binary for the return value of a function.
    It's no more possible after fix for bug#20701 
    BINARY keyword should be forbidden in SP
    
    Fix few glitches where ; is used instead of | . The delimiter is |

  sql/sql_yacc.yy@stripped, 2006-08-04 15:17:45+02:00, andrey@lmy004. +7 -0
    Fix for bug#20701 BINARY keyword should be forbidden in stored routines
    
    create function func() returns char(10) binary ...
    is no more possible. This will be reenabled when 
    bug 2676 "DECLARE can't have COLLATE clause in stored procedure"
    is fixed

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.1-runtime

--- 1.489/sql/sql_yacc.yy	2006-08-04 15:18:04 +02:00
+++ 1.490/sql/sql_yacc.yy	2006-08-04 15:18:04 +02:00
@@ -1673,6 +1673,13 @@
 	    LEX *lex= Lex;
 	    sp_head *sp= lex->sphead;
 
+            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,
                                           (enum enum_field_types) $8,
                                           &sp->m_return_field_def))

--- 1.111/mysql-test/r/sp-error.result	2006-08-04 15:18:04 +02:00
+++ 1.112/mysql-test/r/sp-error.result	2006-08-04 15:18:04 +02:00
@@ -1181,3 +1181,8 @@
 return 42;
 end|
 ERROR 0A000: Not allowed to return a result set from a function
+drop procedure 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|

--- 1.213/mysql-test/r/sp.result	2006-08-04 15:18:04 +02:00
+++ 1.214/mysql-test/r/sp.result	2006-08-04 15:18:04 +02:00
@@ -3620,12 +3620,18 @@
 drop procedure bug11333|
 drop table t3|
 drop function if exists bug9048|
-create function bug9048(f1 char binary) returns char binary
+create function bug9048(f1 char binary) returns char
 begin
 set f1= concat( 'hello', f1 );
 return f1;
 end|
 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|
 create procedure bug12849_1(inout x char) select x into x|
 set @var='a'|
@@ -4074,7 +4080,7 @@
 end|
 create table t3 (a int)|
 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)
 begin
 if level < lim then
@@ -4095,7 +4101,7 @@
 select * from v1;
 end if;
 end|
-prepare stmt2 from "select * from t3;";
+prepare stmt2 from "select * from t3;"|
 create procedure bug10100pd(level int, lim int)
 begin
 if level < lim then
@@ -4465,7 +4471,7 @@
 Error	1347	'test.v1' is not BASE TABLE
 Error	1347	'test.v1' is not BASE TABLE
 drop procedure bug13012|
-drop view v1;
+drop view v1|
 select * from t1 order by data|
 id	data
 aa	0

--- 1.109/mysql-test/t/sp-error.test	2006-08-04 15:18:04 +02:00
+++ 1.110/mysql-test/t/sp-error.test	2006-08-04 15:18:04 +02:00
@@ -1729,6 +1729,17 @@
 end|
 
 #
+# BUG#20701: BINARY keyword should be forbidden in stored routines
+#
+--disable_warnings
+drop procedure if exists bug20701|
+--enable_warnings
+--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
 #
 #--disable_warnings

--- 1.196/mysql-test/t/sp.test	2006-08-04 15:18:04 +02:00
+++ 1.197/mysql-test/t/sp.test	2006-08-04 15:18:04 +02:00
@@ -4381,12 +4381,18 @@
 --disable_warnings
 drop function if exists bug9048|
 --enable_warnings
-create function bug9048(f1 char binary) returns char binary
+create function bug9048(f1 char binary) returns char
 begin
   set f1= concat( 'hello', f1 );
   return f1;
 end|
 drop function bug9048|
+--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
 # 'INOUT' parameter
@@ -4940,7 +4946,7 @@
 # a procedure which use tables and recursion
 create table t3 (a int)|
 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)
 begin
   if level < lim then
@@ -4963,7 +4969,7 @@
   end if;
 end|
 # dynamic sql & recursion
-prepare stmt2 from "select * from t3;";
+prepare stmt2 from "select * from t3;"|
 create procedure bug10100pd(level int, lim int)
 begin
   if level < lim then
@@ -5258,7 +5264,7 @@
 call bug13012()|
 call bug13012()|
 drop procedure bug13012|
-drop view v1;
+drop view v1|
 select * from t1 order by data|
 
 #
Thread
bk commit into 5.1 tree (andrey:1.2245) BUG#20701ahristov4 Aug