<table><tr><td style="">jfita created this revision.<br />jfita added reviewers: staniek, piggz.<br />Herald added a project: KDb.<br />Herald added a subscriber: Kexi-Devel-list.<br />jfita requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29186">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The part dealing with cursor buffering for SQLite was in fact from the<br />
time when the driver was only for SQLite2: sqlite_step() from back then<br />
required a pointer to store the column data as strings, regardless of<br />
the column’s type, and SqliteCursor kept these pointers in a QVector.</p>

<p>As far as i could see in Git’s log, when the driver was ported to<br />
SQLite3 it never used this QVector, i guess because now SQLite3 can<br />
return more than only strings, and when support for version 2 was<br />
dropped that code was left as is, with no chance of being used because<br />
neither cur_coldata nor the QVector were never updated.</p>

<p>I changed the buffer’s type from QVector<const char <strong>> to QVector<const<br />
QVariant </strong>>. That way it can kept a copy of all the QVariants returned<br />
by SqliteCursorData::getValue; it is very similar to what<br />
drv_storeCurrentRecord and does with KDbRecordData.  I did not make the<br />
buffer a QVector<KDbRecordData> because then each row would keep a field<br />
count.</p>

<p>The only part i did not know what do about was the return value for<br />
KDbCursor::recordData(), because its return type is const char <strong> and i<br />
did not feel it right to convert all QVariants to char </strong>. As i could<br />
not find any user of this function in neither KEXI, KReport or KDb<br />
itself, for now i just return NULL.</p>

<p>This fixes bug KEXI’s 420534 (“Report uses incorrect record/row in group<br />
footer”) when using a SQLite-based database.</p>

<p>FIXED-IN:3.2.1<br />
BUG:420534</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R15 KDb</div></div></div><br /><div><strong>BRANCH</strong><div><div>sqlite-buffer</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29186">https://phabricator.kde.org/D29186</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/drivers/sqlite/SqliteCursor.cpp</div></div></div><br /><div><strong>To: </strong>jfita, staniek, piggz<br /><strong>Cc: </strong>Kexi-Devel-list, barman, wicik, staniek<br /></div>