Commit 96f5a12
committed
fix(tables): keep the legacy numeric fallback for unknown filter fields
A backward-compatibility check on the whole change turned this up. Making the
range-comparison cast registry-driven fixed the real bug — a text-shaped type
emitting `(data->>'email')::numeric` and 500ing the rows query — but it also
swept in fields with NO schema entry, which resolve to `string` through
`columnTypeById`'s fallback and so began comparing lexicographically.
Ad-hoc numeric fields have always compared numerically there, and `'10' > '5'`
is false as text, so a saved filter on a field that is not in the schema (a
typo, or a column since removed) would quietly return a different row set with
no error at all.
An absent column type is now distinguished from a known text type: unknown
keeps `::numeric` and its operand validation exactly as before, while a known
type still answers from the registry. Both cases are pinned by tests.1 parent a0c0484 commit 96f5a12
2 files changed
Lines changed: 25 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
124 | 122 | | |
125 | | - | |
126 | | - | |
| 123 | + | |
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
| |||
381 | 378 | | |
382 | 379 | | |
383 | 380 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 381 | + | |
389 | 382 | | |
390 | 383 | | |
391 | | - | |
| 384 | + | |
392 | 385 | | |
393 | 386 | | |
394 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
834 | 834 | | |
835 | 835 | | |
836 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
837 | 850 | | |
838 | 851 | | |
839 | 852 | | |
| |||
842 | 855 | | |
843 | 856 | | |
844 | 857 | | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
849 | 862 | | |
850 | 863 | | |
851 | 864 | | |
| |||
0 commit comments