Repository navigation
Commit cf8bfd3
authored
## Summary
Follow-up cleanup for **databricks/databricks-odbc#135**, unblocked now
that #201 (fix for #187) has merged.
`kernel_metadata_list_tables` (`src/c_abi/metadata.rs`) collapsed an
empty / whitespace-only / comma-only `table_types` CSV to `None`
**specifically to dodge the pre-#187 kernel bug** where `Some(&[])`
matched *nothing*. Its inline comment said so. Since #201, `list_tables`
/ `reshape_tables` treat `Some(&[])` the same as `None` (match-all), so:
- The comment was **stale/misleading** — it still claimed the kernel
rejects every row on `Some(&[])`.
- The `if v.is_empty() { None } else { Some(v) }` collapse is no longer
needed for correctness.
## Changes
- **Rewrote the stale comment** to describe post-#201 match-all
behavior.
- **Extracted** the CSV split into a pure `split_table_types_csv` helper
and **dropped the empty→`None` collapse**: an empty parse now yields
`Some(vec![])`, which is match-all. ODBC's `""` / whitespace /
comma-only → all-types convention is preserved — the empty entries are
still dropped, the result is just `Some(&[])` instead of `None`, and
those are now equivalent.
- **Added a unit test** locking in the empty/junk → all-types
normalization and non-empty CSV parsing.
## Behavior
No `SQLTables` behavior change; comparator remains clean (`Some(&[])` ≡
`None` post-#201). This is purely internal cleanup so the now-stale
rationale doesn't mislead a future reader.
## Testing
- `cargo clippy --all-targets` clean
- Full suite green (856 passed, 0 failed), including the new
`split_table_types_csv_normalizes_empty_and_parses_values` test
## Related
- Addresses databricks/databricks-odbc#135. Note: that issue also needs
the ODBC repo's kernel pin (`KERNEL_REPO_TAG`) bumped past this PR
before the cleanup is live in the shipped driver — that pin bump is
intentionally **out of scope here** and left for a routine kernel-pin
refresh, so the ODBC issue stays open after this merges.
- Follows databricks-sql-kernel#201 (fixes #187)
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 309e4c5 commit cf8bfd3
1 file changed
Lines changed: 40 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
176 | 193 | | |
177 | 194 | | |
178 | 195 | | |
| |||
209 | 226 | | |
210 | 227 | | |
211 | 228 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 229 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
413 | 436 | | |
0 commit comments