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

Drop Database Bug

forums forums SQLyog SQLyog: Bugs / Feature Requests Drop Database Bug

  • This topic is empty.
Viewing 13 reply threads
  • Author
    Posts
    • #9411
      dany
      Member

      Hi,

      if you drop the last database in the Object Browser SQLyog does not change the database selected.

      HOW TO REPEAT:

      1) Select the last database in the object browser

      2) From the Tools menu use “Export database as SQL statements”

      3) Drop that database from the drop-down menu

      4) From the Tools menu use “Import from SQL statements” to import the file generated in step 2.

      you will get this error:

      “There was an error while executing a query…”

      Bye

    • #20059
      peterlaursen
      Participant

      Confirmed with this simple code

      Code:
      *
      SQLyog Enterprise – MySQL GUI v5.01
      Host – 5.0.17-nt-max : Database – yy
      *********************************************************************
      Server version : 5.0.17-nt-max
      */

      create database if not exists `yy`;

      USE `yy`;

      /*Table structure for table `tablename1` */

      DROP TABLE IF EXISTS `tablename1`;

      CREATE TABLE `tablename1` (
       `id` bigint(20) NOT NULL auto_increment,
       `t` varchar(50) default NULL,
       PRIMARY KEY  (`id`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

      /*Data for the table `tablename1` */

      However, if you add in between 3) and 4)

      3a: select an existing database (from dropdown or by highligting in Object Browser) – – – it works OK.

      Try also to open 'History' tab while importing. At the very moment you click 'Import from SQL-statements' this SQL is added to the history

      Code:
      select database()

      I don't understand this SQL and how it was supposed to work! 😮

    • #20060
      Ritesh
      Member

      select database() returns the current database for the connection. SQLyog uses the result to know the current selected database.

    • #20061
      Ritesh
      Member

      Bug confirmed. When you drop the last database in the Object Browser, the currently selected database shown in the combo box is incorrect. It has been fixed in v5.02 development tree. Now it will correctly show “NONE” as currently selected database in the dialog.

      Quote:
      you will get this error:

      “There was an error while executing a query…”

      I dont think this is an error. What does sqlyog.err say?

      It generally happens when you deselect the option “Add CREATE DATABASE” option while exporting the data. This result in execution of statements with respect to the currently selected database which is not existing as you have just dropped it. Can you confirm that CREATE DATABASE IF NOT EXISTS sql is present in the dump file?

    • #20062
      Ritesh
      Member

      Or did I miss something?

    • #20063
      peterlaursen
      Participant

      @ritesh

      The error message appearing in SQLyog 5.01 when following the procedure as desribed by dany is like quoted by him. Sqlyog.err does not give more info.

      Did you repeat steps 1-4 as described by dany?

      If no error occurs with the 5.02 tree with the same procedure there is no need for further discussin!

    • #20064
      peterlaursen
      Participant

      No matter what …

      bug confirmed fixed with 5.02 Beta. 😀

    • #20065
      dany
      Member

      Hi,

      these are the first lines of the dump file:

      create database if not exists `yyy`;

      USE `yyy`;

      SET FOREIGN_KEY_CHECKS=0;

      By the way this bug was in SQLyog at least from V. 4.07.

      Bye

    • #20066
      Ritesh
      Member
    • #20067
      dany
      Member

      Hi Ritesh,

      version 5.02beta it's working better.

      But there's still a small thing that can be fixed.

      1) use the “Import From SQL Statements” function to import a database that will get to the last position in the Object Browser

      2) press F9 to refresh the Object Browser

      3) even if you click on the database name SQLyog will not select that database as the active database.

      Daniele

    • #20068
      peterlaursen
      Participant

      Looks like then that pressing only does a graphics refresh, but does not refresh the memory stack/structure that holds information about available databases !?

    • #20069
      jarsyl
      Member

      While using the “Import From SQL Statements” command I noticed this bug as well. If you click on the top-most element in the object browser, the one that takes the form “username@host” and then click refresh, the object browser will update correctly.

    • #20070
      peterlaursen
      Participant

      I just tested with SQLyog 5.1 BETA 1 and it seems to be fixed here already. Simply clicking 'refresh' displays the newly imported database (`utest` in this case – the latest in alphabetical view). No need for any tricks like jarsyl's with 5.1! 🙂

    • #20071
      jarsyl
      Member

      Glad to hear it. I meant to mention that I am using v5.02. Looking forward to trying v5.1.

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