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

SQLyog creates batch scripts with double-quotes

forums forums SQLyog SQLyog: Bugs / Feature Requests SQLyog creates batch scripts with double-quotes

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #8649
      patrickq
      Member

      The scripts resulting from DB->Export Database as Script creates syntax with double quotes such as:

      CREATE TABLE “mytable” (“time” datetime);

      This does not fly well with a subsequent Tools->Execute Batch Script, which complains and a syntax error. When I edit the script and remove the double quotes, all is well.

      Note that single quotes instead of double quotes still fail.

      CREATE TABLE 'mytable' ('time' datetime);

      still fails.

      The above fail both under SQLyog itself when executing the script, as well as when submitted under mysql.

      However, the update statements generated by SQLyog, which do include single quotes, do work, for some reason:

      INSERT INTO `mytable` (`time`) VALUES ('0001-01-01 00:00:00');

      works.

    • #16529
      Ritesh
      Member

      Which version of MySQL are you using?

      Can you cut-n-paste the result returned by “show create table `db`.`table`”?

    • #16530
      Shadow
      Member

      Apparently MySql interprets “time” as a keyword, thus the CREATE TABLE fails.

    • #16531
      patrickq
      Member

      Actually, now that I am re-checking it seems that:

      1. SQLyog doesn't use double quotes (“), it uses ` (correctly)

      2. In my attempts at finding the problem, I mistakenly used ' instead of `

      In fact, I got confused and this is actually a MySQL Administrator bug! The bug is valid, MySQL Administrator does use ” and the script doesn't work, but that's not a SQLyog bug, sorry …

      I was trying to combine using MySQL Administrator for scheduled backups (until SQLyog implements scheduled backups), while using SQLyog for everything else (such as one-time backups or restores). Looks like for now I will have to edit the MySQLAdministrator scripts, or else use one-time backups done via SQLyog.

    • #16532
      peterlaursen
      Participant

      Maybe the MySQLadministrator script will work in ANSI-mode ?

      With MySQL up to 4.0 the ansi-mode is specified in the server section of the my.ini/my.cnf (and will thus apply to all connections)

      With MySQL 4.1 and above each connection could specify individually that ansi-mode should be used for that connection.

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