[Libreoffice-commits] core.git: connectivity/source
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Sun Nov 3 22:09:57 UTC 2019
connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx | 40 +++++-----
1 file changed, 23 insertions(+), 17 deletions(-)
New commits:
commit 8349e919a8a6d6b8c81956806e13b567261c8853
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Sun Jan 6 17:10:26 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Nov 3 23:08:50 2019 +0100
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 at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/76727
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/81901
Tested-by: Jenkins
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));
}
}
More information about the Libreoffice-commits
mailing list