You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unstable updating of fields equal to false in release. I have tested tst_benchmark with a little sophisticated code. Tested MySql, SQLite3 in kubuntu, win11 (mscvc 2019, VS 2022 and mingw64). The errors are the same. Stored value may be NULL or 0 (NULL or false in SQLite) if value to store or update equal to false. No errors in Debug versions.
Steps to reproduce the behavior:
Change some code from tst_benchmark.cpp
void BenchmarkTest::insert1kPost() {
QElapsedTimer t;
t.start();
for (int i = 0; i < 1000; ++i) {
auto newPost = Nut::create();
auto number = ' ' + QString::number(i + 1);
newPost->setTitle(QStringLiteral("post title") + number);
newPost->setBody(QStringLiteral("post body") + number);
(i % 2) == 0 ? newPost->setPublic(false) : newPost->setPublic(true);
newPost->setSaveDate(QDateTime::currentDateTime());
db.posts()->append(newPost);
}
db.saveChanges();
qDebug("1k post inserted in %lld ms", t.elapsed());
}
Field isPublic each even record of table "posts" should contain 'true' (or 1 in mysql) and and so it is. The fields of odd records should contain 'false" (or 0 in mysql) but this is not always the case. NULL not equal to false therefore, an execution error or logic error occurs. Similar behavior when updating to 'false' the bool field equal to "true" (1).
All files and screenshot from 2 OS each 2 drivers (QSQLITE, QMYSQL) attached. Development platform:
Unstable updating of fields equal to false in release. I have tested tst_benchmark with a little sophisticated code. Tested MySql, SQLite3 in kubuntu, win11 (mscvc 2019, VS 2022 and mingw64). The errors are the same. Stored value may be NULL or 0 (NULL or false in SQLite) if value to store or update equal to false. No errors in Debug versions.
Steps to reproduce the behavior:
void BenchmarkTest::insert1kPost() {
QElapsedTimer t;
t.start();
for (int i = 0; i < 1000; ++i) {
auto newPost = Nut::create();
auto number = ' ' + QString::number(i + 1);
newPost->setTitle(QStringLiteral("post title") + number);
newPost->setBody(QStringLiteral("post body") + number);
(i % 2) == 0 ? newPost->setPublic(false) : newPost->setPublic(true);
newPost->setSaveDate(QDateTime::currentDateTime());
db.posts()->append(newPost);
}
db.saveChanges();
qDebug("1k post inserted in %lld ms", t.elapsed());
}
Field isPublic each even record of table "posts" should contain 'true' (or 1 in mysql) and and so it is. The fields of odd records should contain 'false" (or 0 in mysql) but this is not always the case. NULL not equal to false therefore, an execution error or logic error occurs. Similar behavior when updating to 'false' the bool field equal to "true" (1).
All files and screenshot from 2 OS each 2 drivers (QSQLITE, QMYSQL) attached.
Development platform:
No errors in Debug versions!!
linux-tests.zip
windows-test.zip
The text was updated successfully, but these errors were encountered: