Skip to content

Added support for 'ALTER TABLE CHANGE COLUMN'#741

Merged
wumpz merged 4 commits intoJSQLParser:masterfrom
Gikkman:alter-table-change-column
Feb 7, 2019
Merged

Added support for 'ALTER TABLE CHANGE COLUMN'#741
wumpz merged 4 commits intoJSQLParser:masterfrom
Gikkman:alter-table-change-column

Conversation

@Gikkman
Copy link
Contributor

@Gikkman Gikkman commented Feb 4, 2019

Added support for 'ALTER TABLE CHANGE COLUMN oldName newName columnDefinition'.
Please see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html for reference.

I was not really sure how to modify the AlterStatement class. I found introducing these two new fields was the easiest solution, but I am open to suggestions should there be a better way of doing it.
Also, this is my first time writing anything in JavaCC, so if I've made some obvious mistakes or bad practises, I would gladly take feedback.

This should fix #380 and parts of #571

@Gikkman Gikkman changed the title Added support for 'ALTER TABLE CHANGE COLUMN Added support for 'ALTER TABLE CHANGE COLUMN' Feb 4, 2019
@coveralls
Copy link

coveralls commented Feb 4, 2019

Coverage Status

Coverage decreased (-0.09%) to 82.884% when pulling db37247 on Gikkman:alter-table-change-column into cb0e0b7 on JSQLParser:master.

Now also test the getOptionalSpecifier() for both cases (null and not-null)
@wumpz
Copy link
Member

wumpz commented Feb 7, 2019

Could you write tests using assertSqlCanBeParsedAndDeparsed as well. The deparser should be able to completely reconstruct the source SQL.

@Gikkman
Copy link
Contributor Author

Gikkman commented Feb 7, 2019

Oh, yes, sorry. I had them as test earlier but apparently managed to remove them along the way. I added the requested tests back in.

Edit: I am not really sure where the reduction on coverage comes from. Is it a lack of explicit tests of the new setter methods?

@wumpz wumpz merged commit bfb8023 into JSQLParser:master Feb 7, 2019
@wumpz
Copy link
Member

wumpz commented Feb 7, 2019

The reduction on coverage or the coverage value itself seems to be some kind of black magic to me as well. Sometimes the increase or decrease has no clear source.

PraTrick added a commit to PraTrick/JSqlParser that referenced this pull request Feb 16, 2019
* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* Added support for comment(s) for column definitions in CREATE TABLE s… (JSQLParser#743)

* Added support for comment(s) for column definitions in CREATE TABLE statements

* Added support for comment(s) for column definitions in CREATE TABLE statements #2

* To increase code coverage

* To increase code coverage #2

* Added support for 'ALTER TABLE CHANGE COLUMN' (JSQLParser#741)

* Added support for 'ALTER TABLE CHANGE COLUMN oldName newName columnDefinition'. Please see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html for reference.

* Returned import ordering to avoid conflicts

* Improved the tests somewhat

Now also test the getOptionalSpecifier() for both cases (null and not-null)

* Expanded tests for ALTER TABLE ... CHANGE

* implemented optimize for, fixes JSQLParser#348

* implemented optimize for, fixes JSQLParser#348

* Support for simple informix outer joins. (JSQLParser#745)

* added support for simple informix outer joins
added some test code

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* fixes JSQLParser#747

* fixes JSQLParser#733

* fixes JSQLParser#707

* Update README.md

* Update README.md
wumpz pushed a commit that referenced this pull request Feb 19, 2019
…752)

* Merge recent changes in the master from the master (#1)

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* Added support for comment(s) for column definitions in CREATE TABLE s… (#743)

* Added support for comment(s) for column definitions in CREATE TABLE statements

* Added support for comment(s) for column definitions in CREATE TABLE statements #2

* To increase code coverage

* To increase code coverage #2

* Added support for 'ALTER TABLE CHANGE COLUMN' (#741)

* Added support for 'ALTER TABLE CHANGE COLUMN oldName newName columnDefinition'. Please see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html for reference.

* Returned import ordering to avoid conflicts

* Improved the tests somewhat

Now also test the getOptionalSpecifier() for both cases (null and not-null)

* Expanded tests for ALTER TABLE ... CHANGE

* implemented optimize for, fixes #348

* implemented optimize for, fixes #348

* Support for simple informix outer joins. (#745)

* added support for simple informix outer joins
added some test code

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* fixes #747

* fixes #733

* fixes #707

* Update README.md

* Update README.md

* Fix handles the following cases: 1) DROP INDEX 2) ADD UNIQUE INDEX 3) ALGORITHM 4) USING <index type>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alter tab support for 'change'

3 participants