diff options
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 593e0f74596..b65515c9e01 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -639,7 +639,8 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) if (table_list->view) { - protocol->store(buffer.ptr(), buffer.length(), &my_charset_bin); + protocol->store(buffer.ptr(), buffer.length(), + table_list->view_creation_ctx->get_client_cs()); protocol->store(table_list->view_creation_ctx->get_client_cs()->csname, system_charset_info); @@ -5967,6 +5968,8 @@ static bool show_create_trigger_impl(THD *thd, LEX_STRING trg_connection_cl_name; LEX_STRING trg_db_cl_name; + CHARSET_INFO *trg_client_cs; + /* TODO: Check privileges here. This functionality will be added by implementation of the following WL items: @@ -5992,6 +5995,11 @@ static bool show_create_trigger_impl(THD *thd, trg_sql_mode, &trg_sql_mode_str); + /* Resolve trigger client character set. */ + + if (resolve_charset(trg_client_cs_name.str, NULL, &trg_client_cs)) + return TRUE; + /* Send header. */ fields.push_back(new Item_empty_string("Trigger", NAME_LEN)); @@ -6038,7 +6046,7 @@ static bool show_create_trigger_impl(THD *thd, p->store(trg_sql_original_stmt.str, trg_sql_original_stmt.length, - &my_charset_bin); + trg_client_cs); p->store(trg_client_cs_name.str, trg_client_cs_name.length, |