List:Commits« Previous MessageNext Message »
From:Narayanan V Date:April 10 2009 7:48am
Subject:bzr commit into mysql-5.1-bugteam branch (v.narayanan:2868) Bug#44025
View as plain text  
#At file:///export/home/log/Narayanan/mysql_checkouts_bazaar/5.1_main_repository/mysql-5.1-bugteam-44025/ based on revid:davi.arnaut@stripped

 2868 Narayanan V	2009-04-10
      Bug#44025 Some schema names longer than 8 characters not supported  by IBMDB2I
      
      On IBM i 5.4, schemas with names that are longer 
      than 8 characters and contain digits or an underscore
      cannot contain IBMDB2I tables, even though this should
      theoritically be possible if all alpha characters
      are uppercase.
      
      THe current patch fixes the IBMDB2I engine to
      allow digits and the underscore(_) to be used in
      schema names longer than 8 characters on IBM i 5.4.
     @ storage/ibmdb2i/db2i_misc.h
        The function which detected whether the
        operating system would treat a schema as an "ordinary identifier" (allowing 10 characters in the name instead of 8) did not cover all possible cases.Function was
        renamed and enhanced to detect all
        possible cases of "ordinary identifiers".
     @ storage/ibmdb2i/ha_ibmdb2i.cc
        use the renamed function to cover all
        possible cases of ordinary identifiers.

    modified:
      storage/ibmdb2i/db2i_misc.h
      storage/ibmdb2i/ha_ibmdb2i.cc
=== modified file 'storage/ibmdb2i/db2i_misc.h'
--- a/storage/ibmdb2i/db2i_misc.h	2009-03-09 21:20:14 +0000
+++ b/storage/ibmdb2i/db2i_misc.h	2009-04-10 07:48:07 +0000
@@ -92,11 +92,17 @@ bool convertMySQLNameToDB2Name(const cha
   return (o <= outlen-1);
 }
 
-bool isUpperOrQuote(const CHARSET_INFO* cs, const char* s)
+bool isOrdinaryIdentifier(const char* s)
 {
   while (*s)
   {
-    if (my_isupper(cs, *s) || (*s == '"'))
+    if (my_isupper(system_charset_info, *s) ||
+        my_isdigit(system_charset_info, *s) ||
+        (*s == '_') ||
+        (*s == '@') ||
+        (*s == '$') ||
+        (*s == '#') ||
+        (*s == '"'))
       ++s;
     else
       return false;

=== modified file 'storage/ibmdb2i/ha_ibmdb2i.cc'
--- a/storage/ibmdb2i/ha_ibmdb2i.cc	2009-03-09 21:20:14 +0000
+++ b/storage/ibmdb2i/ha_ibmdb2i.cc	2009-04-10 07:48:07 +0000
@@ -2122,7 +2122,7 @@ int ha_ibmdb2i::create(const char *name,
   if (osVersion.v < 6)
   {
     if (strlen(libName) > 
-         MAX_DB2_V5R4_LIBNAME_LENGTH + (isUpperOrQuote(system_charset_info, libName) ? 2 : 0))
+         MAX_DB2_V5R4_LIBNAME_LENGTH + (isOrdinaryIdentifier(libName) ? 2 : 0))
     {
       getErrTxt(DB2I_ERR_TOO_LONG_SCHEMA,libName, MAX_DB2_V5R4_LIBNAME_LENGTH);
       DBUG_RETURN(DB2I_ERR_TOO_LONG_SCHEMA);


Attachment: [text/bzr-bundle] bzr/v.narayanan@sun.com-20090410074807-yxyiejzq2nd357f6.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (v.narayanan:2868) Bug#44025Narayanan V10 Apr