mariadb/mysql-test/suite/funcs_1/r
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
..
charset_collation.result Fix for Bug#40545, Bug#40209, Bug#40618, Bug#38346 2009-06-19 17:04:25 +02:00
innodb_bitdata.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
innodb_cursors.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
innodb_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
innodb_storedproc_02.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
innodb_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
innodb_storedproc_06.result Fix for bug#57061 "User without privilege on routine can 2010-10-07 20:01:17 +04:00
innodb_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
innodb_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
innodb_storedproc_10.result Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
innodb_trig_03.result Fixed many funcs_1 tests after 43588 2010-03-19 10:02:42 +01:00
innodb_trig_03e.result merged mysql-5.5 into WL1054-5.5 2010-08-16 18:16:07 +03:00
innodb_trig_08.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
innodb_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
innodb_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
innodb_trig_0407.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
innodb_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
innodb_trig_frkey.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
innodb_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
is_basics_mixed.result merge 2010-07-09 15:40:38 +03:00
is_character_sets.result Bug#35789 wrong datatypes for collation and charset columns in EVENTS, ROUTINES, TRIGGERS 2008-11-13 13:50:20 +04:00
is_cml_innodb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_cml_memory.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_cml_myisam.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_cml_ndb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_coll_char_set_appl.result Fix for Bug#43383 main.variables-big : Weak testing code and result 2009-03-26 19:12:19 +01:00
is_collations.result Bug#35789 wrong datatypes for collation and charset columns in EVENTS, ROUTINES, TRIGGERS 2008-11-13 13:50:20 +04:00
is_column_privileges.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_column_privileges_is_mysql_test.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
is_columns.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_columns_innodb.result merge 2010-07-16 18:04:39 +03:00
is_columns_is.result merge 2010-07-16 18:04:39 +03:00
is_columns_is_embedded.result backported: 2010-01-15 15:42:15 +04:00
is_columns_memory.result merge 2010-07-16 18:04:39 +03:00
is_columns_myisam.result merge 2010-07-16 18:04:39 +03:00
is_columns_myisam_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_columns_mysql.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_columns_mysql_embedded.result backported: 2010-01-15 15:42:15 +04:00
is_columns_ndb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_engines.result Bug#29263 disabled storage engines omitted in SHOW ENGINES 2008-12-17 19:45:34 +04:00
is_engines_archive.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_blackhole.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_csv.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_federated.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_innodb.result WL#5349 Change default storage engine to InnoDB 2010-06-17 22:51:35 +02:00
is_engines_memory.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_merge.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_engines_myisam.result BUG#54832 - Comment for MyISAM says it is a default engine 2010-07-05 11:34:29 +04:00
is_engines_ndb.result Post merge fixes after 2008-03-07 20:18:14 +01:00
is_events.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_key_column_usage.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_key_column_usage_embedded.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
is_routines.result backported: 2010-01-15 15:42:15 +04:00
is_routines_embedded.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
is_schema_privileges.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_schema_privileges_is_mysql_test.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_schemata.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
is_schemata_embedded.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
is_schemata_is_mysql_test.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_statistics.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_statistics_is.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_statistics_mysql.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_statistics_mysql_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_table_constraints.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_table_constraints_is.result WL#4203 Reorganize and fix the data dictionary tests of 2008-03-07 17:33:07 +01:00
is_table_constraints_mysql.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_table_constraints_mysql_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_table_privileges.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables.result Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
is_tables_embedded.result Fix for 2008-06-16 20:39:58 +02:00
is_tables_innodb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_is.result backported: 2010-01-15 15:42:15 +04:00
is_tables_memory.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_myisam.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_myisam_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_mysql.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_tables_mysql_embedded.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_tables_ndb.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_triggers.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_triggers_embedded.result Fix for 2008-06-16 20:39:58 +02:00
is_user_privileges.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
is_views.result Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def" 2009-10-23 16:02:20 +05:00
is_views_embedded.result Fix for 2008-06-16 20:39:58 +02:00
memory_bitdata.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
memory_cursors.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
memory_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
memory_storedproc_02.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
memory_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
memory_storedproc_06.result Fix for bug#57061 "User without privilege on routine can 2010-10-07 20:01:17 +04:00
memory_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
memory_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
memory_storedproc_10.result Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
memory_trig_03.result Fixed many funcs_1 tests after 43588 2010-03-19 10:02:42 +01:00
memory_trig_03e.result merged mysql-5.5 into WL1054-5.5 2010-08-16 18:16:07 +03:00
memory_trig_08.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
memory_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
memory_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
memory_trig_0407.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
memory_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
memory_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
myisam_bitdata.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
myisam_cursors.result 1. Upmerge of fix for the bugs 2008-06-18 19:23:55 +02:00
myisam_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
myisam_storedproc_02.result Auto-merge from mysql-trunk-bugfixing. 2010-07-30 19:28:36 +04:00
myisam_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
myisam_storedproc_06.result Fix for bug#57061 "User without privilege on routine can 2010-10-07 20:01:17 +04:00
myisam_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
myisam_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
myisam_storedproc_10.result Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
myisam_trig_03.result Fixed many funcs_1 tests after 43588 2010-03-19 10:02:42 +01:00
myisam_trig_03e.result merged mysql-5.5 into WL1054-5.5 2010-08-16 18:16:07 +03:00
myisam_trig_08.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
myisam_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
myisam_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
myisam_trig_0407.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
myisam_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
myisam_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
ndb_bitdata.result Post merge fix for 2008-03-12 12:56:07 +01:00
ndb_cursors.result Post merge fix for 2008-03-12 12:56:07 +01:00
ndb_func_view.result Fixed more PB2 test failures introduced by backporting WL#2934. 2009-12-22 23:55:56 +03:00
ndb_storedproc_02.result Post merge fixes 2009-09-11 01:15:41 -06:00
ndb_storedproc_03.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
ndb_storedproc_06.result Two more funcs_1 updates after 43588 2010-03-22 11:32:17 +01:00
ndb_storedproc_07.result Bug #21099 MySQL 5.0.22 silently creates MyISAM tables even though 2009-10-09 16:52:02 +02:00
ndb_storedproc_08.result backported: 2010-01-15 15:42:15 +04:00
ndb_storedproc_10.result Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
ndb_trig_03.result Fixed many funcs_1 tests after 43588 2010-03-19 10:02:42 +01:00
ndb_trig_03e.result Fixed many funcs_1 tests after 43588 2010-03-19 10:02:42 +01:00
ndb_trig_08.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
ndb_trig_09.result after-push test update (bug #39265) 2009-02-05 17:51:00 +04:00
ndb_trig_0102.result Fix for Bug#42836 Funcs_1 storedproc and storedproc_08 tests failing 2009-02-13 19:07:56 +01:00
ndb_trig_0407.result Fixed many funcs_1 tests after 43588 2010-03-19 09:56:26 +01:00
ndb_trig_1011ext.result Rename std_data_ln to std_data. 2009-01-31 17:22:59 -02:00
ndb_views.result Follow-up for patch that addresses bug #53976 "ALTER TABLE 2010-05-30 11:48:22 +04:00
processlist_priv_no_prot.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
processlist_priv_ps.result WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
processlist_val_no_prot.result Part of fix for bug#52044 "FLUSH TABLES WITH READ LOCK and 2010-08-06 15:29:37 +04:00
processlist_val_ps.result Part of fix for bug#52044 "FLUSH TABLES WITH READ LOCK and 2010-08-06 15:29:37 +04:00
row_count_func.result Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect 2010-05-14 09:28:51 +04:00
storedproc.result merge from trunk-mtr 2010-08-05 14:53:09 +02:00