Skip to content

Commit

Permalink
drivers bugfix withDefaultValues to false
Browse files Browse the repository at this point in the history
Changed the Default Column Values default argument value to false
because Qt API doesn't obtain these Defaul Column Values
in the QSqlQuery::record(), I didn't realize that.

 - updated functional tests
  • Loading branch information
silverqx committed Jul 23, 2024
1 parent 266e867 commit 525214e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions drivers/common/include/orm/drivers/sqlquery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ namespace MySql

/* Result sets */
/*! Get a SqlRecord containing the field information for the current row. */
SqlRecord record(bool withDefaultValues = true) const;
SqlRecord record(bool withDefaultValues = false) const;
/*! Get a SqlRecord containing the field information for the current row. */
const SqlRecord &recordCached(bool withDefaultValues = true) const;
const SqlRecord &recordCached(bool withDefaultValues = false) const;

/*! Retrieve the next record and position the cursor on it. */
bool next();
Expand Down Expand Up @@ -193,7 +193,7 @@ namespace MySql
/* Result sets */
#ifdef TINYDRIVERS_MYSQL_DRIVER
/*! Get a SqlRecord containing the field information for the current row. */
SqlRecord recordAllColumns(bool withDefaultValues = true) const;
SqlRecord recordAllColumns(bool withDefaultValues) const;
#endif

/*! Normal seek. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ void tst_SqlQuery_Normal::select_recordCached_WithDefaultValues() const

while (torrents.next()) {
QVERIFY(torrents.isValid());
// Number of fields // Don't uncomment to test defaults
const auto &record = torrents.recordCached(/*true*/);
// Number of fields
const auto &record = torrents.recordCached(true);
const auto recordCount = record.count();
QCOMPARE(recordCount, 7);

Expand Down Expand Up @@ -672,8 +672,8 @@ void tst_SqlQuery_Normal::select_recordCached_WithoutDefaultValues() const

while (torrents.next()) {
QVERIFY(torrents.isValid());
// Number of fields
const auto &record = torrents.recordCached(false);
// Number of fields // Don't uncomment to test the default argument
const auto &record = torrents.recordCached(/*false*/);
const auto recordCount = record.count();
QCOMPARE(recordCount, 7);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ void tst_SqlQuery_Prepared::select_recordCached_WithDefaultValues() const

while (torrents.next()) {
QVERIFY(torrents.isValid());
// Number of fields // Don't uncomment to test the default argument
const auto &record = torrents.recordCached(/*true*/);
// Number of fields
const auto &record = torrents.recordCached(true);
const auto recordCount = record.count();
QCOMPARE(recordCount, 7);

Expand Down Expand Up @@ -709,8 +709,8 @@ void tst_SqlQuery_Prepared::select_recordCached_WithoutDefaultValues() const

while (torrents.next()) {
QVERIFY(torrents.isValid());
// Number of fields
const auto &record = torrents.recordCached(false);
// Number of fields // Don't uncomment to test the default argument
const auto &record = torrents.recordCached(/*false*/);
const auto recordCount = record.count();
QCOMPARE(recordCount, 7);

Expand Down

0 comments on commit 525214e

Please sign in to comment.