1
1
# Grant tests not performed with embedded server
2
2
-- source include/not_embedded.inc
3
3
-- source include/have_query_cache.inc
4
# See at the end of the test why we disable the ps protocol (*)
5
7
--source include/add_anonymous_users.inc
159
161
# End of 4.1 tests
163
# (*) Why we disable the ps protocol: because in normal protocol,
164
# a SELECT failing due to insufficient privileges increments
165
# Qcache_not_cached, while in ps-protocol, no.
166
# In detail: in normal protocol,
167
# the "access denied" errors on SELECT are issued at (stack trace):
168
# mysql_parse/mysql_execute_command/execute_sqlcom_select/handle_select/
169
# mysql_select/JOIN::prepare/setup_wild/insert_fields/
170
# check_grant_all_columns/my_error/my_message_sql, which then calls
171
# push_warning/query_cache_abort: at this moment,
172
# query_cache_store_query() has been called, so query exists in cache,
173
# so thd->net.query_cache_query!=NULL, so query_cache_abort() removes
174
# the query from cache, which causes a query_cache.refused++ (thus,
175
# a Qcache_not_cached++).
176
# While in ps-protocol, the error is issued at prepare time;
177
# for this mysql_test_select() is called, not execute_sqlcom_select()
178
# (and that also leads to JOIN::prepare/etc). Thus, as
179
# query_cache_store_query() has not been called,
180
# thd->net.query_cache_query==NULL, so query_cache_abort() does nothing:
181
# Qcache_not_cached is not incremented.
182
# As this test prints Qcache_not_cached after SELECT failures,
183
# we cannot enable this test in ps-protocol.