summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-03-16 12:16:15 +0400
committerunknown <gluh@mysql.com/eagle.(none)>2007-03-16 12:16:15 +0400
commit1a259b885f0882f136490e13a0b0eaee56442410 (patch)
treee1818abb9f396ed7e220b9d5973bb2574ef70a87
parent6b428e8507c7470de56f68b1419cd0c0b0e83a4d (diff)
parenta51b7686000d01d488617b59f543b0cff5e223bb (diff)
downloadmariadb-git-1a259b885f0882f136490e13a0b0eaee56442410.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
-rw-r--r--mysql-test/r/skip_grants.result12
-rw-r--r--mysql-test/t/skip_grants.test8
-rw-r--r--sql/sql_acl.cc4
3 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 58ced16acac..3052bae8e97 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -58,3 +58,15 @@ DROP PROCEDURE p3;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
+select count(*) from information_schema.COLUMN_PRIVILEGES;
+count(*)
+0
+select count(*) from information_schema.SCHEMA_PRIVILEGES;
+count(*)
+0
+select count(*) from information_schema.TABLE_PRIVILEGES;
+count(*)
+0
+select count(*) from information_schema.USER_PRIVILEGES;
+count(*)
+0
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 6dda97fcf8a..75694672a17 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -108,3 +108,11 @@ DROP PROCEDURE p3;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
+
+#
+# Bug#26285 Selecting information_schema crahes server
+#
+select count(*) from information_schema.COLUMN_PRIVILEGES;
+select count(*) from information_schema.SCHEMA_PRIVILEGES;
+select count(*) from information_schema.TABLE_PRIVILEGES;
+select count(*) from information_schema.USER_PRIVILEGES;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 298fb61d5f0..ee15f95f305 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5882,6 +5882,8 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
char *curr_host= thd->security_ctx->priv_host_name();
DBUG_ENTER("fill_schema_user_privileges");
+ if (!initialized)
+ DBUG_RETURN(0);
pthread_mutex_lock(&acl_cache->lock);
for (counter=0 ; counter < acl_users.elements ; counter++)
@@ -5941,6 +5943,8 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
char *curr_host= thd->security_ctx->priv_host_name();
DBUG_ENTER("fill_schema_schema_privileges");
+ if (!initialized)
+ DBUG_RETURN(0);
pthread_mutex_lock(&acl_cache->lock);
for (counter=0 ; counter < acl_dbs.elements ; counter++)