From eecaad9dccd790f82dc2c032d6bb8101feab1fdf Mon Sep 17 00:00:00 2001 From: Mayank Prasad Date: Fri, 10 Jun 2011 19:56:35 +0530 Subject: Bug#12337762 : MYSQL_LIST_FIELDS() RETURNS WRONG CHARSET FOR CHAR/VARCHAR/TEXT COLUMNS IN VIEWS Issue: charset value for a Column, returned by MYSQL_LIST_FIELDS(), was not same for Table and View. This was because, for view, field charset was not being returned. Solution: Added definition of function "charset_for_protocol()" in calss Item_ident_for_show to return field charset value. sql/item.h: Added definition for charset_for_protocol() function to return field charset. tests/mysql_client_test.c: Added a test case test_bug12337762 for the changes done. --- sql/item.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql') diff --git a/sql/item.h b/sql/item.h index 96b8c9eb2e4..46916346ebe 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1672,6 +1672,8 @@ public: String *val_str(String *str) { return field->val_str(str); } my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); } void make_field(Send_field *tmp_field); + CHARSET_INFO *charset_for_protocol(void) const + { return field->charset_for_protocol(); } }; -- cgit v1.2.1