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

Support txn insert when table sync #234

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

lsy3993
Copy link
Collaborator

@lsy3993 lsy3993 commented Nov 14, 2024

Txn insert is the SQL which starts with 'BEGIN' and ends with 'COMMIT/ROLLBACK'.

The general SQL may be like this :

insert

        begin; 
        insert into t1  select id, '2017-02-28', 'y1' from t2 where id = 3;
        insert into t1  select id, '2017-02-28', 'y1' from t2 where id = 5;
        insert into t1  select id, '2017-03-31', 'x' from t2 where id = 4;
        commit;

update + insert

        begin;
        update t1 set city = 'xxx' where user_id = 3; 
        insert into t1 select id + 1, '2017-02-28', 'yyy' from t2 where id = 5;
        commit;

delete + insert

        begin;
        delete from t1 PARTITION p201702 where user_id = 5;
        insert into t1 select id, '2017-02-28', 'new_y1' from t2 where id = 5;
        commit;

insert + update + delete

        begin;
        delete from t1 PARTITION p201702 where user_id = 6;
        insert into t1 select id + 2, '2017-02-28', 'y1' from t2 where id = 5;
        update t1 set city = 'new_city' where user_id = 5; 
        commit;

DB sync will support later.

@lsy3993 lsy3993 mentioned this pull request Nov 14, 2024
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.

1 participant