-
Notifications
You must be signed in to change notification settings - Fork 599
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
fix(cdc): fix wrong default column matching #20348
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
if let Some(external_col) = external_columns.get(col.name()) { | ||
col.column_desc.generated_or_default_column = | ||
external_col.column_desc.generated_or_default_column.clone(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that we don't find a column in external_columns
? Should we return an error (just like in #20203)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find a case for now. But a potential case is #19112.
An example haven't been supported but to be supported:
CREATE TABLE test (
id int,
name varchar,
my_id int as id + 1, // generated column
PRIMARY KEY (id)
) FROM pg_source TABLE 'public.test';
I can make it throw an error for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same logic can be found here, so it's also OK not to throw an error.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Fix the bug introduced in #19354. Resolve #20346
The bug will cause two problems:
zip_eq_fast
, if the numbers of columns in rw schema and pg schema are different, panic happens.Checklist
Documentation
Release note