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

Bug: Schema Synchronization Default Value Error On Datetime

forums forums SQLyog SQLyog: Bugs / Feature Requests Bug: Schema Synchronization Default Value Error On Datetime

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

  • Author
    Posts
  • #13087

    StevenTitle
    Member

    This is an issue I got when trying to sync two tables using Schema Synchronization Tool. It generated the alter table script below:

    ALTER TABLE `executions`

    CHANGE `Executions_Timestamp` `Executions_Timestamp` DATETIME(6) NOT NULL AFTER `Executions_Price` ,

    CHANGE `VTStart` `VTStart` DATETIME(6) NOT NULL DEFAULT 'CURRENT_TIMESTAMP(6)' AFTER `Executions_ReconciliationData` ,

    CHANGE `VTEnd` `VTEnd` DATETIME(6) NOT NULL DEFAULT '9999-12-31 00:00:00.000000' AFTER `VTStart` ,

    CHANGE `TTStart` `TTStart` DATETIME(6) NOT NULL DEFAULT 'CURRENT_TIMESTAMP(6)' AFTER `VTEnd` ,

    CHANGE `TTEnd` `TTEnd` DATETIME(6) NOT NULL DEFAULT '9999-12-31 00:00:00.000000' AFTER `TTStart` ;

    The DEFAULT value for the DATETIME(6) type should be CURRENT_TIMESTAMP(6) without the single quotes, since MySql would think you are trying to put string into a DATETIME type column. So trying to execute the sync script would fail on the ALTER TABLE scripts.

  • #34590

    peterlaursen
    Participant

    OK .. Schema Sync may have an issue with milli- and microseconds resolution (as introduced in MySQL 5.6) of TIMESTAMP/DATETIME columns.

    We will check after the weekend.

You must be logged in to reply to this topic.