summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <gluh@eagle.intranet.mysql.r18.ru>2006-03-20 13:42:02 +0400
committerunknown <gluh@eagle.intranet.mysql.r18.ru>2006-03-20 13:42:02 +0400
commitce39d2949351e2b01b8839c0ce6c273eac53f080 (patch)
treee4c13d8202ca3ebd5f08aa1baf69085349038b32 /sql/sql_acl.cc
parentc560a5b1d4e874133803d0d7dfe65e7eebca94c3 (diff)
downloadmariadb-git-ce39d2949351e2b01b8839c0ce6c273eac53f080.tar.gz
Fix for bug #18113 "SELECT * FROM information_schema.xxx crashes server"
Crash happened when one selected data from one of INFORMATION_SCHEMA tables and in order to build its contents server had to open view which used stored function and table or view on which one had not global or database-level privileges (e.g. had only table-level or had no privileges at all). The crash was caused by usage of check_grant() function, which assumes that either number of tables to be inspected by it is limited explicitly or table list used and thd->lex->query_tables_own_last value correspond to each other (the latter should be either 0 or point to next_global member of one of elements of this table list), in conditions when above assumptions were not true. This fix just explicitly limits number of tables to be inspected. Other negative effects which are caused by the fact that thd->lex->query_tables_own_last might not be set properly during processing of I_S tables are less disastrous and will be reported and fixed separetely. mysql-test/r/information_schema_db.result: Fix for bug #18113 "SELECT * FROM information_schema.xxx crashes server" test case mysql-test/t/information_schema_db.test: Fix for bug #18113 "SELECT * FROM information_schema.xxx crashes server" test case sql/sql_acl.cc: added note
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ee604ae1daf..d66a631dbcc 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3537,6 +3537,13 @@ end:
RETURN
0 ok
1 Error: User did not have the requested privileges
+
+ NOTE
+ This functions assumes that either number of tables to be inspected
+ by it is limited explicitly (i.e. is is not UINT_MAX) or table list
+ used and thd->lex->query_tables_own_last value correspond to each
+ other (the latter should be either 0 or point to next_global member
+ of one of elements of this table list).
****************************************************************************/
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,