#243 Export of MySQL BIT values must be wrapped in quotes

3.3.4
closed-works-for-me
Jakub Vrána
MySQL (66)
5
2013-04-26
2012-05-14
No

MySQL: create table bit_test ( my_column BIT );

Values of my_column must be wrapped in quotes otherwise MySQL rejects the resulting dump with a syntax error message. Compare dump made with mysqldump and Adminer.

Discussion

  • Jakub Vrána
    Jakub Vrána
    2012-05-14

    • status: open --> pending
     
  • Jakub Vrána
    Jakub Vrána
    2012-05-14

    • status: pending --> pending-works-for-me
     
  • mysql.exe Ver 14.14 Distrib 5.5.20, for Win64 (x86)

    ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

    I don't suppose you'll see the bit here correctly, have a look at the file I uploaded.

     
    • status: pending-works-for-me --> open-works-for-me
     
  • MySQL error message

     
    Attachments
  • sample data

     
    Attachments
  • Jakub Vrána
    Jakub Vrána
    2012-05-14

    • status: open-works-for-me --> open-accepted
     
  • Jakub Vrána
    Jakub Vrána
    2012-05-14

    It seems that MySQLnd returns the bit value as a number but libmysql returns it as a binary string.

     
  • Sorry, I lost you. The dump was created with Adminer, not mysqldump. Or did you mean something else?

    The error message was from when I was trying to import it with mysql.exe. The same message however, I get when trying to import it with Adminer (the same MySQL server).

    Do you need some additional info from me?

     
  • Oh, when I dump the same table with mysqldump.exe, I don't get escaped chars like \0 or x0 but the same single bit character wrapped in apostrophes.

     
  • Jakub Vrána
    Jakub Vrána
    2012-05-14

    I don't mean mysqldump, I mean http://php.net/mysqlnd.

     
  • I'd just like to note that the bug is still present in Adminer 3.6.1.

     
  • Jakub Vrána
    Jakub Vrána
    2013-04-26

    • status: open-accepted --> closed-works-for-me
     
  • Jakub Vrána
    Jakub Vrána
    2013-04-26

    Works for me in different PHP and MySQL versions.

     
  • Jakub Vrána
    Jakub Vrána
    2013-04-27

    Thank you for the report, I've fixed it in Git. You can download the "Current development version" from http://www.adminer.org/#download