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

Copy Table Error

forums forums SQLyog Using SQLyog Copy Table Error

  • This topic is empty.
Viewing 6 reply threads
  • Author
    Posts
    • #9427
      rtk
      Member

      If I create a table in MYSQL and try and copy it to a different MYSQL4 database I get the following error

      Error 1064: You have an error in your SQL syntax near 'comment “) Type=InnoDB at line 1

      How do I get around that?

    • #20164
      Ritesh
      Member

      Which version of SQLyog are you using?

      What is your source and target MySQL server versions?

    • #20165
      rtk
      Member

      The source database is 5.0.17. The target database is 3.23.58-16. I am using SQLyou 5.01.

    • #20166
      peterlaursen
      Participant

      confirmed!

      According to this MySQL doc http://dev.mysql.com/doc/refman/4.1/en/alter-table.html comments should be legal with 3.23, 4.0 and 4.1. However it does not work.

      If you execute this SQL

      Code:
      alter table `test`.`t1` change `id` `id` bigint (20)   NOT NULL AUTO_INCREMENT  COMMENT '1test1', change `t` `t` varchar (50)   NULL  COMMENT '2test2'

      you will get the same error. So probably it is a bug with the MySQL docs (they recently 'merged' 3.23 , 4.0 and 4.1 docs and probably forgot something!) Sqlyog CREATE TABLE and ALTER TABLE does not have GUI support for comments with MySQL 3.23 either and this is coded bfore the new docs were written.

      So I does not look like 3.23 supports comments.

      It is a pretty new thing that SQLyog let's you use 'copy table' across versions at all and it is not unproblematic – not with MySQL 5.1 either – because of changed TABLE syntax across versions.

      You can export and import. The export file only includes the 'comment' keyword when there really IS a comment. Probably the 'copy table' should do the same. But the bug leads back to a bug in the MySQL docs I believe. The 'copy table' code is correct according to the official MySQL docs as of now!

      Let Ritesh COMMENT on it tommorrow!

    • #20167
      Ritesh
      Member

      It seems that COLUMN level comment is not supported in v3.23.x. While copying DDL from 5.x to 3.23.x, SQLyog copies the COMMENT information too and thus the process fails.

      I have sent a code patch to our v5.02 development tree that will now check for TARGET MySQL version and will copy COMMENT info only if MySQL version > 4.1.

      We will be releasing 5.02 BETA 2 by tomorrow evening that will have this bug fixed.

    • #20168
      Ritesh
      Member

      I mailed you the link for SQLyog Enterprise 5.02 BETA 2 that fixes this issue.

      Can you confirm the fix?

    • #20169
      peterlaursen
      Participant

      I can confirm.

      Just copied a table from 5.0.18 to 3.23.58.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.