Hi Bar!
Patch looks good. Patch is OK to push.
Just my few cents,
Mats Kindahl
bar@stripped wrote:
> Below is the list of changes that have just been committed into a local
> 5.0 repository of bar. When bar does a push these changes will
> be propagated to the main repository and, within 24 hours after the
> push, to the public repository.
> For information on how to access the public repository
> see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
>
> ChangeSet@stripped, 2007-10-04 13:06:01+05:00, bar@stripped +3 -0
> Bug#29323 mysql client only accetps ANSI encoded files
> Fix: ignore BOM marker in the first line.
>
> client/mysql.cc@stripped, 2007-10-04 13:05:59+05:00, bar@stripped +11 -0
> Skip BOM marker in the very first line.
>
> mysql-test/r/mysql.result@stripped, 2007-10-04 13:05:59+05:00, bar@stripped +2 -0
> Adding test
>
> mysql-test/t/mysql.test@stripped, 2007-10-04 13:05:59+05:00, bar@stripped +9 -0
> Adding test
>
> diff -Nrup a/client/mysql.cc b/client/mysql.cc
> --- a/client/mysql.cc 2007-08-30 13:53:20 +05:00
> +++ b/client/mysql.cc 2007-10-04 13:05:59 +05:00
> @@ -1042,6 +1042,17 @@ static int read_and_execute(bool interac
> if (!interactive)
> {
> line=batch_readline(status.line_buff);
> + /*
> + Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
> + Editors like "notepad" put this marker in
> + the very beginning of a text file when
> + you save the file using "Unicode UTF-8" format.
> + */
> + if (!line_number &&
> + (uchar) line[0] == 0xEF &&
> + (uchar) line[1] == 0xBB &&
> + (uchar) line[2] == 0xBF)
> + line+= 3;
> line_number++;
> if (!glob_buffer.length())
> status.query_start_line=line_number;
> diff -Nrup a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
> --- a/mysql-test/r/mysql.result 2007-09-20 13:54:44 +05:00
> +++ b/mysql-test/r/mysql.result 2007-10-04 13:05:59 +05:00
> @@ -178,4 +178,6 @@ ERROR at line 1: DELIMITER cannot contai
> 1
> 1
> 1
> +This is a file starting with UTF8 BOM 0xEFBBBF
> +This is a file starting with UTF8 BOM 0xEFBBBF
> End of 5.0 tests
> diff -Nrup a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
> --- a/mysql-test/t/mysql.test 2007-09-05 01:38:23 +05:00
> +++ b/mysql-test/t/mysql.test 2007-10-04 13:05:59 +05:00
> @@ -281,4 +281,13 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug214
> #
> --exec $MYSQL test -e "/*! \C latin1 */ select 1;"
>
> +#
> +# Bug#29323 mysql client only accetps ANSI encoded files
> +#
> +--write_file $MYSQLTEST_VARDIR/tmp/bug29323.sql
> +select "This is a file starting with UTF8 BOM 0xEFBBBF";
> +EOF
> +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1
> +remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
> +
> --echo End of 5.0 tests
>
>
--
Mats Kindahl
Lead Software Developer
Replication Team
MySQL AB, www.mysql.com