summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authormonty@donna.mysql.com <>2000-12-26 17:34:04 +0200
committermonty@donna.mysql.com <>2000-12-26 17:34:04 +0200
commita12c1ffb9a738ac986e3106542b82a54a0a49a39 (patch)
tree88d39c525bc426869b8b4ce7a80f9c9bdf6509d6 /sql/sql_show.cc
parent75dc09534bd26e4e516fbbc78f004290e154ce89 (diff)
downloadmariadb-git-a12c1ffb9a738ac986e3106542b82a54a0a49a39.tar.gz
--safe-show-db and have_xxx variables
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 1d4bdffeb61..ed373f58b00 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -21,8 +21,6 @@
#include "sql_select.h" // For select_describe
#include "sql_acl.h"
#include <my_dir.h>
-#undef USE_RAID
-#define USE_RAID
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h" // For berkeley_show_logs
@@ -77,10 +75,17 @@ mysqld_show_dbs(THD *thd,const char *wild)
List_iterator<char> it(files);
while ((file_name=it++))
{
- thd->packet.length(0);
- net_store_data(&thd->packet,file_name);
- if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length()))
- DBUG_RETURN(-1);
+ if (!opt_safe_show_db || thd->master_access ||
+ acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
+ thd->priv_user, file_name) ||
+ (grant_option && !check_grant_db(thd, file_name)))
+ {
+ thd->packet.length(0);
+ net_store_data(&thd->packet,file_name);
+ if (my_net_write(&thd->net, (char*) thd->packet.ptr(),
+ thd->packet.length()))
+ DBUG_RETURN(-1);
+ }
}
send_eof(&thd->net);
DBUG_RETURN(0);
@@ -1088,6 +1093,14 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
case SHOW_INT:
net_store_data(&packet2,(uint32) *(int*) variables[i].value);
break;
+ case SHOW_HAVE:
+ {
+ SHOW_COMP_OPTION tmp= *(SHOW_COMP_OPTION*) variables[i].value;
+ net_store_data(&packet2, (tmp == SHOW_OPTION_NO ? "NO" :
+ tmp == SHOW_OPTION_YES ? "YES" :
+ "DISABLED"));
+ break;
+ }
case SHOW_CHAR:
net_store_data(&packet2,variables[i].value);
break;