Skip to content

fix: accept empty DDL affected_rows result sets - #291

Merged
apstndb merged 1 commit into
mainfrom
fix/ddl-empty-rows-alpha2
Sep 23, 2026
Merged

apstndb merged 1 commit into
mainfrom
fix/ddl-empty-rows-alpha2

Conversation

@apstndb

@apstndb apstndb commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Closes #290.

go-sql-spanner represents a successful DDL statement without query rows as an empty metadata row type followed by a data result set with one synthetic affected_rows column and immediate EOF. Since #284, RunRowsAtData rejects that shape before the sink runs, so spannersh aborts at CREATE TABLE when using v0.9.1-alpha.1.

Accept only that exact placeholder shape after confirming the data result has no row or read error. An actual row, a different column, or any other metadata/column mismatch still returns ErrMetadataColumnCount; the result retains metadata and no sink callback runs on failure. On the empty case, prepare and finish still run, and the cursor remains available for a following stats result set.

Validation: Go 1.25.13 make check; targeted mismatch/EOF/error tests and a Docker-free database/sql/driver regression test covering the public RunRowsAtData path and subsequent NextResultSet. The two spannersh Emulator integration tests reported in #290 also passed with Go 1.26.8 in an isolated copy of spannersh a48385b, using a temporary module replacement to this PR head. The downstream checkout was not modified.

@apstndb
apstndb marked this pull request as ready for review September 23, 2026 13:33
@apstndb
apstndb merged commit 46967a2 into main Sep 23, 2026
5 checks passed
@apstndb
apstndb deleted the fix/ddl-empty-rows-alpha2 branch September 23, 2026 13:33
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.

dbsqlrows: metadata count check rejects go-sql-spanner DDL emptyRows

1 participant