summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2005-08-17 17:51:10 +0200
committerunknown <andrey@lmy004.>2005-08-17 17:51:10 +0200
commit7370b241a1bcd81fa24e793c30df5e09923e071a (patch)
tree339e9694a8acd4f2aa2fb186d3fb7c0a549a2442 /sql/sql_show.cc
parentf2cc5f25eb76bbca52140b7bfed13c2e3f9b7050 (diff)
downloadmariadb-git-7370b241a1bcd81fa24e793c30df5e09923e071a.tar.gz
fix for bug #12591 (SHOW TABLES FROM dbname produces wrong error message)
mysql-test/r/show_check.result: results for test for bug #12591 mysql-test/t/show_check.test: test for bug #12591 sql/sql_show.cc: don't let my_dir() emit a message bug catch the errno (my_errno - a thread specific variable) and check it for ENOENT - not existing. For other errors emulate the message used to be emitted by my_dir()
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index e1d5f80ebc2..1c6d86793e6 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -264,8 +264,14 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
bzero((char*) &table_list,sizeof(table_list));
- if (!(dirp = my_dir(path,MYF(MY_WME | (dir ? MY_WANT_STAT : 0)))))
+ if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
+ {
+ if (my_errno == ENOENT)
+ my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), db);
+ else
+ my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), path, my_errno);
DBUG_RETURN(-1);
+ }
for (i=0 ; i < (uint) dirp->number_off_files ; i++)
{