Skip to content

Commit

Permalink
fix(postgres-cdc): fix validation of PK with uppercase (#16793) (#16798)
Browse files Browse the repository at this point in the history
Co-authored-by: StrikeW <[email protected]>
  • Loading branch information
github-actions[bot] and StrikeW authored May 17, 2024
1 parent 97a0861 commit 7f24e19
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion e2e_test/source/cdc/cdc.load.slt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ create table shipments_2 (
# Test user-provided publication
statement ok
create table t1_rw (
v1 int primary key,
"V1" int primary key,
v3 varchar
) with (
connector = 'postgres-cdc',
Expand Down
4 changes: 2 additions & 2 deletions e2e_test/source/cdc/postgres_cdc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ INSERT INTO person VALUES (1001, 'peter white', '[email protected]', '1781 2313
INSERT INTO person VALUES (1002, 'sarah spencer', '[email protected]', '3453 4987 9481 6270', 'los angeles');

create schema abs;
create table abs.t1 (v1 int primary key, v2 double precision, v3 varchar, v4 numeric);
create publication my_publicaton for table abs.t1 (v1, v3);
create table abs.t1 ("V1" int primary key, v2 double precision, v3 varchar, v4 numeric);
create publication my_publicaton for table abs.t1 ("V1", v3);
insert into abs.t1 values (1, 1.1, 'aaa', '5431.1234');


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ private void validateTableSchema() throws SQLException {
var pkFields = new HashSet<String>();
while (res.next()) {
var name = res.getString(1);
// RisingWave always use lower case for column name
pkFields.add(name.toLowerCase());
pkFields.add(name);
}

if (!ValidatorUtils.isPrimaryKeyMatch(tableSchema, pkFields)) {
Expand Down

0 comments on commit 7f24e19

Please sign in to comment.