summaryrefslogtreecommitdiff
path: root/connectivity/source
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2019-01-06 17:10:26 +0100
committerAndras Timar <andras.timar@collabora.com>2019-11-03 23:08:50 +0100
commit8349e919a8a6d6b8c81956806e13b567261c8853 (patch)
treef04dd3bd0fb8897132c311cfde7a18a05b481bd7 /connectivity/source
parentf59630c6315031cfc44c0f21cc9a1cd151b81ff0 (diff)
mysqlc: replace initializer list with assignment
Because visual c++ compiler may not support it without creating a constructor for the struct. Change-Id: I6c8868c4e34cbe7b67e413b1db18aed01378c959 Reviewed-on: https://gerrit.libreoffice.org/65905 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/76727 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/81901 Tested-by: Jenkins
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx40
1 files changed, 23 insertions, 17 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx
index 49873f8e5841..3edcaeaab5de 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx
@@ -37,23 +37,29 @@ OResultSetMetaData::OResultSetMetaData(OConnection& rConn, MYSQL_RES* pResult)
unsigned nFieldCount = mysql_num_fields(pResult);
for (unsigned i = 0; i < nFieldCount; ++i)
{
- MySqlFieldInfo fieldInfo{
- OUString{ fields[i].name, static_cast<sal_Int32>(fields[i].name_length),
- m_rConnection.getConnectionEncoding() }, // column name
- static_cast<sal_Int32>(fields[i].length), // length
- mysqlc_sdbc_driver::mysqlToOOOType(fields[i].type, fields[i].charsetnr), // type
- fields[i].type, // mysql_type
- fields[i].charsetnr, // charset number
- fields[i].flags,
- OUString{ fields[i].db, static_cast<sal_Int32>(fields[i].db_length),
- m_rConnection.getConnectionEncoding() }, // schema name
- OUString{ fields[i].table, static_cast<sal_Int32>(fields[i].table_length),
- m_rConnection.getConnectionEncoding() }, // table name
- OUString{ fields[i].catalog, static_cast<sal_Int32>(fields[i].catalog_length),
- m_rConnection.getConnectionEncoding() }, // catalog
- static_cast<sal_Int32>(fields[i].decimals),
- static_cast<sal_Int32>(fields[i].max_length)
- };
+ MySqlFieldInfo fieldInfo;
+ {
+ fieldInfo.columnName
+ = OUString{ fields[i].name, static_cast<sal_Int32>(fields[i].name_length),
+ m_rConnection.getConnectionEncoding() };
+ fieldInfo.length = static_cast<sal_Int32>(fields[i].length);
+ fieldInfo.type
+ = mysqlc_sdbc_driver::mysqlToOOOType(fields[i].type, fields[i].charsetnr);
+ fieldInfo.mysql_type = fields[i].type;
+ fieldInfo.charsetNumber = fields[i].charsetnr;
+ fieldInfo.flags = fields[i].flags;
+ fieldInfo.schemaName
+ = OUString{ fields[i].db, static_cast<sal_Int32>(fields[i].db_length),
+ m_rConnection.getConnectionEncoding() };
+ fieldInfo.tableName
+ = OUString{ fields[i].table, static_cast<sal_Int32>(fields[i].table_length),
+ m_rConnection.getConnectionEncoding() };
+ fieldInfo.catalogName
+ = OUString{ fields[i].catalog, static_cast<sal_Int32>(fields[i].catalog_length),
+ m_rConnection.getConnectionEncoding() };
+ fieldInfo.decimals = static_cast<sal_Int32>(fields[i].decimals);
+ fieldInfo.max_length = static_cast<sal_Int32>(fields[i].max_length);
+ }
m_fields.push_back(std::move(fieldInfo));
}
}