[MDEV-16220] Tests : do not pass UTF8 to mysql in command line parameters, on Windows Created: 2018-05-18  Updated: 2021-09-29  Resolved: 2018-05-18

Status: Closed
Project: MariaDB Server
Component/s: Platform Windows, Tests
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 5.5.61

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-16221 Port WL#5331: Support Unicode for Win... Closed
Relates
relates to MDEV-26713 Windows - improve i18n support Closed

 Description   

Update 15.7 for Visual Studio 2017 brought changes to popen() implementation, so that several tests that use non-ASCII UTF8 on the command line now fail, like that

CURRENT_TEST: main.grant
ERROR 1045 (28000): Access denied for user '??зе??_??зе??'@'localhost' (using password: NO)
mysqltest: At line 1583: exec of 'D:\work\5.5\xxx\client\Debug\mysql.exe --defaults-file=D:/work/5.5/xxx/mysql-test/var/my.cnf --default-character-set=utf8 --user=юзер_юзер -e "select user()"' failed, error: 1, status: 1, errno: 0
Output from before failure:
grant select on test.* to юзер_юзер@localhost;

So it seems like bytes that are not valid in current (ANSI? OEM?) encoding are now replaced with question marks inside popen(), during ANSI/Unicode conversion somewhere in popen().
Even if we replace _popen with _wpopen() and convert ourselves. But then , characters outside of current repertoire will be replaced by question marks by the C runtime, that converts command line (which is UTF16 on windows) to argv, prior to main(). The correct way to deal with it it would be to implement "WL#5331: Support Unicode for Windows command line client" https://dev.mysql.com/worklog/task/?id=5331 for MariaDB (it was not ported on some reason).

But for now, we need to fix the affected tests and avoid UTF8 outside of pure ASCII in command line, at least for all older versions. For mysql client, a temporary file can be created that contains UTF8.
Tests with --user=юзер_юзер should be skipped, for now


Generated at Thu Feb 08 08:27:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.