Bug #31273 If plugin system variable check routine returns a error MySQL will freeze

Submitted: 28 Sep 2007 7:23 Modified: 9 Jan 2008 8:05
Reporter: Jan Lindström Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.1-bk OS:Any
Assigned to: CPU Architecture:Any

[28 Sep 2007 7:23] Jan Lindström
Description:
Plugin can declare system variables with check and update functions .e.g:

static MYSQL_SYSVAR_STR(admin_command, soliddb_admin_command,
                        PLUGIN_VAR_RQCMDARG,
                        "User can specify admin commands using this parameter",
                        soliddb_check_admin_command, soliddb_update_admin_command, NULL);

Check function can return a error if value provided by the user contains erros e.g.:

int soliddb_check_admin_command(
        MYSQL_THD thd,
        struct st_mysql_sys_var* var,
        void*                    save,
        struct st_mysql_value*   value)
{
        su_ret_t rc = SU_SUCCESS;
        su_err_t* errh=NULL;
        SOLID_CONN* con=NULL;
        char buff[STRING_BUFFER_USUAL_SIZE];
        int length;

        length= sizeof(buff);
        soliddb_admin_command = (char *)value->val_str(value, buff, &length);

        if (soliddb_admin_command) {
            rc = do_command(soliddb_admin_command, NULL, &errh);
        } else {
            rc = DBE_ERR_FAILED;
        }

        if (rc != SU_SUCCESS) {

            DBUG_RETURN(1);
        }

        DBUG_RETURN(0);
}

However, if check function really returns a nonzero value MySQL will freeze:

Your MySQL connection id is 1
Server version: 5.1.23-beta-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set global soliddb_admin_command='status'; -- this is not legal
Query aborted by Ctrl+C

How to repeat:
set global soliddb_admin_command='status';
[9 Jan 2008 8:05] Tatiana Azundris Nuernberg
Whichever fix we'll use for Bug#32757 should also fix this.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.