[Libreoffice-commits] core.git: dbaccess/source
Tamas Bunth
tamas.bunth at collabora.co.uk
Mon May 7 09:04:08 UTC 2018
dbaccess/source/filter/hsqldb/columndef.cxx | 3 ++-
dbaccess/source/filter/hsqldb/columndef.hxx | 5 ++++-
dbaccess/source/filter/hsqldb/createparser.cxx | 5 +++--
dbaccess/source/filter/hsqldb/fbcreateparser.cxx | 3 +++
4 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit 210638cc162ce36c8afab3aa64a65afbb5955939
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date: Sat May 5 23:38:19 2018 +0200
tdf#117299 dbahsql: add varchar_ignorecase type
Change-Id: I1dc904fe1b9146c978086861ef96f5141794bf09
Reviewed-on: https://gerrit.libreoffice.org/53901
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
diff --git a/dbaccess/source/filter/hsqldb/columndef.cxx b/dbaccess/source/filter/hsqldb/columndef.cxx
index 8cdd53f1ba49..6e36ee1b8718 100644
--- a/dbaccess/source/filter/hsqldb/columndef.cxx
+++ b/dbaccess/source/filter/hsqldb/columndef.cxx
@@ -27,13 +27,14 @@ using namespace css::sdbc;
ColumnDefinition::ColumnDefinition(const OUString& sName, sal_Int32 eType,
const std::vector<sal_Int32> aParams, bool bPrimary,
- sal_Int32 nAutoIncr, bool bNullable)
+ sal_Int32 nAutoIncr, bool bNullable, bool bCaseInsensitive)
: m_sName(sName)
, m_eType(eType)
, m_aParams(aParams)
, m_bPrimaryKey(bPrimary)
, m_nAutoIncrement(nAutoIncr)
, m_bNullable(bNullable)
+ , m_bCaseInsensitive(bCaseInsensitive)
{
}
}
diff --git a/dbaccess/source/filter/hsqldb/columndef.hxx b/dbaccess/source/filter/hsqldb/columndef.hxx
index 2bdbef83cd11..1700f7b29554 100644
--- a/dbaccess/source/filter/hsqldb/columndef.hxx
+++ b/dbaccess/source/filter/hsqldb/columndef.hxx
@@ -25,16 +25,19 @@ private:
bool m_bPrimaryKey;
sal_Int32 m_nAutoIncrement;
bool m_bNullable;
+ bool m_bCaseInsensitive;
public:
ColumnDefinition(const OUString& sName, sal_Int32 eType, const std::vector<sal_Int32> aParams,
- bool bPrimary = false, sal_Int32 nAutoIncr = -1, bool bNullable = true);
+ bool bPrimary = false, sal_Int32 nAutoIncr = -1, bool bNullable = true,
+ bool bCaseInsensitive = false);
OUString getName() const { return m_sName; }
sal_Int32 getDataType() const { return m_eType; }
bool isPrimaryKey() const { return m_bPrimaryKey; }
bool isNullable() const { return m_bNullable; }
bool isAutoIncremental() const { return m_nAutoIncrement >= 0; }
+ bool isCaseInsensitive() const { return m_bCaseInsensitive; }
sal_Int32 getStartValue() const { return m_nAutoIncrement; }
const std::vector<sal_Int32> getParams() const { return m_aParams; }
};
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx
index 6d5ffef37740..645c33557689 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -96,7 +96,7 @@ sal_Int32 lcl_getDataTypeFromHsql(const OUString& sTypeName)
{
if (sTypeName == "CHAR")
return DataType::CHAR;
- else if (sTypeName == "VARCHAR")
+ else if (sTypeName == "VARCHAR" || sTypeName == "VARCHAR_IGNORECASE")
return DataType::VARCHAR;
else if (sTypeName == "TINYINT")
return DataType::TINYINT;
@@ -189,9 +189,10 @@ void CreateStmtParser::parseColumnPart(const OUString& sColumnPart)
lcl_addDefaultParameters(aParams, lcl_getDataTypeFromHsql(sTypeName));
}
+ bool bCaseInsensitive = sTypeName.indexOf("IGNORECASE") >= 0;
ColumnDefinition aColDef(words[0], lcl_getDataTypeFromHsql(sTypeName), aParams,
lcl_isPrimaryKey(sColumn), lcl_getAutoIncrementDefault(sColumn),
- lcl_isNullable(sColumn));
+ lcl_isNullable(sColumn), bCaseInsensitive);
m_aColumns.push_back(aColDef);
}
diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
index 2208ce12d272..89ffe5e69833 100644
--- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
@@ -159,6 +159,9 @@ OUString FbCreateStmtParser::compose() const
if (columnIter->isPrimaryKey())
lcl_appendWithSpace(sSql, "PRIMARY KEY");
+ if (columnIter->isCaseInsensitive())
+ lcl_appendWithSpace(sSql, "COLLATE UNICODE_CI");
+
++columnIter;
if (columnIter != rColumns.end())
sSql.append(",");
More information about the Libreoffice-commits
mailing list