Skip to content

Address tables by their full path so same-named tables don't collide - #3

Merged
Zeus26286 merged 2 commits into
mainfrom
fix/issue-532-tabledata-list-dataset
Nov 3, 2026
Merged

Zeus26286 merged 2 commits into
mainfrom
fix/issue-532-tabledata-list-dataset

Conversation

@jackyyy2960

Copy link
Copy Markdown
Collaborator

Fixes compatibility priority #1: tabledata.list returned another dataset's table of the same name (upstream goccy#532).

Problem

With ds1.t and ds2.t both present, listing ds2.t returned ds1.t's rows. tabledata.list, extract jobs and the Storage Read API queried the table by its bare ID, and googlesqlite resolves a bare name to the first dataset that has a table with that name. The result was silently wrong data.

Changes

  • internal/contentdata/repository.go: export the existing validated tablePath helper as TablePath.
  • server/handler.go (tabledata.list, extract jobs) and server/storage_handler.go (Storage Read API): address tables by their full project.dataset.table path, as TruncateTable and CountTableRows already do.

A CLAUDE.md had been committed alongside the fix by accident. It's removed again in e5f2da2, so it isn't part of this PR's diff.

Tests

  • Regression tests: TestIssue532SameTableNameInTwoDatasets (tabledata.list and extract job) and TestIssue532StorageReadSameTableNameInTwoDatasets (Storage Read API).
  • go vet ./... and the full unit suite pass.
  • e2e: 60/73 pass. All python, php, node, bq and java cases pass; the 13 failures are all Ruby cases.
    • The Ruby cases fail with ArgumentError: wrong number of arguments (given 2, expected 1). This already happens on main: a fresh image build picks up json 3.x, which multi_json can't call. Keep the table catalog in sync with DDL #1 fixes it.

Merging

This PR and #4 (BYTES fix) both add their regression test at the same place at the end of server/server_test.go. Whichever merges second needs a trivial conflict resolution that keeps both tests. Neither conflicts with #1.

🤖 Generated with Claude Code

jackyyy2960 and others added 2 commits October 31, 2026 00:45
…occy#532)

tabledata.list, extract jobs and the Storage Read API queried a table by
its bare ID. googlesqlite resolves a bare name to the first dataset holding
a table of that name, so with ds1.t and ds2.t both present, reading ds2.t
returned ds1.t's rows.

Expose the existing validated contentdata tablePath helper as TablePath and
use it at all three call sites, as TruncateTable and CountTableRows already
do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It was committed with the fix by accident and is unrelated to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Zeus26286 Zeus26286 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. tabledata.list, extract jobs and the Storage Read API now query project.dataset.table through TablePath. I grepped for other query builders that use a bare table ID and found none: every remaining FROM/TABLE with a %s in non-test code already uses the full path. Both regression tests cover the same-named-table case.

Verified locally: go vet ./... and go test ./... -count=1 pass with #1, #3, #4 and #2 merged together.

Merge note: this and #4 both append a test at the end of server/server_test.go, so whichever merges second gets a trivial conflict. Keep both tests.


Generated by Claude Code

@Zeus26286
Zeus26286 merged commit e02d561 into main Nov 3, 2026
Zeus26286 pushed a commit that referenced this pull request Nov 3, 2026
Resolve the conflict in server/server_test.go by keeping both
TestIssue532SameTableNameInTwoDatasets (from #3) and
TestIssue498BytesRoundTrip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019tgEtTxTsLWxmQawCfsQQa
Zeus26286 pushed a commit that referenced this pull request Nov 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019tgEtTxTsLWxmQawCfsQQa
Zeus26286 pushed a commit that referenced this pull request Nov 3, 2026
* docs: track the top 10 BigQuery compatibility priorities

Record the ranked list of the most urgent gaps between the emulator and
real BigQuery, with the evidence and upstream issues/PRs for each, and
mark goccy#532 and goccy#498 as fixed on their branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: mark compatibility priority #3 (DDL catalog sync) as fixed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: address review on the compatibility priorities list

- Link every issue/PR number to goccy/bigquery-emulator; bare #N
  autolinked to this fork.
- Mark section 3's heading fixed, matching the table and body.
- Link the item 1-3 fix branches, now pushed, and PR #1 for item 3.
- List upstream 519 and 520 only as PRs; they are not issues.
- Clarify that ✅ means fixed on a fork branch, not merged yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: link the PRs for compatibility priorities #1 and #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: mark compatibility priorities #1-#3 as merged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019tgEtTxTsLWxmQawCfsQQa

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants