Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #18770 export of DEFAULT value of MySQL tables is wrong in db_schema.dba #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jdespatis
Copy link
Contributor

Fix of issues.ez.no/IssueView.php?Id=18770 (heavy explanations in this issue)

@andrerom
Copy link
Contributor

Looks ok on first glimpse, but are there any unit tests covering this code or are we driving with blind folds here? :)

@jdespatis
Copy link
Contributor Author

You mean automatic unit test ? if there's a way to do so, I can do it.

If not, I can propose you this:
1/ I create a table A will all cases possible (not null/null) (get a mysql1.sql to create A)
2/ create the db_schema.dba from that table
3/ then drop A, and recreate it from db_schema.dba, then dump again a mysql2.sql
4/ and then compare both mysql1.sql and mysql2.sql to see if we're in sync

That's indeed the process I've followed for my multiple tests

Tell me

@nfrp
Copy link
Contributor

nfrp commented Oct 17, 2011

Thanks @jdespatis for this contribution !

@andrerom : is the proposed manual testing process satisfactory ? Is there an automated unit-testing way of proceeding here ?

@gggeek : is Jérôme's second, minimalistic patch (proposed here : http://issues.ez.no/18770 ) a less intrusive, more easily mergeable approach ?

@jdespatis
Copy link
Contributor Author

To be more precise, the mysql.sql to create should handle all null/not null, with/without default, for each type supported by mysql, in order to have a complete overall test
and then perform the sql => dba => sql to see if we get the same thing

Of course, this logic of having a test .sql would be nice to have also for other dbs (with all their specific types handled), maybe you have those sql to launch a unit test. If yes, do not hesitate to tell me where it's in the code tree, so that I can add other types or cases I encounter

peterkeung pushed a commit to peterkeung/ezpublish that referenced this pull request Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants