diff options
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1e2ed90e1b7..009ced7810a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3225,9 +3225,12 @@ int make_db_list(THD *thd, List<LEX_STRING> *files, /* If we have db lookup vaule we just add it to list and - exit from the function + exit from the function. + We don't do this for database names longer than the maximum + path length. */ - if (lookup_field_vals->db_value.str) + if (lookup_field_vals->db_value.str && + lookup_field_vals->db_value.length < FN_REFLEN) { if (is_infoschema_db(lookup_field_vals->db_value.str, lookup_field_vals->db_value.length)) |