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

Import From Sql Dump When Database Does Not Exist

forums forums SQLyog SQLyog: Bugs / Feature Requests Import From Sql Dump When Database Does Not Exist

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #10322
      larsen
      Participant

      Hello,

      I have a SQL dump with a “create database” statement. Though, if a database is not selected within SQLyog, the file is not imported and the error log says:

      Error occured at:2007-05-08 10:14:53

      Line no.:0

      Error Code: 1046 – No database selected

      I guess this is due to the problem I once reported that a “use [db]” statement overrides the selected database from SQLyog.

      It would be nice if SQLyog asked the user what to do in such a case. And in case no database is selected, SQLyog should use the database name from the dump.

      SQLyog 6 beta4

      Lars

    • #23947
      peterlaursen
      Participant

      If no database is selected there must

      1) be is USE statement is the SQL file itself

      2) be used 'full' syntax like ´database`.`table` in every statement referencing a table.

      Did I understand right that the problem is that neither is the case ?

      I think it would be very dangerous if settings or selections from the GUI were allowed to 'override' a USE statement in the file itself.

      Also I do not think it is possible as the nature of SQL is sequential.  A USE statement will override any previous USE statement from the same connection. It is not SQLyog (the client) that does this but the server. We do not alter or even parse the content of such files. That is how SQL database server-client relations are designed to be, I think.

      I do not understand “And in case no database is selected, SQLyog should use the database name from the dump.”

      If that database is not in a USE statement where is it then? And again I think this is a request for server functionality, not client functionality.

      Maybe it would be eaiser if you posted a (very) small dump.  Just to be 100% sure that we understand each others fully!

    • #23948
      larsen
      Participant

      Please see the attached sql dump and make a right click on the tree root in SQLyog to import it.

      There is a USE statement.

      If you import it through clicking on an already existing DB it works and creates the stated DB not the one you clicked on.

    • #23949
      peterlaursen
      Participant

      This is not expected behaviour, if I understand right!  

      give us a little while to study that dump!

    • #23950
      peterlaursen
      Participant

      Verified as described!

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