Skip to content

Commit

Permalink
Escaping table names for log based replication
Browse files Browse the repository at this point in the history
  • Loading branch information
s7clarke10 authored Aug 31, 2024
1 parent a1132ad commit 2a9d708
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tap_mssql/sync_strategies/log_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def sync_historic_table(mssql_conn, config, catalog_entry, state, columns, strea
with open_conn.cursor() as cur:

escaped_columns = map(lambda c: common.prepare_columns_sql(catalog_entry, c), columns)
table_name = catalog_entry.table
schema_name = common.get_database_name(catalog_entry)
table_name = common.escape(catalog_entry.table)
schema_name = common.escape(common.get_database_name(catalog_entry))

if not verify_change_data_capture_table(mssql_conn, schema_name, table_name):
raise Exception(
Expand Down Expand Up @@ -289,9 +289,10 @@ def sync_table(mssql_conn, config, catalog_entry, state, columns, stream_version
state_last_lsn = singer.get_bookmark(state, catalog_entry.tap_stream_id, "lsn")

escaped_columns = map(lambda c: common.prepare_columns_sql(catalog_entry, c), columns)
table_name = catalog_entry.table
table_name = common.escape(catalog_entry.table)
schema_name = common.get_database_name(catalog_entry)
schema_table = schema_name + "_" + table_name
schema_table = common.escape(schema_name + "_" + table_name)
schema_name = common.escape(schema_name)

if not verify_change_data_capture_table(mssql_conn, schema_name, table_name):
raise Exception(
Expand Down

0 comments on commit 2a9d708

Please sign in to comment.