forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Import From Sql Dump When Database Does Not Exist
- This topic is empty.
-
AuthorPosts
-
-
May 8, 2007 at 8:19 am #10322larsenParticipant
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
-
May 8, 2007 at 9:33 am #23947peterlaursenParticipant
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!
-
May 8, 2007 at 11:28 am #23948larsenParticipant
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.
-
May 8, 2007 at 11:35 am #23949peterlaursenParticipant
This is not expected behaviour, if I understand right!
give us a little while to study that dump!
-
May 8, 2007 at 11:47 am #23950peterlaursenParticipant
Verified as described!
-
-
AuthorPosts
- You must be logged in to reply to this topic.