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

Throw an error if min_valid_version is null #24

Merged
merged 9 commits into from
Mar 3, 2020

Conversation

luandy64
Copy link
Contributor

Description of change

In logical replication, sometimes our query here returns nil

sql-query (format "SELECT CHANGE_TRACKING_MIN_VALID_VERSION(%d) as min_valid_version" object-id)
_ (log/infof "Executing query: %s" sql-query)
min-valid-version (-> (jdbc/query (assoc (config/->conn-map config) :dbname dbname) [sql-query])
first
:min_valid_version)]

And when that happens, the tap will eventually try (> nil 12345) which causes a java.lang.NullPointerException.

QA steps

  • automated tests passing
  • manual qa steps passing (list below)
    • Ran the tap

Risks

  • Low

Rollback steps

  • revert this branch

Copy link
Contributor

@dmosorast dmosorast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment re: table name matching for getting object_id. There is an Object_id function as well, but Kyle says that may not have been working? https://docs.microsoft.com/en-us/sql/t-sql/functions/object-id-transact-sql?view=sql-server-ver15

Also, are there tests for this already? Maybe adding one that creates 2 different schemas could be useful.

src/tap_mssql/sync_strategies/logical.clj Outdated Show resolved Hide resolved
@dmosorast dmosorast merged commit b5b1fa3 into master Mar 3, 2020
@dmosorast dmosorast deleted the clarify-null-pointer branch March 3, 2020 18:38
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.

3 participants