List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:June 27 2007 7:37pm
Subject:Re: bk commit into 5.0 tree (anozdrin:1.2503) BUG#10491
View as plain text  
Hello Alik,

* Alexander Nozdrin <alik@stripped> [07/06/27 17:29]:

> ChangeSet@stripped, 2007-06-27 17:10:17+04:00, anozdrin@ibm. +3 -0
>   Fix for BUG#10491: Server returns data as charset binary
>   SHOW CREATE TABLE or SELECT FROM I_S.
>   
>   Actually, the bug discovers two problems:
>     - the original query is not preserved properly. This is the problem
>       of BUG#16291;
>     - the resultset of SHOW CREATE TABLE statement is binary.
>   
>   This patch fixes the second problem for the 5.0.
>   
>   Both problems will be fixed in 5.1.

The patch is OK to push, see below.

>   sql/item.h@stripped, 2007-06-27 17:10:14+04:00, anozdrin@ibm. +1 -1
>     Use utf8_general_ci instead of binary collation by default.

Please explain why - i.e. because for views and base tables utf8
is the character set in which the their definition is stored,
for system constants it's the default character set, and for other
objects (routines, triggers), no character set is stored, and
therefore no character set is known, so returning utf8 is just as
good as anything else. This latter problem is fixed in 5.1 by
16291. In 5.1 we will return the "real" character set.

> +Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max
> length	Is_null	Flags	Decimals	Charsetnr
> +def			STATISTICS	TABLE_NAME	Table	253	64	2	N	1	0	8
> +def			STATISTICS	NON_UNIQUE	Non_unique	8	1	1	N	32769	0	63
> +def			STATISTICS	INDEX_NAME	Key_name	253	64	7	N	1	0	8
> +def			STATISTICS	SEQ_IN_INDEX	Seq_in_index	8	2	1	N	32769	0	63
> +def			STATISTICS	COLUMN_NAME	Column_name	253	64	1	N	1	0	8
> +def			STATISTICS	COLLATION	Collation	253	1	1	Y	0	0	8
> +def			STATISTICS	CARDINALITY	Cardinality	8	21	1	Y	32768	0	63
> +def			STATISTICS	SUB_PART	Sub_part	8	3	0	Y	32768	0	63
> +def			STATISTICS	PACKED	Packed	253	10	0	Y	0	0	8
> +def			STATISTICS	NULLABLE	Null	253	3	0	N	1	0	8
> +def			STATISTICS	INDEX_TYPE	Index_type	253	16	5	N	1	0	8
> +def			STATISTICS	COMMENT	Comment	253	16	0	Y	0	0	8

Please provide comments on what you're actually looking for in the
test output. It's best if these comments make it not only into
.test but also into .result, to ease merges conflicts.
Additionally I filed Bug#29394 "extend syntax of
--enable_metadata command of mysqltest language" (Feature request),
which would be very handy to use in this test case.
Perhaps the test case could be re-worked when the bug is fixed.

>  --echo End of 5.0 tests
> diff -Nrup a/sql/item.h b/sql/item.h
> --- a/sql/item.h	2007-06-14 15:37:34 +04:00
> +++ b/sql/item.h	2007-06-27 17:10:14 +04:00
> @@ -1768,7 +1768,7 @@ class Item_empty_string :public Item_str
>  {
>  public:
>    Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
> -    Item_string("",0, cs ? cs : &my_charset_bin)
> +    Item_string("",0, cs ? cs : &my_charset_utf8_general_ci)
>      { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
>    void make_field(Send_field *field);
>  };

Please add a comment in front of Item_empty_string describing the
purpose of this class (it's a utility class to put into List<Item>
which is then used in protocol.send_fields() when sending SHOW
output to the client).

-- 
-- Konstantin Osipov              Software Developer, Moscow, Russia
-- MySQL AB, www.mysql.com   The best DATABASE COMPANY in the GALAXY
Thread
bk commit into 5.0 tree (anozdrin:1.2503) BUG#10491Alexander Nozdrin27 Jun
  • Re: bk commit into 5.0 tree (anozdrin:1.2503) BUG#10491Konstantin Osipov27 Jun