mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-9524 Cannot load from mysql.event when sql_mode is set to PAD_CHAR_TO_FULL_LENGTH
The patch fixes the problem with loading information from system tables (e.g. event and help related tables) when PAD_CHAR_TO_FULL_LENGTH is enabled, as well as includes some additional minor improvements: - refactoring in get_field() to return an error rather than success if strmake_root() failed - removing of duplicate code in similar functions: char *get_field(MEM_ROOT *mem, Field *field) bool get_field(MEM_ROOT *mem, Field *field, String *res)
This commit is contained in:
@ -647,7 +647,7 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen,
|
||||
TRUE Error and send_error already commited
|
||||
*/
|
||||
|
||||
bool mysqld_help(THD *thd, const char *mask)
|
||||
static bool mysqld_help_internal(THD *thd, const char *mask)
|
||||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
SQL_SELECT *select;
|
||||
@ -823,3 +823,12 @@ error2:
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
|
||||
bool mysqld_help(THD *thd, const char *mask)
|
||||
{
|
||||
ulonglong sql_mode_backup= thd->variables.sql_mode;
|
||||
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
|
||||
bool rc= mysqld_help_internal(thd, mask);
|
||||
thd->variables.sql_mode= sql_mode_backup;
|
||||
return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user