Repository navigation
Fix PREPARE with ON DUPLICATE KEY UPDATE for NULL on UNSIGNED column - #23887
Merged
Merged
Conversation
ghost
approved these changes
Mar 19, 2026
aunjgr
approved these changes
Mar 19, 2026
Contributor
Merge Queue Status
This pull request spent 6 seconds in the queue, with no time running CI. Required conditions to merge
|
1 of 7 tasks
ghost
pushed a commit
that referenced
this pull request
Apr 29, 2026
#24191) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: fixes #24186 ## What this PR does / why we need it: Backports the prepared-statement / connector compatibility fixes from `main` to `3.0-dev` listed in #24186: | PR | Title | |----|-------| | #23413 | Fix BOOL MySQL protocol output and refresh BVT results | | #23578 | Add `server_id` system variable for ODBC | | #23864 | Reset vector class to FLAT in `ResetWithSameType` to fix prepared stmt null json panic | | #23887 | Fix NULL on duplicate key for unsigned columns *(already on 3.0-dev — skipped as empty)* | | #23982 | Support JSON prepared params | | #23984 | Clear prepared binary param state | | #23980 | Harden prepare long data parsing | #### Additional changes required to make the cherry-picks compile and pass tests on 3.0-dev: - Pulled in the prerequisite **#23978** *"harden prepared binary reset cleanup"* (the COM_STMT_EXECUTE error path now returns the prepareStmt so `clearBinaryParamState` runs; `doReset` now clears binary state; COM_STMT_RESET / COM_STMT_CLOSE error paths return early instead of dereferencing a nil prepareStmt; `parseStmtExecute` returns `preStmt` on error). - Added a missing `MultiUpdateCtx.clone()` helper (with `PartitionCols` initialization) on 3.0-dev that #23980 expects. - Adjusted the cherry-picked unit tests (`deletion_partition_test.go`, `insert_partition_test.go`) to use the 2-argument `testutil.MakeInt64Vector`/`MakeRowIdVector` signatures present on 3.0-dev, and renamed the partition `ExprWithRowID` field reference to `Expr`. - De-duplicated `TestResetWithSameTypeResetsClass` / `TestFunctionResultAppendNullAfterToConst` (already present on 3.0-dev). - Added support for DATE input under `MYSQL_TYPE_DATETIME`/`MYSQL_TYPE_TIMESTAMP` in `appendResultSetBinaryRow2` and brought scale/timezone-aware DATE/DATETIME/TIME/TIMESTAMP formatting into `appendResultSetTextRow` (matches `main`). - A handful of refreshed BVT result files from #23413 were dropped because the underlying BVT cases don't exist on 3.0-dev. ## Special notes for your reviewer: CI on this branch will validate the BVT delta. Tested locally with `go test -tags matrixone_test ./pkg/frontend/... ./pkg/sql/colexec/{insert,deletion,preinsert,multi_update}/... ./pkg/container/vector/...` — all green (with `TZ=UTC` for the pre-existing TZ-sensitive `TestRowToString`). --------- Co-authored-by: gouhongshen <[email protected]> Co-authored-by: robll-v1 <[email protected]> Co-authored-by: Cao Kai <[email protected]> Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <[email protected]>
fengttt
pushed a commit
to fengttt/matrixone
that referenced
this pull request
May 7, 2026
…atrixorigin#23887) Fix an issue where executing a prepared INSERT ... ON DUPLICATE KEY UPDATE statement with a NULL parameter on an INT UNSIGNED column failed. Added a corresponding BVT case. Approved by: @heni02, @aunjgr
This branch was previously deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #23886
What this PR does / why we need it:
Fix an issue where executing a prepared INSERT ... ON DUPLICATE KEY UPDATE statement with a NULL
parameter on an INT UNSIGNED column failed. Added a corresponding BVT case.