Fix copy constructor in SetVariableStatement#18101
Merged
Mytherin merged 1 commit intoduckdb:v1.3-ossivalisfrom Jul 1, 2025
Merged
Fix copy constructor in SetVariableStatement#18101Mytherin merged 1 commit intoduckdb:v1.3-ossivalisfrom
Mytherin merged 1 commit intoduckdb:v1.3-ossivalisfrom
Conversation
This change fixes the copy constructor of the `SetVariableStatement` by adding there a call to the superclass copy constructor. Previously this constructor was using non-copy constructor of the superclass and thus was failing to copy `named_param_map` field (and some other fields). When the `postgres_scanner` extension is loaded the result of the `Prepare()` call for queries like `SET VARIABLE v = ?` was gettng an empty `named_param_map` field and the execution of this statement was failing with: > Binder Error: Parameter/argument count mismatch for prepared statement. Expected 0, got 1 Testing: new test is added that uses `CanRequestRebind()` API to check the code path on which `SQLStatement`'s copy constructor is invoked. Fixes: duckdb/duckdb-java#294
ecaee4a to
42eb1f2
Compare
Collaborator
|
Thanks! |
github-actions bot
pushed a commit
to duckdb/duckdb-r
that referenced
this pull request
Jul 1, 2025
Fix copy constructor in SetVariableStatement (duckdb/duckdb#18101) OSX.yml: Move from using debug builds to release + DDEBUG + FORCE_ASSERT (duckdb/duckdb#18102)
github-actions bot
added a commit
to duckdb/duckdb-r
that referenced
this pull request
Jul 1, 2025
Fix copy constructor in SetVariableStatement (duckdb/duckdb#18101) OSX.yml: Move from using debug builds to release + DDEBUG + FORCE_ASSERT (duckdb/duckdb#18102) Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes the copy constructor of the
SetVariableStatementby adding there a call to the superclass copy constructor. Previously this constructor was using non-copy constructor of the superclass and thus was failing to copynamed_param_mapfield (and some other fields).When the
postgres_scannerextension is loaded the result of thePrepare()call for queries likeSET VARIABLE v = ?was gettng an emptynamed_param_mapfield and the execution of this statement was failing with:Testing: new test is added that uses
CanRequestRebind()API to check the code path on whichSQLStatement's copy constructor is invoked.Fixes: duckdb/duckdb-java#294