diff options
author | Narayanan V <v.narayanan@sun.com> | 2009-04-13 17:05:40 +0530 |
---|---|---|
committer | Narayanan V <v.narayanan@sun.com> | 2009-04-13 17:05:40 +0530 |
commit | 2187c60bf46c477ea8b0425fbabe6a4dde31c4d7 (patch) | |
tree | e768357077b11601b43cefae9c3db9a80e4dc13f /storage | |
parent | 097262a85b17f48bd8d5b68d05dfb3d2bc78c719 (diff) | |
parent | f286444bd5e0a494362447c6575ba5981a03da87 (diff) | |
download | mariadb-git-2187c60bf46c477ea8b0425fbabe6a4dde31c4d7.tar.gz |
merging with mysql-5.1-bugteam
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ibmdb2i/db2i_misc.h | 10 | ||||
-rw-r--r-- | storage/ibmdb2i/ha_ibmdb2i.cc | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/storage/ibmdb2i/db2i_misc.h b/storage/ibmdb2i/db2i_misc.h index 1cc3f962cfc..9e20f01208b 100644 --- a/storage/ibmdb2i/db2i_misc.h +++ b/storage/ibmdb2i/db2i_misc.h @@ -92,11 +92,17 @@ bool convertMySQLNameToDB2Name(const char* input, 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; diff --git a/storage/ibmdb2i/ha_ibmdb2i.cc b/storage/ibmdb2i/ha_ibmdb2i.cc index 11eceb68cb7..ad80a80fc97 100644 --- a/storage/ibmdb2i/ha_ibmdb2i.cc +++ b/storage/ibmdb2i/ha_ibmdb2i.cc @@ -2122,7 +2122,7 @@ int ha_ibmdb2i::create(const char *name, TABLE *table_arg, 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); |