TablePlus-Windows icon indicating copy to clipboard operation
TablePlus-Windows copied to clipboard

Beautifying messes up bit values

Open CaptainStabs opened this issue 3 years ago • 0 comments

  1. Which driver are you using and version of it (Ex: PostgreSQL 10.0): MySQL 8.0.11

  2. Which TablePlus build number are you using (the number on the welcome screen, Ex: build 81): 4.1.2 (170)

  3. The steps to reproduce this issue:

    1. Table with a bit column
    2. Set the bit column to a bit.
    3. Menu>Edit>Preview...
    4. Copy the preview SQL, paste into SQL Query.
    5. Note valid MySQL formatting for the bit (Query 1)
    6. Click "Beautify". Note improper MySQL formatting (Query 2)
    7. Click Run Current.
    8. Returns Query 1: syntax error at position 63 near '0'

Noted: If the bug is related to data, please attach an example SQL data.

Query 1:

UPDATE `test_data`.`test_table` SET `bit_data` = b'0' WHERE `id` = 1 AND `bit_data` = b'';

Query 2:

UPDATE
    `test_data`.`test_table`
SET
    `bit_data` = b '0'
WHERE
    `id` = 1
    AND `bit_data` = b '';

Table settings:

First row is default value of serial (unrelated to this issue, but the SQL generated for this does not work CREATE TABLE `test_data`.`test_table` (`id` serial,`bit_data` BIT);, and attempting to commit the table addition will result in syntax error at position 46 near 'serial' image

After creation:

image

CaptainStabs avatar Jun 16 '21 19:06 CaptainStabs