Skip to content

syntax errror when change timestamp column with extra content is current_timestamp #1078

Closed

Description

@fengyunhe
  1. Which driver are you using and version of it (Ex: PostgreSQL 10.0):
    MySQL 8.0.13
  2. Which TablePlus build number are you using (the number on the welcome screen, Ex: build 81):
    204
  3. The steps to reproduce this issue:

1)create a table contains a timestamp column.
2) change the timestamp column extra select to "ON UPDATE CURRENT_TIMESTAMP" ,and close structure window.
3) open the structre window .the timestamp column extra display text is "DEFAULT_GENERATED on update CURRENT_TIMESTAMP" ,and modify any property on this column, pending sql is " ALTER TABLE cmbcar_notification.app_message_push_read CHANGE last_modified_date last_modified_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP COMMENT '记录最后更新时间' AFTER created_date;"

the 'DEFAULT_GENERATED' is syntax Chief culprit

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

Activity

  1. huyphams commented on Apr 3, 2019

    @huyphams
    Contributor

    Hi @fengyunhe thank you for the feedback. But I'm not sure how to reproduce the issue.
    After closing and reopening the structure window, this is what I got:
    themsame

  2. fengyunhe commented on Apr 3, 2019

    @fengyunhe
    Author

    There is a timestamp type column in the table that is automatically updated when the data is updated, and then changes the name of the column or other columns to allow it to perform DDL update SQL, with syntax errors occurring when saving.

  3. huyphams commented on Apr 3, 2019

    @huyphams
    Contributor

    Yes, I did it and it seems to work on my setup. I meant it, there is no DEFAULT_GENERATED how did you get this value? could you please make a gif with gifox.io (it's free) it will help me a lot.
    Thank you and have a nice day!

  4. fengyunhe commented on Apr 3, 2019

    @fengyunhe
    Author

    I will upload a GIF to you this afternoon. It will be time for lunch.

  5. fengyunhe commented on Apr 3, 2019

    @fengyunhe
    Author

    2019-04-03 16 07 52
    There is a similar problem when setting the default value of the bit type, that is, setting the default value to 0 will succeed, and b’0’ will not save.

  6. huyphams commented on Apr 3, 2019

    @huyphams
    Contributor

    Excellent @fengyunhe! I fixed it on this build: https://www.dropbox.com/s/0i0ofnhi88vlxz8/TablePlus.dmg?dl=0
    I don't know why MySQL includes the DEFAULT_GENERATED in extra value, but anw I fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions