Commit c919a0c
authored
feat(parser): model ColDataType precision and scale as structured properties (#2539)
ColDataType exposed type parameters in three different shapes depending on
the grammar path: keyword types fold them into the dataType string
("VARCHAR (255)"), identifier types keep them in argumentsStringList
(mediumint(9) -> ["9"]), and zoned types embed them in the lexer token
image ("TIMESTAMP(3) WITH TIME ZONE"). A consumer that needs the precision
has to re-parse the string, with a different pattern per shape.
Populate structured precision and scale on all three paths. The rendered
dataType string, toString(), equals() and hashCode() are unchanged; the
hand-built object trees in DeclareStatementTest gain the new state.1 parent f24f9e1 commit c919a0c
4 files changed
Lines changed: 139 additions & 6 deletions
File tree
- src
- main
- java/net/sf/jsqlparser/statement/create/table
- jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser/statement
- create/table
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
94 | 98 | | |
95 | 99 | | |
96 | 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 | + | |
97 | 127 | | |
98 | 128 | | |
99 | 129 | | |
| |||
138 | 168 | | |
139 | 169 | | |
140 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
141 | 181 | | |
142 | 182 | | |
143 | 183 | | |
| |||
Lines changed: 41 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1293 | 1293 | | |
1294 | 1294 | | |
1295 | 1295 | | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
1296 | 1307 | | |
1297 | 1308 | | |
1298 | 1309 | | |
| |||
11739 | 11750 | | |
11740 | 11751 | | |
11741 | 11752 | | |
| 11753 | + | |
11742 | 11754 | | |
11743 | 11755 | | |
11744 | 11756 | | |
| |||
11759 | 11771 | | |
11760 | 11772 | | |
11761 | 11773 | | |
11762 | | - | |
| 11774 | + | |
| 11775 | + | |
| 11776 | + | |
| 11777 | + | |
| 11778 | + | |
| 11779 | + | |
11763 | 11780 | | |
11764 | 11781 | | |
11765 | 11782 | | |
| |||
11776 | 11793 | | |
11777 | 11794 | | |
11778 | 11795 | | |
| 11796 | + | |
| 11797 | + | |
| 11798 | + | |
11779 | 11799 | | |
11780 | 11800 | | |
11781 | 11801 | | |
| |||
11799 | 11819 | | |
11800 | 11820 | | |
11801 | 11821 | | |
| 11822 | + | |
11802 | 11823 | | |
11803 | 11824 | | |
11804 | 11825 | | |
| |||
11838 | 11859 | | |
11839 | 11860 | | |
11840 | 11861 | | |
11841 | | - | |
| 11862 | + | |
| 11863 | + | |
| 11864 | + | |
| 11865 | + | |
| 11866 | + | |
| 11867 | + | |
11842 | 11868 | | |
11843 | 11869 | | |
11844 | 11870 | | |
| |||
11888 | 11914 | | |
11889 | 11915 | | |
11890 | 11916 | | |
11891 | | - | |
| 11917 | + | |
11892 | 11918 | | |
| 11919 | + | |
| 11920 | + | |
| 11921 | + | |
| 11922 | + | |
| 11923 | + | |
| 11924 | + | |
| 11925 | + | |
| 11926 | + | |
| 11927 | + | |
| 11928 | + | |
| 11929 | + | |
| 11930 | + | |
11893 | 11931 | | |
11894 | 11932 | | |
11895 | 11933 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
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 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
100 | 154 | | |
0 commit comments