~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to mysql-test/t/grant_cache.test

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
-- disable_ps_protocol
4
6
 
5
7
--source include/add_anonymous_users.inc
6
8
 
157
159
 
158
160
 
159
161
# End of 4.1 tests
 
162
 
 
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.
 
184
 
 
185
--enable_ps_protocol