-
Committer:
Jay Pipes
-
Date:
2009-10-18 16:35:25 UTC
-
mto:
This revision was merged to the branch mainline in
revision
1187.
-
Revision ID:
jpipes@serialcoder-20091018163525-xq4nn7sgr5ovoxuy
Fixes Bug#453677 - Crash when selecting from information_schema.tables.
The problem was simply poor coding. There was an assignment call
within a function call:
if (my_strcasecmp(system_charset_info, ext=strchr(file->name,'.'), ARZ) ||
is_prefix(file->name, TMP_FILE_PREFIX))
continue;
*ext=0;
The problem is that the ext variable will be NULL when datadir is a
directory containing a file which does not contain a dot. This is a
pretty common scenario! Changing the above code to this solved the
problem and makes the code clearer as well:
ext= strchr(file->name, '.');
if (ext != NULL)
{
if (my_strcasecmp(system_charset_info, ext, ARZ) ||
is_prefix(file->name, TMP_FILE_PREFIX))
continue;
*ext= 0;
}