From: Date: February 16 2006 1:40pm Subject: bk commit into 5.0 tree (pem:1.2042) BUG#17015 List-Archive: http://lists.mysql.com/commits/2726 X-Bug: 17015 Message-Id: <200602161240.k1GCehsf012848@mail.mysql.com> 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.2042 06/02/16 13:40:37 pem@stripped +3 -0 Fixed BUG#17015: Routine name truncation not an error The name length was checked "the old way", not taking charsets into account, when creating a stored routine. Fixing this enforces the real limit (64 characters) again, and no truncation is possible. sql/sp.cc 1.107 06/02/16 13:40:34 pem@stripped +6 -1 When creating a routine, check the length of the name the correct way, taking the charsets into account. mysql-test/t/sp-error.test 1.105 06/02/16 13:40:34 pem@stripped +16 -3 Added and modified test case for BUG#17015 (and 9529). mysql-test/r/sp-error.result 1.104 06/02/16 13:40:34 pem@stripped +10 -2 Updated results for BUG#17015. # 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: pem.mysql.com # Root: /extern/mysql/5.0/bug17015/mysql-5.0-runtime --- 1.103/mysql-test/r/sp-error.result 2006-02-09 13:00:28 +01:00 +++ 1.104/mysql-test/r/sp-error.result 2006-02-16 13:40:34 +01:00 @@ -647,10 +647,18 @@ return 5; end| ERROR 0A000: FLUSH is not allowed in stored function or trigger -create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123() +create procedure bug9529_901234567890123456789012345678901234567890123456789012345() begin end| -ERROR 42000: Identifier name 'bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' is too long +ERROR 42000: Identifier name 'bug9529_901234567890123456789012345678901234567890123456789012345' is too long +drop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234| +create procedure bug17015_0123456789012345678901234567890123456789012345678901234() +begin +end| +show procedure status like 'bug17015%'| +Db Name Type Definer Modified Created Security_type Comment +test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER +drop procedure bug17015_0123456789012345678901234567890123456789012345678901234| drop procedure if exists bug10969| create procedure bug10969() begin --- 1.104/mysql-test/t/sp-error.test 2006-02-09 13:00:28 +01:00 +++ 1.105/mysql-test/t/sp-error.test 2006-02-16 13:40:34 +01:00 @@ -926,12 +926,26 @@ # # BUG#9529: Stored Procedures: No Warning on truncation of procedure name # during creation. -# Note: When using utf8 for mysql.proc, this limit is much higher than before +# BUG#17015: Routine name truncation not an error +# When we started using utf8 for mysql.proc, this limit appeared +# to be higher, but in reality the names were truncated. --error ER_TOO_LONG_IDENT -create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123() +create procedure bug9529_901234567890123456789012345678901234567890123456789012345() begin end| +--disable_warnings +drop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234| +--enable_warnings +# Check the upper limit, just to make sure. +create procedure bug17015_0123456789012345678901234567890123456789012345678901234() +begin +end| + +--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' +show procedure status like 'bug17015%'| +drop procedure bug17015_0123456789012345678901234567890123456789012345678901234| + # # BUG#10969: Stored procedures: crash if default() function @@ -1721,4 +1735,3 @@ #drop procedure if exists bugNNNN| #--enable_warnings #create procedure bugNNNN... - --- 1.106/sql/sp.cc 2006-02-02 15:37:25 +01:00 +++ 1.107/sql/sp.cc 2006-02-16 13:40:34 +01:00 @@ -508,7 +508,12 @@ ret= SP_GET_FIELD_FAILED; goto done; } - if (sp->m_name.length > table->field[MYSQL_PROC_FIELD_NAME]->field_length) + + if ((system_charset_info->cset->numchars(system_charset_info, + sp->m_name.str, + sp->m_name.str+sp->m_name.length) * + table->field[MYSQL_PROC_FIELD_NAME]->charset()->mbmaxlen) > + table->field[MYSQL_PROC_FIELD_NAME]->field_length) { ret= SP_BAD_IDENTIFIER; goto done;