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

Correctly handle cacheSize in mariadb #2270

Merged
merged 4 commits into from Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -72,7 +72,7 @@ public Sql[] generateSql(AlterSequenceStatement statement, Database database, Sq
}
}

if ((statement.getCacheSize() != null) && (database instanceof OracleDatabase || database instanceof PostgresDatabase)) {
if ((statement.getCacheSize() != null) && (database instanceof OracleDatabase || database instanceof PostgresDatabase || database instanceof MariaDBDatabase)) {
if (statement.getCacheSize().equals(BigInteger.ZERO)) {
buffer.append(" NOCACHE ");
} else {
Expand Down
Expand Up @@ -92,10 +92,12 @@ public Sql[] generateSql(CreateSequenceStatement statement, Database database, S
}

if (statement.getCacheSize() != null) {
if (database instanceof OracleDatabase || database instanceof Db2zDatabase || database instanceof PostgresDatabase) {
if (database instanceof OracleDatabase || database instanceof Db2zDatabase || database instanceof PostgresDatabase || database instanceof MariaDBDatabase) {
if (BigInteger.ZERO.equals(statement.getCacheSize())) {
if (database instanceof OracleDatabase) {
queryStringBuilder.append(" NOCACHE ");
} else if (database instanceof MariaDBDatabase) {
queryStringBuilder.append(" CACHE 0");
}
} else {
queryStringBuilder.append(" CACHE ").append(statement.getCacheSize());
Expand Down