mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
branches/zip: innobase_convert_identifier(): Convert table names with
explain_filename() to address Bug #32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs. rb://134 approved by Sunny Bains
This commit is contained in:
parent
0e4ac2bad8
commit
86d4b68006
2 changed files with 23 additions and 4 deletions
|
@ -1,4 +1,10 @@
|
|||
2009-01-01 The InnoDB Team
|
||||
2009-11-04 The InnoDB Team
|
||||
|
||||
* handler/ha_innodb.cc:
|
||||
Fix Bug#32430 'show innodb status' causes errors
|
||||
Invalid (old?) table or database name in logs
|
||||
|
||||
2009-11-02 The InnoDB Team
|
||||
|
||||
* btr/btr0sea.c, buf/buf0buf.c, dict/dict0dict.c, fil/fil0fil.c,
|
||||
ibuf/ibuf0ibuf.c, include/btr0sea.h, include/dict0dict.h,
|
||||
|
|
|
@ -1707,15 +1707,19 @@ innobase_convert_identifier(
|
|||
FALSE=id is an UTF-8 string */
|
||||
{
|
||||
char nz[NAME_LEN + 1];
|
||||
#if MYSQL_VERSION_ID >= 50141
|
||||
char nz2[NAME_LEN + 1 + EXPLAIN_FILENAME_MAX_EXTRA_LENGTH];
|
||||
#else /* MYSQL_VERSION_ID >= 50141 */
|
||||
char nz2[NAME_LEN + 1 + sizeof srv_mysql50_table_name_prefix];
|
||||
#endif /* MYSQL_VERSION_ID >= 50141 */
|
||||
|
||||
const char* s = id;
|
||||
int q;
|
||||
|
||||
if (file_id) {
|
||||
/* Decode the table name. The filename_to_tablename()
|
||||
function expects a NUL-terminated string. The input and
|
||||
output strings buffers must not be shared. */
|
||||
/* Decode the table name. The MySQL function expects
|
||||
a NUL-terminated string. The input and output strings
|
||||
buffers must not be shared. */
|
||||
|
||||
if (UNIV_UNLIKELY(idlen > (sizeof nz) - 1)) {
|
||||
idlen = (sizeof nz) - 1;
|
||||
|
@ -1725,7 +1729,13 @@ innobase_convert_identifier(
|
|||
nz[idlen] = 0;
|
||||
|
||||
s = nz2;
|
||||
#if MYSQL_VERSION_ID >= 50141
|
||||
idlen = explain_filename((THD*) thd, nz, nz2, sizeof nz2,
|
||||
EXPLAIN_PARTITIONS_AS_COMMENT);
|
||||
goto no_quote;
|
||||
#else /* MYSQL_VERSION_ID >= 50141 */
|
||||
idlen = filename_to_tablename(nz, nz2, sizeof nz2);
|
||||
#endif /* MYSQL_VERSION_ID >= 50141 */
|
||||
}
|
||||
|
||||
/* See if the identifier needs to be quoted. */
|
||||
|
@ -1736,6 +1746,9 @@ innobase_convert_identifier(
|
|||
}
|
||||
|
||||
if (q == EOF) {
|
||||
#if MYSQL_VERSION_ID >= 50141
|
||||
no_quote:
|
||||
#endif /* MYSQL_VERSION_ID >= 50141 */
|
||||
if (UNIV_UNLIKELY(idlen > buflen)) {
|
||||
idlen = buflen;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue