mirror of
https://github.com/MariaDB/server.git
synced 2025-07-24 19:42:23 +03:00
MDEV-27142 disable text mode for Windows stdio by default
This avoids LF->CRLF conversion by the C runtime, which historically has been rather buggy (see MDEV-9409) Disabling text mode also fixes the --binary-mode in command line client to work the same on Windows, as it does elsewhere. The user-visible effect is that some text files, e.g output of mysqldump or mysqlbinlog will not have CRLF end-of-lines,but LF. That should be acceptable, as even Notepad can read this Unix EOLs since 2018 (on older Windows, Wordpad can) Leave error log in text(CRLF) mode for now, for the sake of old Windows.
This commit is contained in:
@ -48,27 +48,15 @@ RESET MASTER;
|
||||
--echo # It creates the table with a wrong table name and generates an error.
|
||||
--echo # (error output was suppressed to make the test case platform agnostic)
|
||||
|
||||
## disabling result log because the error message has the
|
||||
## table name in the output which is one byte different ('\r')
|
||||
## on unixes and windows.
|
||||
|
||||
--disable_result_log
|
||||
--error 1
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/my.sql 2>&1
|
||||
--enable_result_log
|
||||
|
||||
--echo
|
||||
--echo # It is not in binary_mode, so table name '0x410D0A42' can be translated to
|
||||
--echo # '0x410A42' by mysql depending on the OS - Windows or Unix-like.
|
||||
--replace_result $table_name_wrong TABLE_NAME_MASKED $table_name_right TABLE_NAME_MASKED
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
eval DROP TABLE `$table_name_right`;
|
||||
}
|
||||
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
eval DROP TABLE `$table_name_wrong`;
|
||||
}
|
||||
eval DROP TABLE `$table_name_wrong`;
|
||||
|
||||
--echo
|
||||
--echo # In binary_mode, table name '0x410D0A42' and string '0x410042' can be
|
||||
@ -150,15 +138,9 @@ RESET MASTER;
|
||||
--let $assert_cond= "$tbl0" = "610D0A62" AND "$val0" = "610D0A62"
|
||||
--source include/assert.inc
|
||||
|
||||
--let $assert_text= Table and contents created while replaying binary log without --binary-mode set match 0x61(0D)0A62.
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
--let $assert_cond= "$tbl1" = "610D0A62" AND "$val1" = "610D0A62"
|
||||
}
|
||||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
|
||||
{
|
||||
--let $assert_cond= "$tbl1" = "610A62" AND "$val1" = "610A62"
|
||||
}
|
||||
--let $assert_text= Table and contents created while replaying binary log without --binary-mode set match 0x610A62.
|
||||
--let $assert_cond= "$tbl1" = "610A62" AND "$val1" = "610A62"
|
||||
|
||||
--source include/assert.inc
|
||||
|
||||
--let $assert_text= Table and contents created while replaying binary log with --binary-mode set match 0x610D0A62.
|
||||
|
Reference in New Issue
Block a user