Bug #72150 | mysqlcheck utility on Windows fails with spurious error on non-latin table names | ||
---|---|---|---|
Submitted: | 28 Mar 2014 12:10 | Modified: | 4 Aug 2014 9:15 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S2 (Serious) |
Version: | 5.1.73, 5.6.16 | OS: | Windows (7/64) |
Assigned to: | CPU Architecture: | Any |
[28 Mar 2014 12:10]
Peter Laursen
[28 Mar 2014 12:17]
Peter Laursen
With hindsight, I think the problem may be the table name 'русский'. This is cyrillic and my system LOCALE is Western (Danish) If this means that mysql_upgrade is not capable of handling Unicode file names on Windows, it is a pretty serious bug IMO. So assuming that I located the problem I am reasing severity to "S2".
[28 Mar 2014 13:10]
Peter Laursen
I can run "CHECK TABLE `test`.`русский`;" from inside a utf8 GUI-client (SQLyog) with no issues. But mysqlcheck from commandline: C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqlcheck -uroot -p test Enter password: ******** test.??????? Error : Can't find file: '.\test\@003f@003f@003f@003f@003f@003f@003f.frm' (er rno: 22) status : Operation failed test.tableb OK test.testtable1 OK test.dansk OK test.dup OK test.foo OK test.mysqlbug OK test.pl OK test.some_table OK test.tablea OK test.tableinventory OK test.test OK test.testrcaai OK test.test_table OK test.testtable2 OK test.tst OK test.u8 OK test.x'02' OK C:\Program Files\MySQL\MySQL Server 5.1\bin>
[28 Mar 2014 13:45]
Peter Laursen
I tried to check this on 5.6, but was stopped by another bug! http://bugs.mysql.com/bug.php?id=72152
[28 Mar 2014 19:32]
Peter Laursen
the 'showstopper' in bug http://bugs.mysql.com/bug.php?id=72152 was resolved (thanks to Sveta). But I can now confirm that also on MySQL 5.6.16, the 'mysqlcheck' program fails to handle a tabel named with cyrillic characters (`русский`) also on this version (in Windows using Western/Danish LOCALE).
[28 Mar 2014 20:25]
Peter Laursen
Why is it "Looking for 'mysql.exe'" BTW? There is is no interactive input required.
[28 Mar 2014 20:36]
MySQL Verification Team
mysql_upgrade runs mysql.exe to check version, datadir, and do that mysql_fix_privilege_tables in batch mode...
[28 Mar 2014 21:28]
Peter Laursen
Thanks @Shane. I am learning every day! :-)
[28 Mar 2014 21:34]
MySQL Verification Team
About the weird error 22, I wonder if it is addressed in 5.7 by: Bug 14642248 - NONSENSE ERROR ON WINDOWS (ERRNO: 22 - INVALID ARGUMENT) Also: http://bugs.mysql.com/bug.php?id=68618
[28 Mar 2014 21:39]
Peter Laursen
I have one serious concern! If the table name 'русский' ('russian' in Russian language) maps to the .frm file '@003f@003f@003f@003f@003f@003f@003f.frm' what will then the table name 'український' ('ukrainian' in Ukrainian language) map to? If it also maps to '@003f@003f@003f@003f@003f@003f@003f.frm' this means then when creating the 2nd table (in any order - not commenting on the European security situation!) the .frm file of the 1st table will be overwritten when the 2nd is created. This would be very serious. But it is too late now here and I am too tired now to check this tonight. I have created mistaken reports before when it was too late and I was bombed. So I think I should rather wait till after the weekend!
[28 Mar 2014 21:41]
Peter Laursen
@Shane .. maybe. You can better verify than I (as you read code, and I don't). But if so it should definitely be backported to 5.6 (and 5.5 if also affected).
[29 Mar 2014 13:21]
Peter Laursen
My concern was not jsutified. .frm files are created as expected. Anyway mysqlcheck fails. It looks for incorrect file names only containing sequences of '@003f'. Here is a clean testcase on MySQL 5.6.16: -- prepare tables CREATE DATABASE frmtest; USE frmtest; CREATE TABLE `русский` (`id` INT); CREATE TABLE `український` (`id` INT); /* check file system C:\ProgramData\mysql\MySQL Server 5.6\data\frmtest>dir Disken i drev C har ikke noget navn. Diskens serienummer er 40AF-D553 Indhold af C:\ProgramData\mysql\MySQL Server 5.6\data\frmtest 29-03-2014 14:04 <DIR> . 29-03-2014 14:04 <DIR> .. 29-03-2014 14:02 8.556 @w0@z0@x0@x0@q0@o0@p0.frm 29-03-2014 14:02 98.304 @w0@z0@x0@x0@q0@o0@p0.ibd 29-03-2014 14:04 8.556 @z0@q0@w0@g0@z1@t0@x0@o1@q0@o0@p0.frm 29-03-2014 14:04 98.304 @z0@q0@w0@g0@z1@t0@x0@o1@q0@o0@p0.ibd 29-03-2014 14:00 61 db.opt 5 fil(er) 213.781 byte 2 mappe(r) 22.679.900.160 byte ledig C:\ProgramData\mysql\MySQL Server 5.6\data\frmtest> */ /*running mysqltest C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqlcheck -uroot -p frmtest Enter password: frmtest.??????? Error : Can't find file: '.\frmtest\@003f@003f@003f@003f@003f@003f@003f.frm' (errno: 22 - Invalid argument) status : Operation failed frmtest.??????????? Error : Can't find file: '.\frmtest\@003f@003f@003f@003f@003f@003f@003f@003f@ 003f@003f@003f.frm' (errno: 22 - Invalid argument) status : Operation failed C:\Program Files\MySQL\MySQL Server 5.6\bin> */ (and BTW .. it would be relevant to check if the situation is the same on a system running various non-western locales, I think. But I don't have this option myself) I have updated synopsis according to my findings. I also added OS details as "Windows" as I can only state it is a problem here.
[29 Mar 2014 13:47]
Peter Laursen
On 5.0.96 it also fails, but error displays a little different: C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlcheck -uroot -p --port=3309 frm test Enter password: ******** frmtest.??????? Error : Can't find file: '.\frmtest\???????.frm' (errno: 22) error : Corrupt frmtest.??????????? Error : Can't find file: '.\frmtest\???????????.frm' (errno: 22) error : Corrupt C:\Program Files\MySQL\MySQL Server 5.0\bin> .. and the .frm file names are also different: C:\Program Files\MySQL\MySQL Server 5.0\data\frmtest>dir Disken i drev C har ikke noget navn. Diskens serienummer er 40AF-D553 Indhold af C:\Program Files\MySQL\MySQL Server 5.0\data\frmtest 29-03-2014 14:42 <DIR> . 29-03-2014 14:42 <DIR> .. 29-03-2014 14:42 61 db.opt 29-03-2014 14:42 8.556 укÑ?аÑ-нÑ?ÑOкий.frm 29-03-2014 14:42 8.556 Ñ?уÑ?Ñ?кий.frm 3 fil(er) 17.173 byte 2 mappe(r) 22.678.491.136 byte ledig C:\Program Files\MySQL\MySQL Server 5.0\data\frmtest>
[1 Apr 2014 19:23]
Peter Laursen
Besides .. I do not really understand what this encoding of non-ASCCI characters (@***) is for. Is there any supported OS that does not have full unicode support in the file system? I don't think so. (but I realize that for 10+ years MySQL developers believed that Windows doesn't support Unicode. But that is a stupid mistake (*Cygwin thinking of Windows*, so to say!). There is absolutely no need to encode any file name using Unicode (within BMP at least) as far as I can understand. Just create files (.ibd, .frm, whatever) with unicode file names!
[1 Apr 2014 19:27]
Peter Laursen
Just create folders and files (.ibd, .frm, whatever) with unicode file names (using the default Unicode encoding - UTF8, UTF16LE or UTF16BE specific for the platform)! With hindsight this *encoding* (sic!) is no less than an extremely bad joke!
[4 Jul 2014 9:15]
MySQL Verification Team
Thank you for the report and test case. I could not repeat this with latest GA version. Could you please confirm if it is still repeatable at your end on 5.6.19? // 5.6.19 on Windows server 2008 R2 F:\ushastry\mysql5.6.19>chcp 65001 Active code page: 65001 Your MySQL connection id is 4 Server version: 5.6.19-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop database frmtest; Query OK, 2 rows affected (0.07 sec) mysql> CREATE DATABASE frmtest; Query OK, 1 row affected (0.01 sec) mysql> USE frmtest; Database changed mysql> CREATE TABLE `русский` (`id` INT); Query OK, 0 rows affected (0.04 sec) mysql> CREATE TABLE `український` (`id` INT); Query OK, 0 rows affected (0.04 sec) mysql> \q Bye F:\ushastry\mysql5.6.19>bin\mysqlcheck -uroot -p --port=5619 frmtest Enter password: frmtest.русский OK frmtest.український OK F:\ushastry\mysql5.6.19>dir data/ F:\ushastry\mysql5.6.19>dir data\frmtest Volume in drive F is Data Volume Serial Number is 882C-3C6D Directory of F:\ushastry\mysql5.6.19\data\frmtest 07/04/2014 11:04 AM <DIR> . 07/04/2014 11:04 AM <DIR> .. 07/04/2014 11:04 AM 8,556 @w0@z0@x0@x0@q0@o0@p0.frm 07/04/2014 11:04 AM 98,304 @w0@z0@x0@x0@q0@o0@p0.ibd 07/04/2014 11:04 AM 8,556 @z0@q0@w0@g0@z1@t0@x0@o1@q0@o0@p0.frm 07/04/2014 11:04 AM 98,304 @z0@q0@w0@g0@z1@t0@x0@o1@q0@o0@p0.ibd 07/04/2014 11:04 AM 65 db.opt 5 File(s) 213,785 bytes 2 Dir(s) 1,757,532,979,200 bytes free
[5 Aug 2014 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".