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

changelogSyncSQL does not work when table databasechangeloglock does not exist #77

Open
fenom opened this issue May 4, 2021 · 1 comment

Comments

@fenom
Copy link

fenom commented May 4, 2021

When table databasechangeloglock does not exist, changelogSyncSQL does not work, even though changelogSync does work.

Unexpected error running Liquibase: Error executing SQL SELECT COUNT(*) FROM test01.DATABASECHANGELOGLOCK where locked = TRUE ALLOW FILTERING: [Simba][CassandraJDBCDriver](500211) ERROR Invalid query: SELECT COUNT(*) FROM test01.DATABASECHANGELOGLOCK where locked = TRUE ALLOW FILTERING, Cause: com.simba.cassandra.shaded.datastax.driver.core.exceptions.InvalidQueryException: table databasechangeloglock does not exist.

This creates such an awkward workflow if I want to see the desired output from changelogSyncSQL. I have to run changelogSync, then drop databasechangelog while not dropping databasechangeloglock, then run changelogSyncSQL.
Then I can get the following output.

-- Lock Database
UPDATE test01.databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = 'test01.com (10.0.2.105)', LOCKGRANTED = 1620147506022 WHERE ID = 1;

-- Create Database Change Log Table
CREATE TABLE IF NOT EXISTS test01.databasechangelog( ID TEXT, AUTHOR TEXT, FILENAME TEXT, DATEEXECUTED timestamp, ORDEREXECUTED INT, EXECTYPE TEXT, MD5SUM TEXT, DESCRIPTION TEXT, COMMENTS TEXT, TAG TEXT, LIQUIBASE TEXT, CONTEXTS TEXT, LABELS TEXT, DEPLOYMENT_ID TEXT,PRIMARY KEY (ID, AUTHOR, FILENAME));

INSERT INTO test01.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1620142799442-1', 'root', 'changelog.cassandra.sql', 1620147512758, 1, '8:35b2b0a4656f000ec99e2e23bfa9080c', 'sql', '', 'EXECUTED', NULL, NULL, '4.3.1', '0147512687');

-- Release Database Lock
UPDATE test01.DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL WHERE ID = 1;

Why is databasechangeloglock even queried at all during changelogSyncSQL? And why isn't there a statement to create it like there is for databasechangelog?

┆Issue is synchronized with this Jira Bug by Unito

@nvoxland
Copy link
Contributor

nvoxland commented Nov 1, 2021

This happens as well with update-sql or other "output sql" type commands

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

No branches or pull requests

2 participants