diff options
author | Michael Widenius <monty@askmonty.org> | 2011-05-10 18:17:43 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-05-10 18:17:43 +0300 |
commit | f34be1893892745b5b1a7a099eab4ad8e9ac8641 (patch) | |
tree | d7eed818fd8b648e5eabe0dbad53e61665d8dc37 /sql/sql_parse.cc | |
parent | e843297d128b165125d17aab8958f7ca91808923 (diff) | |
parent | 8882d71f3f1dd03ef98d072def39b29e6a03f5b8 (diff) | |
download | mariadb-git-f34be1893892745b5b1a7a099eab4ad8e9ac8641.tar.gz |
Merge with MariaDB 5.2
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e2031c129b0..2699443ebd0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1133,7 +1133,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, uint save_db_length= thd->db_length; char *save_db= thd->db; USER_CONN *save_user_connect= thd->user_connect; - Security_context save_security_ctx= *thd->security_ctx; + Security_context save_security_ctx= *thd->security_ctx; CHARSET_INFO *save_character_set_client= thd->variables.character_set_client; CHARSET_INFO *save_collation_connection= @@ -1141,8 +1141,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd, CHARSET_INFO *save_character_set_results= thd->variables.character_set_results; + /* Ensure we don't free security_ctx->user in case we have to revert */ + thd->security_ctx->user= 0; + if (acl_authenticate(thd, 0, packet_length)) { + /* Free user if allocated by acl_authenticate */ x_free(thd->security_ctx->user); *thd->security_ctx= save_security_ctx; thd->user_connect= save_user_connect; |