- 
    Bug 
- 
    Resolution: Duplicate
- 
     Not Evaluated Not Evaluated
- 
    None
- 
    5.10.0
- 
    None
In qsql_sqlite.cpp in "bool QSQLiteResult::exec()"...
int paramCount = sqlite3_bind_parameter_count(d->stmt); bool paramCountIsValid = paramCount == values.count(); #if (SQLITE_VERSION_NUMBER >= 3003011) // In the case of the reuse of a named placeholder if (!paramCountIsValid) { const auto countIndexes = [](int counter, const QList<int>& indexList) { return counter + indexList.length(); }; const int bindParamCount = std::accumulate(d->indexes.cbegin(), d->indexes.cend(), 0, countIndexes); paramCountIsValid = bindParamCount == values.count(); } #endif if (paramCountIsValid) { for (int i = 0; i < paramCount; ++i) { res = SQLITE_OK; const QVariant value = values.at(i);
Simple QSqlQuery c_tor crashes...
QSqlQuery insert( QLatin1String(
    "INSERT INTO eventLog ( level, dateTime, msg ) "
    "VALUES ( ?, ?, ? )" ) );
on line 487 in qsql_sqlite.cpp. paramCount and paramCountIsValid calculates first time correctly. But then execution goes into
#if (SQLITE_VERSION_NUMBER >= 3003011)
And there paramCountIsValid becomes "true" whereas values.size() == 0 and paramCount == 3...
- duplicates
- 
                    QTBUG-64923 Segfault when executing simple query with SQLite3 -         
- Closed
 
-