diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2018-06-26 13:15:07 +0200 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2018-07-06 10:37:36 +0200 |
commit | a91fe8558b4c8aa163069ebdb117d58239da74f2 (patch) | |
tree | e3700a21d2e9866dbcedb9542c4eebb817178834 /dbaccess/source | |
parent | 815b2130c86d5a0aa07bdddb252fbd6ae5d64a62 (diff) |
dbahsql: Look for properties only after name
Additional properties in SQL string like "DEFAULT" or "NOT NULL" should
be searched only after column name, because what if a column name is
"myEvilNOT NULLColumn"
Change-Id: I21f0755ba14c7267243d9999f044db4d16963387
Reviewed-on: https://gerrit.libreoffice.org/56462
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/filter/hsqldb/createparser.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx index 2344ceb075fe..32abe25a8521 100644 --- a/dbaccess/source/filter/hsqldb/createparser.cxx +++ b/dbaccess/source/filter/hsqldb/createparser.cxx @@ -301,10 +301,13 @@ void CreateStmtParser::parseColumnPart(const OUString& sColumnPart) if (isPrimaryKey) m_PrimaryKeys.push_back(rColumnName); + const OUString sColumnWithoutName = sColumn.copy(sColumn.indexOf(typeParts.typeName)); + ColumnDefinition aColDef(rColumnName, lcl_getDataTypeFromHsql(typeParts.typeName), typeParts.params, isPrimaryKey, - lcl_getAutoIncrementDefault(sColumn), lcl_isNullable(sColumn), - bCaseInsensitive, lcl_getDefaultValue(sColumn)); + lcl_getAutoIncrementDefault(sColumnWithoutName), + lcl_isNullable(sColumnWithoutName), bCaseInsensitive, + lcl_getDefaultValue(sColumnWithoutName)); m_aColumns.push_back(aColDef); } |