Menu

#2438 (ok 2.10.3) DROP TABLE in export view structure

Latest_Git
fixed
1
2013-06-11
2007-05-21
No

exporting a view produces a DROP TABLE `view_name`

Discussion

  • Marc Delisle

    Marc Delisle - 2007-05-21
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2007-05-21
    • summary: DROP TABLE in export view structure --> (ok 2.10.2) DROP TABLE in export view structure
    • priority: 5 --> 1
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-05-21

    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.

     
  • Sebastian Mendel

    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

     
  • Sebastian Mendel

    • priority: 1 --> 5
    • summary: (ok 2.10.2) DROP TABLE in export view structure --> DROP TABLE in export view structure
    • status: open-fixed --> open-accepted
     
  • Marc Delisle

    Marc Delisle - 2007-05-23

    Logged In: YES
    user_id=210714
    Originator: NO

    Sebastian,
    which problem? phpMyAdmin is creating stand-in tables for the views, like mysqldump does.

     
  • Sebastian Mendel

    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?

     
  • Sebastian Mendel

    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` ...;

     
  • Marc Delisle

    Marc Delisle - 2007-05-25

    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?

     
  • Sebastian Mendel

    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 ...

     
  • Marc Delisle

    Marc Delisle - 2007-05-25

    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

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: YES

    seems ok to me

     
  • Marc Delisle

    Marc Delisle - 2007-06-14
    • summary: DROP TABLE in export view structure --> (ok 2.10.3) DROP TABLE in export view structure
    • priority: 5 --> 1
    • status: open-accepted --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-06-14

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed, thanks.

     
  • Marc Delisle

    Marc Delisle - 2007-07-20
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.