Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16220

Tests : do not pass UTF8 to mysql in command line parameters, on Windows

    XMLWordPrintable

Details

    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

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.