Commit a4b354e
committed
fix: Add MySQL-specific operators (div, mod) to IsMathematicalOperator
The MySQL parser uses symbolic names like 'div' and 'mod' instead of '/' and '%'.
Added these to operator.go with TODO comments indicating they should be moved to
engine-specific logic during refactoring.
This fixes the division case in type inference where (a1 / 1024) was generating
interface{} instead of the correct decimal/string type.
All 3 test cases now work correctly:
- ListTest: Simple division generates string/sql.NullString
- ListTest4: Arithmetic with nullability generates sql.NullInt32
- ListTest5: COALESCE generates string1 parent a107216 commit a4b354e
File tree
6 files changed
+248
-10
lines changed- examples/type-inference-test/mysql
- internal
- compiler
- sql/lang
6 files changed
+248
-10
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | 145 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 146 | + | |
155 | 147 | | |
| 148 | + | |
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
161 | | - | |
| 154 | + | |
162 | 155 | | |
| 156 | + | |
163 | 157 | | |
164 | 158 | | |
165 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
Binary file not shown.
0 commit comments