Skip to content

Commit

Permalink
Merge branch '3.13' of https://github.com/JumpMind/symmetric-ds.git i…
Browse files Browse the repository at this point in the history
…nto 3.13
  • Loading branch information
joshahicks committed Apr 8, 2022
2 parents 5b8bb89 + fd62fdf commit 7065a1a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import java.util.ArrayList;
import java.util.List;

import org.jumpmind.db.model.Column;
import org.jumpmind.db.model.Database;
import org.jumpmind.db.model.Table;
import org.jumpmind.db.platform.IDatabasePlatform;
import org.jumpmind.db.sql.IConnectionCallback;
Expand All @@ -54,6 +56,8 @@
public class AseSymmetricDialect extends AbstractSymmetricDialect implements ISymmetricDialect {
static final String SQL_DROP_FUNCTION = "drop function dbo.$(functionName)";
static final String SQL_FUNCTION_INSTALLED = "select count(object_name(object_id('$(functionName)')))";
static final String SQL_PAGE_SIZE = "select @@maxpagesize";
private int pageSize = 2048;

public AseSymmetricDialect(IParameterService parameterService, IDatabasePlatform platform) {
super(parameterService, platform);
Expand All @@ -62,6 +66,39 @@ public AseSymmetricDialect(IParameterService parameterService, IDatabasePlatform
} else {
this.triggerTemplate = new AseTriggerTemplate(this);
}
try {
pageSize = platform.getSqlTemplate().queryForInt(SQL_PAGE_SIZE);
log.info("Page size is {}", pageSize);
} catch (Exception e) {
log.debug("Unable to query page size", e);
}
}

@Override
public Database readSymmetricSchemaFromXml() {
Database database = super.readSymmetricSchemaFromXml();
if (pageSize == 2048) {
String prefix = parameterService.getTablePrefix() + "_";
reconfigureTableColumn(database, prefix, TableConstants.SYM_FILE_SNAPSHOT, "relative_dir", "55");
reconfigureTableColumn(database, prefix, TableConstants.SYM_FILE_SNAPSHOT, "file_name", "55");
reconfigureTableColumn(database, prefix, TableConstants.SYM_FILE_INCOMING, "relative_dir", "55");
reconfigureTableColumn(database, prefix, TableConstants.SYM_FILE_INCOMING, "file_name", "55");
Table table = database.findTable(prefix + TableConstants.SYM_REGISTRATION_REQUEST);
if (table != null) {
table.removeIndex(0);
}
}
return database;
}

protected void reconfigureTableColumn(Database database, String prefix, String tableName, String columnName, String size) {
Table table = database.findTable(prefix + tableName);
if (table != null) {
Column column = table.findColumn(columnName);
if (column != null) {
column.setSize(size);
}
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bigquery=com.fasterxml.jackson.core:jackson-core:2.10.2, com.google.api:api-comm
cassandra=com.datastax.cassandra:cassandra-driver-core:3.1.4
db2=jdbc.db2:db2jcc:9.7, net.sf.jt400:jt400:9.7
derby=org.apache.derby:derby:10.14.2.0, org.apache.derby:derbytools:10.14.2.0
elasticsearch=org.elasticsearch.client:elasticsearch-rest-high-level-client:7.10.2,org.elasticsearch:elasticsearch:7.10.2,org.elasticsearch.client:elasticsearch-rest-client:7.10.2,org.elasticsearch.plugin:mapper-extras-client:7.10.2,org.elasticsearch.plugin:parent-join-client:7.10.2,org.elasticsearch.plugin:aggs-matrix-stats-client:7.10.2,org.elasticsearch.plugin:rank-eval-client:7.10.2,org.elasticsearch.plugin:lang-mustache-client:7.10.2,org.elasticsearch:elasticsearch-core:7.10.2,org.elasticsearch:elasticsearch-secure-sm:7.10.2,org.elasticsearch:elasticsearch-x-content:7.10.2,org.elasticsearch:elasticsearch-geo:7.10.2,org.elasticsearch:elasticsearch-cli:7.10.2,org.elasticsearch:jna:5.5.0,org.apache.lucene:lucene-core:8.7.0, org.apache.httpcomponents:httpcore:4.4.12,org.apache.httpcomponents:httpclient:4.5.10,org.apache.httpcomponents:httpasyncclient:4.1.4,org.apache.httpcomponents:httpcore-nio:4.4.12,joda-time:joda-time:2.10.4
elasticsearch=org.elasticsearch.client:elasticsearch-rest-high-level-client:7.10.2,org.elasticsearch:elasticsearch:7.10.2,org.elasticsearch.client:elasticsearch-rest-client:7.10.2,org.elasticsearch.plugin:mapper-extras-client:7.10.2,org.elasticsearch.plugin:parent-join-client:7.10.2,org.elasticsearch.plugin:aggs-matrix-stats-client:7.10.2,org.elasticsearch.plugin:rank-eval-client:7.10.2,org.elasticsearch.plugin:lang-mustache-client:7.10.2,org.elasticsearch:elasticsearch-core:7.10.2,org.elasticsearch:elasticsearch-secure-sm:7.10.2,org.elasticsearch:elasticsearch-x-content:7.10.2,org.elasticsearch:elasticsearch-geo:7.10.2,org.elasticsearch:elasticsearch-cli:7.10.2,org.elasticsearch:jna:5.5.0,org.apache.lucene:lucene-core:8.7.0, org.apache.httpcomponents:httpcore:4.4.12,org.apache.httpcomponents:httpclient:4.5.10,org.apache.httpcomponents:httpasyncclient:4.1.4,org.apache.httpcomponents:httpcore-nio:4.4.12,joda-time:joda-time:2.10.4,com.carrotsearch:hppc:0.9.1,org.apache.lucene:lucene-queries:8.10.1
firebird=org.firebirdsql.jdbc:jaybird:4.0.2.java8, javax.resource:connector-api:1.5
#h2=com.h2database:h2:1.3.176
hana=com.sap.cloud.db.jdbc:ngdbc:2.3.62
Expand Down

0 comments on commit 7065a1a

Please sign in to comment.