Repository navigation
Commit dd2ddda
committed
Map INTERVAL units by token type
The unit was taken from the token text, so units SQLite doesn't support
produced an invalid DATETIME() modifier, and the result was NULL. With
the INTERVAL operators, "UPDATE t SET d = d + INTERVAL 1 QUARTER" wrote
NULL into the column, while MySQL adds 3 months. The same happened with
the SQL_TSI_* synonyms, whose text differs from the unit they map to.
Units are now looked up by token type. QUARTER becomes 3 months, and
MICROSECOND and the composite units, such as HOUR_MINUTE, are rejected.1 parent f1ca44b commit dd2ddda
2 files changed
Lines changed: 89 additions & 5 deletions
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
333 | 351 | | |
334 | 352 | | |
335 | 353 | | |
| |||
5148 | 5166 | | |
5149 | 5167 | | |
5150 | 5168 | | |
5151 | | - | |
| 5169 | + | |
5152 | 5170 | | |
5153 | 5171 | | |
5154 | 5172 | | |
| |||
5163 | 5181 | | |
5164 | 5182 | | |
5165 | 5183 | | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
5166 | 5194 | | |
5167 | | - | |
5168 | | - | |
5169 | | - | |
5170 | | - | |
| 5195 | + | |
| 5196 | + | |
5171 | 5197 | | |
5172 | 5198 | | |
5173 | 5199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1082 | 1140 | | |
1083 | 1141 | | |
1084 | 1142 | | |
| |||
0 commit comments