mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 792105 - Startup takes several minutes
set/get_locale are apparently very expensive on Mingw64, and setting the C locale for extracting a string is unnecessary. Unfortunately the released version of libdbi still uses strtod so setting the C locale *is* still necessary for retrieving floats and doubles and for passing queries. Thanks to Mkubat for the diagnosis.
This commit is contained in:
@@ -144,7 +144,6 @@ GncDbiSqlResult::IteratorImpl::get_string_at_col(const char* col) const
|
||||
auto attrs = dbi_result_get_field_attribs (m_inst->m_dbi_result, col);
|
||||
if(type != DBI_TYPE_STRING)
|
||||
throw (std::invalid_argument{"Requested string from non-string column."});
|
||||
gnc_push_locale (LC_NUMERIC, "C");
|
||||
auto strval = dbi_result_get_string(m_inst->m_dbi_result, col);
|
||||
if (strval == nullptr)
|
||||
{
|
||||
@@ -152,7 +151,6 @@ GncDbiSqlResult::IteratorImpl::get_string_at_col(const char* col) const
|
||||
throw (std::invalid_argument{"Column empty."});
|
||||
}
|
||||
auto retval = std::string{strval};
|
||||
gnc_pop_locale (LC_NUMERIC);
|
||||
return retval;
|
||||
}
|
||||
time64
|
||||
|
||||
Reference in New Issue
Block a user