Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Cannot Set Current_Timestamp In A Table With Sqlyog Menu

forums forums SQLyog SQLyog: Bugs / Feature Requests Cannot Set Current_Timestamp In A Table With Sqlyog Menu

This topic contains 4 replies, has 0 voices, and was last updated by  sathish 5 years, 8 months ago.

  • Author
    Posts
  • #12999

    xtrm
    Member

    Using mySQL 5.6.10 and SQLYog lastest v11.12 32bits.

    I have the following table:



    CREATE TABLE `tbmdtest005` (

    `id` bigint(20) NOT NULL AUTO_INCREMENT,

    `created_at` datetime NOT NULL,

    `updated_at` datetime NOT NULL,

    `created_by` bigint(20) DEFAULT '1',

    `updated_by` bigint(20) DEFAULT '1',

    PRIMARY KEY (`id`)

    ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci

    I am trying to change the default behavior of columns created_at and updated_at through the SQLYog GUI with Alter Table option.

    If I try to set any value in the Default column, when I click on save the value in the Default column is converted to string, adding two single mark ' ' and the result SQL is wrong:

    ALTER TABLE `md_db001`.`tbmdtest005` CHANGE `created_at` `created_at` DATETIME DEFAULT 'CURRENT_TIMESTAMP' NOT NULL;

    If I execute the same SQL without the single marks its executed perfectly:

    ALTER TABLE `md_db001`.`tbmdtest005` CHANGE `created_at` `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL;
    1 queries executed, 1 success, 0 errors, 0 warnings

    Query: ALTER TABLE `md_db001`.`tbmdtest005` CHANGE `created_at` `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL

    0 row(s) affected

    Is it a bug or is it there anyway to set those mySQL values with SQLYog GUI without having to type the SQL query?

    TIMESTAMP documentation:

    http://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html

  • #34346

    sathish
    Member

    Issue confirmed. It is fixed in the development tree and will be available in today's release.

  • #34347

    xtrm
    Member

    thanks 🙂

  • #34348

    peterlaursen
    Participant

    It has been released now. Please refer: http://blog.webyog.com/2013/06/11/sqlyog-mysql-gui-11-12-released/

  • #34349

    xtrm
    Member

    Hi peterlaursen, I think found two issues in lastest v11.12. Im not able to set the value through the GUI of SQLYog for:

    CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

    1. It still converts some reserved mySQL values to string:

    ALTER TABLE `tbmdtest005` CHANGE `onupdate_at` `onupdate_at`

    DATETIME DEFAULT 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP' NOT NULL;

    There could be more cases like:

    DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP

    Documentation maybe could help to get all cases, or another option should be not converting some mySQL reserved words for the default column to strings.

    http://dev.mysql.com…ialization.html

    2. In the GUI if we set the default value to: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , the value shown in the GUI default column is: CURRENT_TIMESTAMP

    Maybe there could be added another column in the GUI for the ON UPDATE event statement for tables.

  • #34350

    sathish
    Member

    Hello,

    Please refer this FAQ which would be helpful for you in defining TIMESTAMPs for CREATE TABLE and ALTER TABLE : http://faq.webyog.com/content/8/159/en/how-do-i-define-timestamp-properties-with-sqlyog.html

    Regards,

    Sathish

You must be logged in to reply to this topic.