![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qsql_firebird_result_p.h>
Public Types | |
| using | BlobWriter = std::function<bool(ISC_QUAD &, const QByteArray &)> |
| Public Types inherited from QSqlResultPrivate | |
| using | IndexMap = QHash<QString, QList<int>> |
| using | QHolderVector = QList<QHolder> |
Public Member Functions | |
| ~QFirebirdResultPrivate () | |
| void | cleanup () |
| void | closeCursor () |
| Firebird::IMaster * | master () const |
| Firebird::IStatus * | status () const |
| Firebird::IAttachment * | att () const |
| Firebird::ITransaction * | activeTransaction () const |
| Firebird::ITransaction * | ensureTransaction () |
| bool | buildInputMessage (QString &errorText) |
| bool | fillInputBuffer (const QList< QVariant > &vals, QString &errorText, BlobWriter blobWriter={}) |
| bool | encodeScaledNumeric (char *datadata, int fbType, int scalescale, const QVariant &valval, QString &errorText) |
| void | writeInlineBlob (ISC_QUAD &blobId, const QByteArray &blobData) |
| void | adoptReplacementTransaction (Firebird::ITransaction *executedTr, Firebird::ITransaction *newTr) |
| bool | ensureCachedRow (int indexindex) |
| void | resetOverflowWarnings () const |
| bool | firstOverflowWarning (int rowrow, int field) const |
| QString | formatFbError (const QString &ctxctx) |
| QSqlResultPrivate (QSqlResult *qq, const QSqlDriver *drv) | |
| Public Member Functions inherited from QSqlResultPrivate | |
| QSqlResultPrivate (QSqlResult *qq, const QSqlDriver *drv) | |
| virtual | ~QSqlResultPrivate ()=default |
| void | clearValues () |
| void | resetBindCount () |
| void | clearIndex () |
| void | clear () |
| virtual QString | fieldSerial (qsizetype) const |
| QString | positionalToNamedBinding (const QString &queryquery) const |
| QString | namedToPositionalBinding (const QString &queryquery) |
| QString | holderAt (int indexindex) const |
Static Public Attributes | |
| static constexpr int | AffectedPending = -2 |
| static constexpr int | NoWarnedRow = (std::numeric_limits<int>::min)() |
Additional Inherited Members | |
| Static Public Member Functions inherited from QSqlResultPrivate | |
| static bool | isVariantNull (const QVariant &variant) |
Definition at line 111 of file qsql_firebird_result_p.h.
| using QFirebirdResultPrivate::BlobWriter = std::function<bool(ISC_QUAD &, const QByteArray &)> |
Core helper: fill inBuffer from a flat list of values (one per parameter, metadata taken from the inCols cache). blobWriter, when set, is called for SQL_BLOB parameters instead of using att->createBlob(). Signature: bool(ISC_QUAD &blobId, const QByteArray &data). Returns false on error.
Definition at line 169 of file qsql_firebird_result_p.h.
|
inline |
Definition at line 118 of file qsql_firebird_result_p.h.
References cleanup(), and driverAlive.
|
inline |
Definition at line 153 of file qsql_firebird_result_p.h.
| void QFirebirdResultPrivate::adoptReplacementTransaction | ( | Firebird::ITransaction * | executedTr, |
| Firebird::ITransaction * | newTr ) |
Adopt a transaction handle that IStatement::execute() returned in place of the one it was given, releasing the replaced handle exactly once.
Definition at line 395 of file qsql_firebird_result.cpp.
|
inline |
Definition at line 152 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::buildInputMessage | ( | QString & | errorText | ) |
Definition at line 341 of file qsql_firebird_result.cpp.
| void QFirebirdResultPrivate::cleanup | ( | ) |
Definition at line 83 of file qsql_firebird_result.cpp.
References affectedRows, cacheComplete, isProcExec, isSelect, procRowFetched, recordCached, resetOverflowWarnings(), txnOp, and useRowCache.
Referenced by ~QFirebirdResultPrivate().
| void QFirebirdResultPrivate::closeCursor | ( | ) |
Close the open cursor (if any), releasing the handle if the close throws. Assumes the attachment is alive — only exec()/execBatch() call it, and only while executing. cleanup() handles the detached case inline.
Definition at line 163 of file qsql_firebird_result.cpp.
| bool QFirebirdResultPrivate::encodeScaledNumeric | ( | char * | data, |
| int | fbType, | ||
| int | scale, | ||
| const QVariant & | val, | ||
| QString & | errorText ) |
Per-value encoders, factored out of fillInputBuffer so it stays focused on parameter iteration and NULL handling. Both may throw FbException, which exec()/execBatch translate into a QSqlError. encodeScaledNumeric handles every scaled NUMERIC/DECIMAL parameter and plain INT128 (scale 0); it returns false (with errorText set) for values that cannot be represented exactly in the column's range.
Definition at line 349 of file qsql_firebird_result.cpp.
References fbBaseType().
| bool QFirebirdResultPrivate::ensureCachedRow | ( | int | index | ) |
Pull rows from the server cursor (sequential fetchNext, which benefits from fbclient read-ahead) into rowCache until it holds at least index+1 rows or the cursor is exhausted. Returns true if rowCache[index] exists. May throw FbException (callers wrap in try/catch as elsewhere).
Definition at line 176 of file qsql_firebird_result.cpp.
References cacheComplete.
| ITransaction * QFirebirdResultPrivate::ensureTransaction | ( | ) |
Definition at line 200 of file qsql_firebird_result.cpp.
| bool QFirebirdResultPrivate::fillInputBuffer | ( | const QList< QVariant > & | vals, |
| QString & | errorText, | ||
| BlobWriter | blobWriter = {} ) |
Definition at line 414 of file qsql_firebird_result.cpp.
References fbBaseType(), ColumnInfo::fbType, and ColumnInfo::length.
| bool QFirebirdResultPrivate::firstOverflowWarning | ( | int | row, |
| int | field ) const |
Definition at line 151 of file qsql_firebird_result.cpp.
References overflowWarnedRow.
Definition at line 193 of file qsql_firebird_result.cpp.
|
inline |
Returns the driver's master/status/attachment/transaction without copying them. These are const accessors that hand back mutable Firebird interface pointers by design: the Firebird OO API has no const-qualified interfaces, and result fetching (e.g. data() const reading a BLOB) is inherently a mutating server operation, so logical const cannot propagate here.
Definition at line 150 of file qsql_firebird_result_p.h.
|
inline |
Definition at line 46 of file qsqlresult_p.h.
| void QFirebirdResultPrivate::resetOverflowWarnings | ( | ) | const |
Definition at line 145 of file qsql_firebird_result.cpp.
References NoWarnedRow, and overflowWarnedRow.
Referenced by cleanup().
|
inline |
Definition at line 151 of file qsql_firebird_result_p.h.
| void QFirebirdResultPrivate::writeInlineBlob | ( | ISC_QUAD & | blobId, |
| const QByteArray & | blobData ) |
Definition at line 373 of file qsql_firebird_result.cpp.
|
staticconstexpr |
getAffectedRecords() costs a statement-info round trip, so exec() only marks the count as pending and numRowsAffected() resolves it on demand (QIBASE defers the same way). -1 = unknown/none.
Definition at line 218 of file qsql_firebird_result_p.h.
| int QFirebirdResultPrivate::affectedRows = -1 |
Definition at line 219 of file qsql_firebird_result_p.h.
Referenced by cleanup().
|
mutable |
Array descriptors resolved by cachedArrayDesc, keyed by relation/field. Valid while the statement lives; cleared in cleanup(). mutable: data() reads through a const private pointer and only populates the cache.
Definition at line 211 of file qsql_firebird_result_p.h.
| Firebird::ITransaction* QFirebirdResultPrivate::autoTrans = nullptr |
Definition at line 194 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::cacheComplete = false |
Definition at line 234 of file qsql_firebird_result_p.h.
Referenced by cleanup(), and ensureCachedRow().
|
mutable |
QSqlRecord is derived solely from the (immutable-after-prepare) column metadata, so build it once and hand back copies — see record().
Definition at line 267 of file qsql_firebird_result_p.h.
| QList<ColumnInfo> QFirebirdResultPrivate::cols |
Definition at line 199 of file qsql_firebird_result_p.h.
| Firebird::IResultSet* QFirebirdResultPrivate::cursor = nullptr |
Definition at line 193 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::driverAlive = true |
Set to false by ~QFirebirdDriver if the driver object is destroyed while this result is still alive. Once false, cleanup() must not dereference the (now-freed) driver private.
Definition at line 141 of file qsql_firebird_result_p.h.
Referenced by ~QFirebirdResultPrivate().
| QByteArray QFirebirdResultPrivate::inBuffer |
Definition at line 204 of file qsql_firebird_result_p.h.
| QList<ColumnInfo> QFirebirdResultPrivate::inCols |
Definition at line 200 of file qsql_firebird_result_p.h.
| Firebird::IMessageMetadata* QFirebirdResultPrivate::inMeta = nullptr |
Definition at line 197 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::isProcExec = false |
Definition at line 221 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| bool QFirebirdResultPrivate::isSelect = false |
Definition at line 220 of file qsql_firebird_result_p.h.
Referenced by cleanup().
|
staticconstexpr |
data() decodes from outBuffer on every call, so the LowPrecisionInt overflow warning for an INT128 cell would repeat on each access of the same value. Remember the fields already reported for the current row. Every exec() and cleanup() starts afresh (resetOverflowWarnings), for SELECTs and EXECUTE PROCEDURE alike. NoWarnedRow lies below every position data() can be called at: the procedure output row is read at QSql::BeforeFirstRow (-1) by writeOutValues() and at 0 after next(). mutable, like arrayDescCache: data() reads through a const private pointer and this is bookkeeping about what it has reported, not state that changes what it returns.
Definition at line 257 of file qsql_firebird_result_p.h.
Referenced by resetOverflowWarnings().
| QByteArray QFirebirdResultPrivate::outBuffer |
Definition at line 203 of file qsql_firebird_result_p.h.
| Firebird::IMessageMetadata* QFirebirdResultPrivate::outMeta = nullptr |
Definition at line 196 of file qsql_firebird_result_p.h.
|
mutable |
Definition at line 259 of file qsql_firebird_result_p.h.
|
mutable |
Definition at line 258 of file qsql_firebird_result_p.h.
Referenced by firstOverflowWarning(), and resetOverflowWarnings().
| bool QFirebirdResultPrivate::procRowFetched = false |
Definition at line 222 of file qsql_firebird_result_p.h.
Referenced by cleanup().
|
mutable |
Definition at line 268 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| QList<QByteArray> QFirebirdResultPrivate::rowCache |
Definition at line 235 of file qsql_firebird_result_p.h.
| Firebird::IStatement* QFirebirdResultPrivate::stmt = nullptr |
Definition at line 192 of file qsql_firebird_result_p.h.
| TxnOp QFirebirdResultPrivate::txnOp = TxnOp::None |
Definition at line 224 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| bool QFirebirdResultPrivate::useRowCache = false |
-— Opt-in client-side row cache (FB_SCROLLABLE_CACHE) -— Enabled in exec() for scrollable SELECTs when the driver flag is set. rowCache holds a raw snapshot of outBuffer per absolute row index; on a cached fetch the snapshot is copied back into outBuffer so data() works unchanged (BLOB/array columns cache their blob id, valid for the txn).
Definition at line 233 of file qsql_firebird_result_p.h.
Referenced by cleanup().