This was needed in case of exporting a db or a server (to delete the CREATE TABLE stand-in for this view), but not needed when just a view is exported. Fixed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=210714
Originator: NO
This was needed in case of exporting a db or a server (to delete the CREATE TABLE stand-in for this view), but not needed when just a view is exported. Fixed.
Logged In: YES
user_id=326580
Originator: YES
if i export multiple views i still have this problem
and even some CREATE TABLE statemants for VIEWS
Logged In: YES
user_id=210714
Originator: NO
Sebastian,
which problem? phpMyAdmin is creating stand-in tables for the views, like mysqldump does.
Logged In: YES
user_id=326580
Originator: YES
exporting two vies produces:
-- ...
CREATE TABLE `v_privilege_user` (...);
-- ...
CREATE TABLE `v_project_contact` (...);
-- ...
DROP TABLE IF EXISTS `v_privilege_user`;
CREATE ... VIEW `www20`.`v_privilege_user` ...;
-- ...
DROP TABLE IF EXISTS `v_project_contact`;
CREATE ... VIEW `www20`.`v_project_contact` ...;
this comes from mysqldump? what is this good for?
Logged In: YES
user_id=210714
Originator: NO
Creating stand-in stables resolves view dependencies, see
https://sourceforge.net/tracker/index.php?func=detail&aid=1621280&group_id=23067&atid=377408
and yes, this is what mysqldump does.
Logged In: YES
user_id=326580
Originator: YES
okey,
but drop view should come first, before creating tables, if DROP VIEW is selected in export
CREATE TABLE `v_privilege_user` (...);
CREATE TABLE `v_project_contact` (...);
DROP TABLE IF EXISTS `v_privilege_user`;
DROP VIEW IF EXISTS `v_privilege_user`;
CREATE ... VIEW `www20`.`v_privilege_user` ...
DROP TABLE IF EXISTS `v_project_contact`;
DROP VIEW IF EXISTS `v_project_contact`;
CREATE ... VIEW `www20`.`v_project_contact` ...;
Logged In: YES
user_id=210714
Originator: NO
I think that the best place for the DROP VIEW is just before the CREATE VIEW, as it is right now.
What problem do you see with the current behavior?
Logged In: YES
user_id=326580
Originator: YES
you will get an error when trying to create a table with the same name of an existing view!?
mainly there is no IF NOT EXISTS in the create table statement ...
Logged In: YES
user_id=210714
Originator: NO
Ok, so I suggest:
- tick by default the "Add IF NOT EXISTS" checkbox
- obey this setting when generating the CREATE TABLE for the stand-in structure
Logged In: YES
user_id=326580
Originator: YES
seems ok to me
Logged In: YES
user_id=210714
Originator: NO
Fixed, thanks.