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

Cannot set default to empty

Open CaptainStabs opened this issue 4 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. Attempt to Set Value for column_default to empty image

    2. Attempt to commit change.

    3. Error syntax error at position 98 near `COMMENT`
      

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

Query:

ALTER TABLE `test_data`.`test_table` CHANGE `bit_data` `bit_data` bit(1) NULL DEFAULT COMMENT ''

Query should likely instead be (I don't know what EMPTY's value actually is here) ALTER TABLE `test_data`.`test_table` CHANGE `bit_data` `bit_data` bit(1) NULL DEFAULT "" COMMENT ''

Update:

This also occurs if a column you are attempting to edit has column_default set to EMPTY. Consider changing behavior to leave out DEFAULT if <data_type> NOT NULL. It also appears that there is no need to have COMMENT if there are no changes to comment.

CaptainStabs avatar Jun 16 '21 20:06 CaptainStabs