Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yugabyte/yugabyte-db#19260] Add support for NOTHING and DEFAULT on connector #289

Merged
merged 6 commits into from
Nov 20, 2023

Conversation

thedhruvrawat
Copy link
Contributor

@thedhruvrawat thedhruvrawat commented Oct 31, 2023

Adding support for two new record types: DEFAULT and NOTHING based on Postgres replica identity types. Their behaviour for the basic queries listed below is as follows:

Queries:

CREATE TABLE t1(id INT PRIMARY KEY, v1 INT, v2 INT);
INSERT INTO t1 VALUES (1,2,3);
# Perform an update
UPDATE t1 SET v1 = 3 WHERE id = 1;
# Perform a delete
DELETE from t1 WHERE id = 1;
RECORD_TYPE OPERATION OLD_IMAGE NEW_IMAGE
DEFAULT UPDATE {{}} {{1},{3},{3}}
DELETE {{1}} {{}}
NOTHING UPDATE {{}} {{1},{3},{3}}
DELETE {{}} {{}}

Also, the ALL and MODIFIED_COLUMNS_OLD_AND_NEW_IMAGES modes have been renamed to FULL and CHANGE_OLD_NEW respectively.

Have kept the old ALL and MODIFIED_COLUMNS_OLD_AND_NEW_IMAGES to maintain backward compatibility.

Test Plan

Added tests for NOTHING and DEFAULT modes

  • mvn clean test -Dtest=YugabyteDBBeforeImageTest#consecutiveSingleShardTransactionsForDefault
  • mvn clean test -Dtest=YugabyteDBBeforeImageTest#consecutiveSingleShardTransactionsForNothing

@thedhruvrawat thedhruvrawat merged commit d84d26d into main Nov 20, 2023
0 of 2 checks passed
@vaibhav-yb vaibhav-yb deleted the new-record-types branch January 4, 2024 07:16
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.

None yet

3 participants