Skip to content

Commit

Permalink
Better escape the select query for a case a schema name starts with a…
Browse files Browse the repository at this point in the history
… number (#21051)

* Better escape the select query for a case a schema name starts with a numebr.

* improve test

* fix unrelated build error
  • Loading branch information
rodireich authored and jbfbell committed Jan 13, 2023
1 parent f715310 commit 021b715
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class PostgresSource extends AbstractJdbcSource<PostgresType> implements
SELECT
(EXISTS (SELECT FROM information_schema.columns WHERE table_schema = '%s' AND table_name = '%s' AND is_nullable = 'YES' AND column_name = '%s'))
AND
(EXISTS (SELECT from %s.\"%s\" where \"%s\" IS NULL LIMIT 1)) AS %s
(EXISTS (SELECT from \"%s\".\"%s\" where \"%s\" IS NULL LIMIT 1)) AS %s
""";
public static final String NULL_CURSOR_VALUE_NO_SCHEMA =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ private ConfiguredAirbyteStream createTableWithNullValueCursor(final Database da
.withSyncMode(SyncMode.INCREMENTAL)
.withStream(CatalogHelpers.createAirbyteStream(
"test_table_null_cursor",
"public",
"12345public",
Field.of("id", JsonSchemaType.STRING))
.withSupportedSyncModes(Lists.newArrayList(SyncMode.FULL_REFRESH, SyncMode.INCREMENTAL))
.withSourceDefinedPrimaryKey(List.of(List.of("id"))));
Expand Down

0 comments on commit 021b715

Please sign in to comment.