Hi!
On Aug 01, bar@stripped wrote:
> ChangeSet@stripped, 2007-08-01 16:25:51+05:00, bar@stripped +19 -0
> Bug#28875 Conversion between ASCII and LATIN1 charsets does not function
> (Regression, caused by a patch for the bug 22646).
> Problem: when result type of date_format() was changed from
> binary string to character string, mixing date_format()
> with a ascii column in CONCAT() stopped to work.
> Fix:
> - adding "repertoire" flag into DTCollation class,
> to mark items which can return only pure ASCII strings.
> - allow character set conversion from pure ASCII to other character sets.
Ok to push
with a couple of changes.
> --- 1.223/sql/sql_lex.cc 2007-05-26 03:17:18 +05:00
> +++ 1.224/sql/sql_lex.cc 2007-08-01 16:25:45 +05:00
> @@ -305,16 +305,18 @@ static LEX_STRING get_quoted_token(Lex_i
> Fix sometimes to do only one scan of the string
> */
>
> -static char *get_text(Lex_input_stream *lip)
> +static char *get_text(Lex_input_stream *lip, uchar *bitmask)
Please, consider moving bitmap to Lex_input_stream.
Something like tok_bitmap.
> {
> reg1 uchar c,sep;
> uint found_escape= 0;
> CHARSET_INFO *cs= lip->m_thd->charset();
>
> + *bitmask= 0;
> sep= yyGetLast(); // String should end with this
> while (lip->ptr != lip->end_of_query)
> {
> c= yyGet();
> + *bitmask|= c;
> #ifdef USE_MB
> {
Second comment: Add to String::copy a check to avoid charset conversion
if from_cs is ascii.
Because now you have a function that tells "X charset is a superset of Y
charset", and then you call String::copy to convert. But "utf8 is a
superset of latin1" is different from "latin1 is a superset of ascii" -
in the first case one needs to convert the string, in the second memcpy
is enough.
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Radlkoferstr. 2, D-81373 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140