diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-12-21 13:42:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-10 09:54:04 +0100 |
commit | 80dd8d8c2f7f6a14f20795757a5b3556caae1608 (patch) | |
tree | 8b768d6bb44f3485e0447765065869ed0f9d9a42 /dbaccess | |
parent | e9febe48283bf376ecf06cd688e8cef087a41a35 (diff) |
Resolves: tdf#121838 catch exception for missing column
in database migration
Change-Id: Ied42d1436f14012fb918e8e6775fcbe0f7d5fac5
Reviewed-on: https://gerrit.libreoffice.org/65547
Tested-by: Jenkins
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/filter/hsqldb/hsqlimport.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx index 260ec8665d0a..f2b1ff67f182 100644 --- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx +++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx @@ -338,11 +338,21 @@ void HsqlImporter::importHsqlDatabase() // data for (const auto& tableIndex : parser.getTableIndexes()) { - std::vector<ColumnDefinition> aColTypes = parser.getTableColumnTypes(tableIndex.first); try { + std::vector<ColumnDefinition> aColTypes = parser.getTableColumnTypes(tableIndex.first); parseTableRows(tableIndex.second, aColTypes, tableIndex.first); } + catch (const std::out_of_range& e) + { + std::unique_ptr<SQLException> ex(new SQLException); + const char* msg = e.what(); + ex->SQLState = OUString(msg, strlen(msg), RTL_TEXTENCODING_ASCII_US); + // chain errors and keep going + if (pException) + ex->NextException <<= *pException; + pException = std::move(ex); + } catch (SQLException& ex) { if (pException) |