Description
On an existing table table, executing "ALTER TABLE ADD IF NOT EXISTS
thisColAlreadyExists varchar, thisColDoesNotExist varchar", then
nothing will be changed in the table because thisColAlreadyExists
already exists.
Omitting the already-existing column from the statement, all new columns
do get created.
The general expectation would be that when you use ADD IF NOT EXISTS, all
non-existent columns will be added, and all existing columns in the
statement will just be ignored. There is already an integration test
(AlterTableIT#testAddVarCols) that actually demonstrates the current
behavior, although this is probably not correct.
As pointed out in the related mailing list thread [1], ALTER TABLE DROP COLUMN likely suffers from the same issue.
Attachments
Attachments
Issue Links
- is related to
-
PHOENIX-5208 Add a test case of "ALTER TABLE DROP COLUMN IF EXISTS" with multiple columns
- Patch Available