mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)
124539 jvonka: Merged 50N-NDB (5.0.4) to 5.0.N (5.0.4) 124514: MNT-15211: NDB-specific workaround fix for trashcan restore (since NDB does not support partial rollback on constraint violation) - this fix is dialect-specific (hence does not impact existing supported DB types) - note: MySQL Cluster NDB - experimental/unsupported git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@124582 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||
|
||||
* Copyright (C) 2005-2016 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -70,6 +69,7 @@ import org.alfresco.repo.admin.patch.AppliedPatch;
|
||||
import org.alfresco.repo.admin.patch.Patch;
|
||||
import org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch;
|
||||
import org.alfresco.repo.content.filestore.FileContentWriter;
|
||||
import org.alfresco.repo.domain.hibernate.dialect.AlfrescoMySQLClusterNDBDialect;
|
||||
import org.alfresco.repo.domain.hibernate.dialect.AlfrescoOracle9Dialect;
|
||||
import org.alfresco.repo.domain.hibernate.dialect.AlfrescoSQLServerDialect;
|
||||
import org.alfresco.repo.domain.hibernate.dialect.AlfrescoSybaseAnywhereDialect;
|
||||
@@ -1478,6 +1478,23 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
sql = sql.replaceAll("(?i)TYPE=InnoDB", "ENGINE=InnoDB");
|
||||
}
|
||||
|
||||
if (this.dialect != null && this.dialect instanceof AlfrescoMySQLClusterNDBDialect)
|
||||
{
|
||||
// note: enable bootstrap on MySQL Cluster NDB
|
||||
/*
|
||||
* WARNING: Experimental/unsupported - see AlfrescoMySQLClusterNDBDialect !
|
||||
*/
|
||||
sql = sql.replaceAll("(?i)TYPE=InnoDB", "ENGINE=NDB"); // belts-and-braces
|
||||
sql = sql.replaceAll("(?i)ENGINE=InnoDB", "ENGINE=NDB");
|
||||
|
||||
sql = sql.replaceAll("(?i) BIT ", " BOOLEAN ");
|
||||
sql = sql.replaceAll("(?i) BIT,", " BOOLEAN,");
|
||||
|
||||
sql = sql.replaceAll("(?i) string_value text", " string_value VARCHAR(1024)");
|
||||
|
||||
sql = sql.replaceAll("(?i) VARCHAR(4000)", "TEXT(4000)");
|
||||
}
|
||||
|
||||
Object fetchedVal = executeStatement(connection, sql, fetchColumnName, optional, line, scriptFile);
|
||||
if (fetchVarName != null && fetchColumnName != null)
|
||||
{
|
||||
@@ -1635,6 +1652,12 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
// serializable_value blob,
|
||||
maxStringLength = Integer.MAX_VALUE;
|
||||
}
|
||||
else if (dialect instanceof AlfrescoMySQLClusterNDBDialect)
|
||||
{
|
||||
// string_value varchar(1024),
|
||||
// serializable_value blob,
|
||||
maxStringLength = SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH;
|
||||
}
|
||||
else if (dialect instanceof AlfrescoOracle9Dialect)
|
||||
{
|
||||
// string_value varchar2(1024 char),
|
||||
|
Reference in New Issue
Block a user