View export points to source

bsfrye's profile image bsfrye posted 9 years ago in General Permalink
I commented on bug 2876 but thought I would post this in the forum also in case I missed something.
When exporting an entire database, views in the new database point to tables in the original source. I do not get this behavior if I simply export a view directly. I am on version 9.1.0.1867
jfalch's profile image jfalch posted 9 years ago Permalink
current version is 9.1.0.4896; try it to check wether problem persists. direct support for older versions is generally unlikely.
bsfrye's profile image bsfrye posted 9 years ago Permalink
Same in most recent version. Certainly don't expect it to be fixed in previous release - just posting my version
ansgar's profile image ansgar posted 9 years ago Permalink
Confirmed. HeidiSQL creates a view with its body while "using" the source database. For example, you are exporting "dbsource" to "dbtarget", and HeidiSQL fired a "USE dbsource" before. Then, the export does the following:
CREATE VIEW `dbtarget`.`someview` AS SELECT * from sometable;

That "sometable" is located in dbsource, not in dbtarget, and HeidiSQL still has "USEd" the dbsource database.

I guess this does not happen when you export to a sql file, then import that file in a new database?
bsfrye's profile image bsfrye posted 9 years ago Permalink
You are correct. Exporting to sql file - then import to new DB works as expected.
bsfrye's profile image bsfrye posted 9 years ago Permalink
By the way - thanks for writing the best MySQL UI available. I am a happy donor to your project.
ansgar's profile image ansgar posted 9 years ago Permalink
Thank *you* for the donation!
bsfrye's profile image bsfrye posted 9 years ago Permalink
Do you think this will get 'fixed' - if so do you have a guess on 'when'? Not trying to push - after all this is freeware! Just checking. Thanks again!
ansgar's profile image ansgar posted 9 years ago Permalink
I'm not sure if I can fix that at all. I think I have to fire a "USE <targetdb>" before creating the view there, so the server references tables from the target database, not the source db. I have a gutt feeling I tried that before and introduced other bugs along with that fix, but I'll check that.

Please login to leave a reply, or register at first.