D29186: Fix SqliteCursor’s buffering

jordi fita i mas noreply at phabricator.kde.org
Sat Apr 25 21:12:53 BST 2020


jfita created this revision.
jfita added reviewers: staniek, piggz.
Herald added a project: KDb.
Herald added a subscriber: Kexi-Devel-list.
jfita requested review of this revision.

REVISION SUMMARY
  The part dealing with cursor buffering for SQLite was in fact from the
  time when the driver was only for SQLite2: sqlite_step() from back then
  required a pointer to store the column data as strings, regardless of
  the column’s type, and SqliteCursor kept these pointers in a QVector.
  
  As far as i could see in Git’s log, when the driver was ported to
  SQLite3 it never used this QVector, i guess because now SQLite3 can
  return more than only strings, and when support for version 2 was
  dropped that code was left as is, with no chance of being used because
  neither cur_coldata nor the QVector were never updated.
  
  I changed the buffer’s type from QVector<const char **> to QVector<const
  QVariant **>. That way it can kept a copy of all the QVariants returned
  by SqliteCursorData::getValue; it is very similar to what
  drv_storeCurrentRecord and does with KDbRecordData.  I did not make the
  buffer a QVector<KDbRecordData> because then each row would keep a field
  count.
  
  The only part i did not know what do about was the return value for
  KDbCursor::recordData(), because its return type is const char ** and i
  did not feel it right to convert all QVariants to char **. As i could
  not find any user of this function in neither KEXI, KReport or KDb
  itself, for now i just return NULL.
  
  This fixes bug KEXI’s 420534 (“Report uses incorrect record/row in group
  footer”) when using a SQLite-based database.
  
  FIXED-IN:3.2.1
  BUG:420534

REPOSITORY
  R15 KDb

BRANCH
  sqlite-buffer

REVISION DETAIL
  https://phabricator.kde.org/D29186

AFFECTED FILES
  src/drivers/sqlite/SqliteCursor.cpp

To: jfita, staniek, piggz
Cc: Kexi-Devel-list, barman, wicik, staniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kexi-devel/attachments/20200425/cb7d5b3b/attachment-0001.html>


More information about the Kexi-devel mailing list