Commit 3194e44
authored
fix(arrow-go/flightsql): route QueryContext through active transaction (#692)
I used GPT-5.3-Codex to generate this patch to fix #667. I have reviewed
the outputs.
---
### Rationale for this change
`database/sql` queries executed via
`tx.QueryContext`/`tx.QueryRowContext` were not consistently bound to
the active Flight SQL transaction when no query arguments were provided.
The driver always used `c.client.Execute(...)`, which bypassed
transaction context and could not see uncommitted transactional state
(e.g., tables created inside the transaction).
### What changes are included in this PR?
- Updated `Connection.QueryContext` in the Flight SQL Go driver to use:
- `c.txn.Execute(...)` when `c.txn` is active and valid.
- `c.client.Execute(...)` otherwise.
- This aligns zero-argument query execution semantics with transactional
expectations in `database/sql`.
### Are these changes tested?
Yes.
- Added/used regression coverage in driver tests:
- `TestTxQueryContextUsesTransaction`
- Validation confirms:
- test fails when the fix is removed (cannot see tx-local table),
- test passes when the fix is applied.
### Are there any user-facing changes?
Yes, behavior is corrected for users of the Go Flight SQL `database/sql`
driver:
- `tx.QueryContext` / `tx.QueryRowContext` (including zero-arg queries)
now execute within the active transaction as expected.
- No API or configuration changes.1 parent 6b44167 commit 3194e44
2 files changed
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
509 | 517 | | |
510 | 518 | | |
511 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1505 | 1505 | | |
1506 | 1506 | | |
1507 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
1508 | 1554 | | |
1509 | 1555 | | |
1510 | 1556 | | |
| |||
0 commit comments