From: Staale Smedseng Date: April 22 2010 1:52pm Subject: bzr commit into mysql-5.1-bugteam branch (staale.smedseng:3356) Bug#46261 List-Archive: http://lists.mysql.com/commits/106364 X-Bug: 46261 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4851697593025223467==" --===============4851697593025223467== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///export/home/tmp/ss156133/z/46261-51/ based on revid:kristofer.pettersson@stripped 3356 Staale Smedseng 2010-04-22 Bug#46261 Plugins can be installed with --skip-grant-tables Previously installed dynamic plugins are explicitly not loaded on startup with --skip-grant-tables enabled. However, INSTALL PLUGIN/UNINSTALL PLUGIN commands are allowed, and result in inconsistent error messages (reporting duplicate plugin or plugin does not exist). This patch adds a check for --skip-grant-tables mode, and returns error ER_OPTION_PREVENTS_STATEMENT to the user when the above commands are attempted. added: mysql-test/r/bug46261.result mysql-test/t/bug46261-master.opt mysql-test/t/bug46261.test modified: sql/sql_plugin.cc === added file 'mysql-test/r/bug46261.result' --- a/mysql-test/r/bug46261.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/r/bug46261.result 2010-04-22 13:52:00 +0000 @@ -0,0 +1,8 @@ +# +# Bug#46261 Plugins can be installed with --skip-grant-tables +# +INSTALL PLUGIN example SONAME 'ha_example.so'; +ERROR HY000: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement +UNINSTALL PLUGIN example; +ERROR HY000: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement +End of 5.1 tests === added file 'mysql-test/t/bug46261-master.opt' --- a/mysql-test/t/bug46261-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/bug46261-master.opt 2010-04-22 13:52:00 +0000 @@ -0,0 +1 @@ +--skip-grant-tables $EXAMPLE_PLUGIN_OPT === added file 'mysql-test/t/bug46261.test' --- a/mysql-test/t/bug46261.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/bug46261.test 2010-04-22 13:52:00 +0000 @@ -0,0 +1,16 @@ +--source include/not_embedded.inc +--source include/have_example_plugin.inc + +--echo # +--echo # Bug#46261 Plugins can be installed with --skip-grant-tables +--echo # + +--replace_regex /\.dll/.so/ +--error ER_OPTION_PREVENTS_STATEMENT +eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; + +--replace_regex /\.dll/.so/ +--error ER_OPTION_PREVENTS_STATEMENT +eval UNINSTALL PLUGIN example; + +--echo End of 5.1 tests === modified file 'sql/sql_plugin.cc' --- a/sql/sql_plugin.cc 2010-04-16 13:02:23 +0000 +++ b/sql/sql_plugin.cc 2010-04-22 13:52:00 +0000 @@ -1665,6 +1665,12 @@ bool mysql_install_plugin(THD *thd, cons struct st_plugin_int *tmp; DBUG_ENTER("mysql_install_plugin"); + if (opt_noacl) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables"); + DBUG_RETURN(TRUE); + } + bzero(&tables, sizeof(tables)); tables.db= (char *)"mysql"; tables.table_name= tables.alias= (char *)"plugin"; @@ -1741,6 +1747,12 @@ bool mysql_uninstall_plugin(THD *thd, co struct st_plugin_int *plugin; DBUG_ENTER("mysql_uninstall_plugin"); + if (opt_noacl) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables"); + DBUG_RETURN(TRUE); + } + bzero(&tables, sizeof(tables)); tables.db= (char *)"mysql"; tables.table_name= tables.alias= (char *)"plugin"; --===============4851697593025223467== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/staale.smedseng@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: staale.smedseng@stripped # target_branch: file:///export/home/tmp/ss156133/z/46261-51/ # testament_sha1: 7327ced5912a61679dc1cbfd045f406a818756a1 # timestamp: 2010-04-22 15:52:05 +0200 # base_revision_id: kristofer.pettersson@stripped\ # 24ar0rrqdbytwte8 # # Begin bundle IyBCYXphY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