Repository navigation
Commit 8ade7b0
authored
Parse T-SQL and Snowflake multi-item ADD lists (#2839)
* 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 #2837
* style: rename new tests to camelCase for Codacy1 parent d1de84c commit 8ade7b0
3 files changed
Lines changed: 111 additions & 2 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 | |
|---|---|---|---|
| |||
2510 | 2510 | | |
2511 | 2511 | | |
2512 | 2512 | | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
2513 | 2545 | | |
2514 | 2546 | | |
2515 | 2547 | | |
| |||
20802 | 20834 | | |
20803 | 20835 | | |
20804 | 20836 | | |
| 20837 | + | |
| 20838 | + | |
| 20839 | + | |
| 20840 | + | |
| 20841 | + | |
| 20842 | + | |
| 20843 | + | |
| 20844 | + | |
| 20845 | + | |
| 20846 | + | |
| 20847 | + | |
| 20848 | + | |
| 20849 | + | |
| 20850 | + | |
| 20851 | + | |
| 20852 | + | |
| 20853 | + | |
| 20854 | + | |
20805 | 20855 | | |
20806 | 20856 | | |
20807 | 20857 | | |
| |||
| 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