Hi,
It is somthing not really usefull when the export includes views : filling view has is not appropriate, a view has already his own content each time is used. May be add a contion before writing filling code can solve this, if table.type != VIEW ?
I'd like to suggest an improvement on databases export : if i check to export user difined functions, they are writen at the end of the file. But if i have views using thoose functions, i'll have an error because the functions are not yet defined, then the affected views are not defined...
I undestand this can be a problem if views are used in functions... so, may be it could be usefull to be able to indicate a choice while i'm defining export parameters ?
Ticket moved from /p/phpmyadmin/bugs/3866/
Hi,
I've done a mockup of this feature, here is the preview
(it's possible to reorder via drag and drop)
If a item is not selected (for example FUNCTION) the item "FUNCTION" will disappear as well in the sortable list
Last edit: Maxime DAVID 2014-03-25
Maxime,
giving this choice to the user will make her wondering about what's the best order. Instead. can you (or Cyrano) propose what would be the best order, if there is an order that works all the time?
Unfortunately I don't think there is an order which will work all the time :
For example :
Procedures may use functions
but
Functions may use procedures
Views may use functions
but
Functions may use views
So there is not a predictable order which is going to work for sure
Nevertheless, events and triggers can be exported at the end without risks and a algorithm can be developed to find the right order
and so on
I think the algorithm is a bit complicated but it's the only way (to my mind) to exports all procedures/functions/views in a right order
I have a suggestion to validate the order: try exporting all of these with mysqldump to see which order is generated, then try to import to see if mysqldump got it right. You will have to document the cases you are testing because this doc will have to go in the code when this is implemented.