[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    bk commit into 5.0 tree (pem:1.1940) BUG#9529
From:       pem () mysql ! com
Date:       2005-05-31 17:01:00
Message-ID: 200505311701.j4VH10te028450 () mail ! mysql ! com
[Download RAW message or body]

Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem 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
  1.1940 05/05/31 18:36:32 pem@mysql.comhem.se +5 -0
  Fixed BUG#9529: Stored Procedures: No Warning on truncation of procedure name
                  during creation.
    Although it returns an error, consistent with the behaviour for other objects.
    (Unclear why we would allow the creation of SPs with truncated names.)

  sql/sql_parse.cc
    1.441 05/05/31 18:36:27 pem@mysql.com +6 -0
    New status code for bad (too long) name.

  sql/sp.h
    1.21 05/05/31 18:36:27 pem@mysql.com +1 -0
    New status code for bad (too long) name.

  sql/sp.cc
    1.77 05/05/31 18:36:27 pem@mysql.com +9 -0
    Check SP name length on creation (and drop).

  mysql-test/t/sp-error.test
    1.71 05/05/31 18:36:27 pem@mysql.com +10 -0
    New test case for BUG#9529.

  mysql-test/r/sp-error.result
    1.69 05/05/31 18:36:27 pem@mysql.com +4 -0
    New test case for BUG#9529.

# 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:	pem
# Host:	mysql.comhem.se
# Root:	/home/pem/work/mysql-5.0

--- 1.440/sql/sql_parse.cc	Tue May 31 12:07:09 2005
+++ 1.441/sql/sql_parse.cc	Tue May 31 18:36:27 2005
@@ -4019,6 +4019,12 @@
       delete lex->sphead;
       lex->sphead= 0;
       goto error;
+    case SP_BAD_IDENTIFIER:
+      my_error(ER_TOO_LONG_IDENT, MYF(0), name);
+      lex->unit.cleanup();
+      delete lex->sphead;
+      lex->sphead= 0;
+      goto error;
     default:
       my_error(ER_SP_STORE_FAILED, MYF(0), SP_TYPE_STRING(lex), name);
       lex->unit.cleanup();

--- 1.68/mysql-test/r/sp-error.result	Fri May 27 16:19:20 2005
+++ 1.69/mysql-test/r/sp-error.result	Tue May 31 18:36:27 2005
@@ -654,4 +654,8 @@
 return 5;
 end|
 ERROR 0A000: FLUSH is not allowed in stored procedures
+create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890()
 +begin
+end|
+ERROR 42000: Identifier name \
'bug9529_90123456789012345678901234567890123456789012345678901234567890' is too long  \
drop table t1|

--- 1.70/mysql-test/t/sp-error.test	Fri May 27 16:19:20 2005
+++ 1.71/mysql-test/t/sp-error.test	Tue May 31 18:36:27 2005
@@ -921,6 +921,16 @@
 
 
 #
+# BUG#9529: Stored Procedures: No Warning on truncation of procedure name
+#           during creation.
+#
+--error ER_TOO_LONG_IDENT
+create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890()
 +begin
+end|
+
+
+#
 # BUG#NNNN: New bug synopsis
 #
 #--disable_warnings

--- 1.76/sql/sp.cc	Mon May 30 18:54:30 2005
+++ 1.77/sql/sp.cc	Tue May 31 18:36:27 2005
@@ -120,6 +120,10 @@
     'db', 'name' and 'type' and the first key is the primary key over the
     same fields.
   */
+  if (name->m_name.length > table->field[1]->field_length)
+  {
+    DBUG_RETURN(SP_KEY_NOT_FOUND);
+  }
   table->field[0]->store(name->m_db.str, name->m_db.length, &my_charset_bin);
   table->field[1]->store(name->m_name.str, name->m_name.length,
                          &my_charset_bin);
@@ -387,6 +391,11 @@
     if (table->s->fields != MYSQL_PROC_FIELD_COUNT)
     {
       ret= SP_GET_FIELD_FAILED;
+      goto done;
+    }
+    if (sp->m_name.length > table->field[MYSQL_PROC_FIELD_NAME]->field_length)
+    {
+      ret= SP_BAD_IDENTIFIER;
       goto done;
     }
     table->field[MYSQL_PROC_FIELD_DB]->

--- 1.20/sql/sp.h	Fri Mar  4 14:34:53 2005
+++ 1.21/sql/sp.h	Tue May 31 18:36:27 2005
@@ -28,6 +28,7 @@
 #define SP_PARSE_ERROR       -6
 #define SP_INTERNAL_ERROR    -7
 #define SP_NO_DB_ERROR       -8
+#define SP_BAD_IDENTIFIER    -9
 
 /* Drop all routines in database 'db' */
 int

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic