Repository navigation
fix(macos): fail a keyed save that matched no row on MySQL, SQL Server, Oracle, Snowflake and Dameng - #4242
Merged
Conversation
…r, Oracle, Snowflake and Dameng
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.
Summary
CLIENT_FOUND_ROWS. AnUPDATEcounts the rows it matched, so a keyed edit that matched no row fails the save and rolls back. The editor's rows affected,ROW_COUNT()and MCProws_affectedcount matched rows too;INSERT ... ON DUPLICATE KEY UPDATEonto a row holding the values reports 1, not 0.PluginRowWrite.expectedRowCount(PluginKit, additive, kit stays 44). A driver sets it when its engine counts matched rows; the save then refuses a higher count, or a lower one for anUPDATE. It never raises the host's own one-row count.SET NOCOUNT OFFon keyed writes too, so a session left atSET NOCOUNT ONstill reports the count (Preview SQL shows it).FOUND_ROWS, every MySQL-family server measured offers it, and the core already holds keyed writes to exactly one row.DataWriteRowCounts.areMeaningfulis nowcountsMatchedRows; its two engine sets are now the same list.scripts/probes/check-mysql-found-rows.sh,scripts/probes/check-mssql-keyed-row-counts.sh(builds the SQL Server plugin's own sources).DataWriteExecutorTests.fewerRowsIsNotAFailurepinned MySQL as lenient; it now uses an engine with no matched count, and the MySQL family joinskeyedUpdateThatMatchedNothingFails.Test plan
PluginRowWriteTests,MySQLFoundRowsTests(the sign-in packet carriesCLIENT_FOUND_ROWS),DataWriteExecutorTests(a driver count holds an update, leaves a gone row's delete and a view lenient),RowChangeStatementFactoryCoverageTests(the driver count reaches the plan and never raises the keyless one).build-for-testing); no simulator runtime on this Mac to run them.Needs the maintainer
UPDATEwriting the value a row holds reports 1.