-
Alexander Barkov authored
Based on the original patch form Vladislav Vaintroub: http://lists.mysql.com/commits/105379 @ client/mysql.cc - introducing new function tee_write(), to reuse in a number of places where similar loops displaying data occurs. - introducing flags for tee_write(), to support different printing modes, according to --xml, --raw, --tab, etc, parameters - Instead if using argv (which is always in ANSI code page), we now use UTF16LE API to access command line arguments on Windows, using this scenario: a. We translate arguments to UTF8MB4 on startup. b. Then we process arguments and detect connection character set from --default-character-set arguments (or my.ini value), or from the OS localization information by default. c. Then we convert user, database and the --execute (-e) buffer from UTF8MB4 to the connection character set. d. Connect - Instead of printing using printif/fputs family functions on Windows, which are limited to the current DOS code page (cp850 on a Western machine) we now use UTF16LE console API through the new my_win_console_xxx() functions implemented in my_conio.c - Using mysql_set_character_set() instead of mysql_option(OPT_CHARACTER_SET_NAME) to know the ongoing session character set *before* mysql_real_connect() call, to convert user and database properly. - my_win_is_console_cached() has been added to cache my_win_is_console() result for stdout and stderr, for performance purposes. @ client/mysqltest.cc - Introducing a new mysqltest command: --execw, to execute commands with non-ASCII characters correctly in Windows. @ include/my_sys.h - Adding prototypes for the my_win_console_xxx() functions @ mysql-test/grant.test @ mysql-test/t/mysql.test @ mysql-test/t/mysql_cp932.test @ mysql-test/t/mysqlbinlog-cp932.test - Using --execw instead of --exec for the affected tests @ mysys/my_conio.c - Implementing functions for Windows console read/write and command line argument processing. - Removing my_cgets(), as it's not used any more. @ sql-common/client.c - Fixing mysql_set_character_set() to set mysql.charset on a non-connected "mysql". Previously such a call crashed. This change allows to know what character set for the ongoing session is going to be *before* calling mysql_real_connect(). This is needed in mysql.cc, to convert user and database correctly on Windows.
Alexander Barkov authoredBased on the original patch form Vladislav Vaintroub: http://lists.mysql.com/commits/105379 @ client/mysql.cc - introducing new function tee_write(), to reuse in a number of places where similar loops displaying data occurs. - introducing flags for tee_write(), to support different printing modes, according to --xml, --raw, --tab, etc, parameters - Instead if using argv (which is always in ANSI code page), we now use UTF16LE API to access command line arguments on Windows, using this scenario: a. We translate arguments to UTF8MB4 on startup. b. Then we process arguments and detect connection character set from --default-character-set arguments (or my.ini value), or from the OS localization information by default. c. Then we convert user, database and the --execute (-e) buffer from UTF8MB4 to the connection character set. d. Connect - Instead of printing using printif/fputs family functions on Windows, which are limited to the current DOS code page (cp850 on a Western machine) we now use UTF16LE console API through the new my_win_console_xxx() functions implemented in my_conio.c - Using mysql_set_character_set() instead of mysql_option(OPT_CHARACTER_SET_NAME) to know the ongoing session character set *before* mysql_real_connect() call, to convert user and database properly. - my_win_is_console_cached() has been added to cache my_win_is_console() result for stdout and stderr, for performance purposes. @ client/mysqltest.cc - Introducing a new mysqltest command: --execw, to execute commands with non-ASCII characters correctly in Windows. @ include/my_sys.h - Adding prototypes for the my_win_console_xxx() functions @ mysql-test/grant.test @ mysql-test/t/mysql.test @ mysql-test/t/mysql_cp932.test @ mysql-test/t/mysqlbinlog-cp932.test - Using --execw instead of --exec for the affected tests @ mysys/my_conio.c - Implementing functions for Windows console read/write and command line argument processing. - Removing my_cgets(), as it's not used any more. @ sql-common/client.c - Fixing mysql_set_character_set() to set mysql.charset on a non-connected "mysql". Previously such a call crashed. This change allows to know what character set for the ongoing session is going to be *before* calling mysql_real_connect(). This is needed in mysql.cc, to convert user and database correctly on Windows.
Loading