mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixes database schema export test on MySQL/Linux.
* MySQL on Linux stores table names in a case-sensitive manner (due to case-sensitive filesys) * DatabaseMetaData returns a confusing true for storesUppercaseQuotedIdentifiers, but seems not to be the case git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34126 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -484,13 +484,29 @@ public class ExportDb
|
|||||||
private String namePrefixFilter(DatabaseMetaData dbmd) throws SQLException
|
private String namePrefixFilter(DatabaseMetaData dbmd) throws SQLException
|
||||||
{
|
{
|
||||||
String filter = namePrefix + "%";
|
String filter = namePrefix + "%";
|
||||||
|
|
||||||
|
// Note, MySQL on Linux reports true for:
|
||||||
|
// dbmd.storesMixedCaseIdentifiers()
|
||||||
|
// dbmd.storesMixedCaseQuotedIdentifiers()
|
||||||
|
// dbmd.storesUpperCaseQuotedIdentifiers()
|
||||||
|
// and false for the other storesXYZ() methods. In reality it stores
|
||||||
|
// the table names in whatever case was provided, quoted or not.
|
||||||
|
|
||||||
// Make sure the filter works for the particular DBMS.
|
// Make sure the filter works for the particular DBMS.
|
||||||
if (dbmd.storesLowerCaseIdentifiers() || dbmd.storesLowerCaseQuotedIdentifiers())
|
if (dbmd.storesLowerCaseIdentifiers())
|
||||||
{
|
{
|
||||||
|
if (log.isDebugEnabled())
|
||||||
|
{
|
||||||
|
log.debug("DB uses lowercase identifiers");
|
||||||
|
}
|
||||||
filter = filter.toLowerCase();
|
filter = filter.toLowerCase();
|
||||||
}
|
}
|
||||||
else
|
else if (dbmd.storesUpperCaseIdentifiers())
|
||||||
{
|
{
|
||||||
|
if (log.isDebugEnabled())
|
||||||
|
{
|
||||||
|
log.debug("DB uses uppercase identifiers");
|
||||||
|
}
|
||||||
filter = filter.toUpperCase();
|
filter = filter.toUpperCase();
|
||||||
}
|
}
|
||||||
return filter;
|
return filter;
|
||||||
|
Reference in New Issue
Block a user