Menu

#507 [MySQL] Error with null bytes in binary field default values

Git
closed-wont-fix
nobody
None
5
2025-03-11
2016-07-14
No

Adminer (4.2.5) wth MySQL 5.6 doesn't play nicely with binary format fields with null-byte default values - for example if I add a binary field with a default value of '0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', it converts it to '0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', which is invalid, and throws an error.

Discussion

  • Marcus Bointon

    Marcus Bointon - 2016-07-14

    Thanks sourceforge for messing up my formatting...

    That second value should be:

    '0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0'

    (hopefully this will work - there should be a double-slash before each 0!)

     
  • Jakub Vrána

    Jakub Vrána - 2017-02-19

    Adminer uses hex format for binary fields. Try inserting it as 00000000000000000000000000000000. Also, it seems like you are missing one \\ at the beginning.

     
  • Jakub Vrána

    Jakub Vrána - 2017-02-19
    • status: open --> closed-invalid
     
  • Marcus Bointon

    Marcus Bointon - 2017-02-20

    That's a kind of half-solution. It's still misformatting values in that context if you use normal MySQL syntax which I think should work. Notice that it doesn't attempt to use unhex on an alter table, so this is inconsistent. It works ok when running a manual query. The missing slashes previously was just sourceforge making a mess, not what I used.

    I've attached some screen shots.

     
  • Jakub Vrána

    Jakub Vrána - 2017-02-20
    • status: closed-invalid --> open
     
  • Jakub Vrána

    Jakub Vrána - 2017-02-20

    It should be consistent.

     
  • Jakub Vrána

    Jakub Vrána - 2018-01-30
    • summary: Error with null bytes in binary field default values --> [MySQL] Error with null bytes in binary field default values
     
  • Jakub Vrána

    Jakub Vrána - 2025-03-11
    • status: open --> closed-wont-fix
     
  • Jakub Vrána

    Jakub Vrána - 2025-03-11

    Adminer now displays default values as is in table structure and converts them to hex when inserting a new column.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.