Repository navigation
Commit bc177f4
committed
Parse T-SQL and Snowflake multi-item ADD lists
ALTER TABLE t ADD a int, b int parsed only the first column; the
rest fell into a single UNSPECIFIC expression of raw text. T-SQL and
Snowflake let one ADD list several column definitions and table
constraints without repeating ADD.
The ADD branch now loops on comma-separated items under the SQLSERVER
and SNOWFLAKE dialects: each item is a column definition or a table
constraint. A new bareAddList flag keeps the deparser from re-adding
brackets T-SQL does not accept, and lets it emit a trailing
constraint after the column list.
Fixes #28371 parent 6c5fc6c commit bc177f4
3 files changed
Lines changed: 109 additions & 3 deletions
File tree
- src
- main
- java/net/sf/jsqlparser/statement/alter
- jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser/statement/alter
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
| |||
1638 | 1649 | | |
1639 | 1650 | | |
1640 | 1651 | | |
1641 | | - | |
| 1652 | + | |
1642 | 1653 | | |
1643 | 1654 | | |
1644 | 1655 | | |
| |||
1664 | 1675 | | |
1665 | 1676 | | |
1666 | 1677 | | |
1667 | | - | |
| 1678 | + | |
1668 | 1679 | | |
1669 | 1680 | | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1670 | 1686 | | |
1671 | 1687 | | |
1672 | 1688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2459 | 2459 | | |
2460 | 2460 | | |
2461 | 2461 | | |
2462 | | - | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
2463 | 2492 | | |
2464 | 2493 | | |
2465 | 2494 | | |
| |||
20568 | 20597 | | |
20569 | 20598 | | |
20570 | 20599 | | |
| 20600 | + | |
| 20601 | + | |
| 20602 | + | |
| 20603 | + | |
| 20604 | + | |
| 20605 | + | |
| 20606 | + | |
| 20607 | + | |
| 20608 | + | |
| 20609 | + | |
| 20610 | + | |
| 20611 | + | |
| 20612 | + | |
| 20613 | + | |
| 20614 | + | |
| 20615 | + | |
| 20616 | + | |
| 20617 | + | |
20571 | 20618 | | |
20572 | 20619 | | |
20573 | 20620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
100 | 143 | | |
101 | 144 | | |
102 | 145 | | |
| |||
0 commit comments