mariadb/mysql-test/suite
Dmitry Lenev eaae675279 Fix for bug#57061 "User without privilege on routine can
discover its existence".

The problem was that user without any privileges on 
routine was able to find out whether it existed or not.
DROP FUNCTION and DROP PROCEDURE statements were 
checking if routine being dropped existed and reported 
ER_SP_DOES_NOT_EXIST error/warning before checking 
if user had enough privileges to drop it.

This patch solves this problem by changing code not to 
check if routine exists before checking if user has enough 
privileges to drop it. Moreover we no longer perform this 
check using a separate call instead we rely on 
sp_drop_routine() returning SP_KEY_NOT_FOUND if routine 
doesn't exist.

This change also simplifies one of upcoming patches
refactoring global read lock implementation.

mysql-test/r/grant.result:
  Updated test case after fixing bug#57061 "User without
  privilege on routine can discover its existence". Removed
  DROP PROCEDURE/FUNCTION statements which have started to
  fail after this fix (correctly). There is no need in
  dropping routines in freshly created database anyway.
mysql-test/r/sp-security.result:
  Added new test case for bug#57061 "User without privilege
  on routine can discover its existence". Updated existing
  tests according to new behaviour.
mysql-test/suite/funcs_1/r/innodb_storedproc_06.result:
  Updated test case after fixing bug#57061 "User without
  privilege on routine can discover its existence".
  Now we drop routines under user which has enough
  privileges to do so.
mysql-test/suite/funcs_1/r/memory_storedproc_06.result:
  Updated test case after fixing bug#57061 "User without
  privilege on routine can discover its existence".
  Now we drop routines under user which has enough
  privileges to do so.
mysql-test/suite/funcs_1/r/myisam_storedproc_06.result:
  Updated test case after fixing bug#57061 "User without
  privilege on routine can discover its existence".
  Now we drop routines under user which has enough
  privileges to do so.
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc:
  Updated test case after fixing bug#57061 "User without
  privilege on routine can discover its existence".
  Now we drop routines under user which has enough
  privileges to do so.
mysql-test/t/grant.test:
  Updated test case after fixing bug#57061 "User without
  privilege on routine can discover its existence". Removed
  DROP PROCEDURE/FUNCTION statements which have started to
  fail after this fix (correctly). There is no need in
  dropping routines in freshly created database anyway.
mysql-test/t/sp-security.test:
  Added new test case for bug#57061 "User without privilege
  on routine can discover its existence". Updated existing
  tests according to new behaviour.
sql/sp.cc:
  Removed sp_routine_exists_in_table() which is no longer
  used.
sql/sp.h:
  Removed sp_routine_exists_in_table() which is no longer
  used.
sql/sql_parse.cc:
  When dropping routine we no longer check if routine exists 
  before checking if user has enough privileges to do so. 
  Moreover we no longer perform this check using a separate 
  call instead we rely on sp_drop_routine() returning 
  SP_KEY_NOT_FOUND if routine doesn't exist.
2010-10-07 20:01:17 +04:00
..
binlog Auto-merge from mysql-5.5-merge. 2010-09-28 19:15:58 +04:00
bugs Bug #49741 test files contain explicit references to bin/relay-log positions 2010-05-24 21:54:08 +08:00
engines Manual merge 2010-05-26 22:34:25 +08:00
federated WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
funcs_1 Fix for bug#57061 "User without privilege on routine can 2010-10-07 20:01:17 +04:00
funcs_2 Bug#53563 Fix and enable charset/collation tests in funcs_2 2010-08-19 09:31:24 +02:00
ibmdb2i Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
innodb Merge from mysql-5.5-runtime to mysql-5.5-bugteam 2010-10-07 14:12:33 +02:00
jp WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
large_tests bug#50296 2010-02-28 19:39:28 +02:00
manual Bug #49741 test files contain explicit references to bin/relay-log positions 2010-05-24 21:54:08 +08:00
ndb Post-fix push for BUG#53452. 2010-08-25 15:13:20 +01:00
ndb_team Manual merge 2010-05-26 22:34:25 +08:00
parts Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c 2010-10-06 11:34:28 -03:00
perfschema merge 2010-10-04 15:42:16 +03:00
perfschema_stress WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
rpl merge 2010-10-04 15:42:16 +03:00
rpl_ndb Post-fix push for BUG#53452. 2010-08-25 15:13:20 +01:00
stress
sys_vars Merge from mysql-5.5-runtime to mysql-5.5-bugteam 2010-10-07 14:12:33 +02:00