![]() |
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_helpers_p.h"#include <QtCore/qtimezone.h>#include <QtCore/private/qflatmap_p.h>#include <firebird/impl/blr.h>#include <algorithm>#include <cstring>#include <limits>#include <iterator>Go to the source code of this file.
Functions | |
| QString | fbErrorString (IMaster *master, IStatus *status) |
| QSqlError | fbError (IMaster *master, IStatus *status, QSqlError::ErrorType typetype) |
| QString | fbErrorLog (const QSqlError &err) |
| void | finishAndClear (Firebird::ThrowStatusWrapper &st, Firebird::ITransaction *&tr, TxnEnd endend) |
| ITransaction * | startDefaultTransaction (IAttachment *att, ThrowStatusWrapper &st, TxnWait wait) |
| QMetaType::Type | blrTypeToQt (unsigned char blrType, bool hasScale) |
| QMetaType::Type | fbTypeToQt (int fbType, int scalescale) |
| static QString | int128SlotToString (const char *slot, int scalescale, IMaster *master, IStatus *status) |
| bool | encodeInt128Slot (const QVariant &valval, int scalescale, char *slot, IMaster *master, IStatus *status, QString &errorText) |
| QVariant | decodeInt128Slot (const char *slot, int scalescale, QSql::NumericalPrecisionPolicy policy, IMaster *master, IStatus *status, QString *overflowText) |
| ISC_DATE | encodeQDate (IUtil *util, const QDate &d) |
| ISC_TIME | encodeQTime (IUtil *util, const QTime &tt) |
| ISC_TIMESTAMP | encodeQDateTime (IUtil *util, const QDateTime &dt) |
| static QByteArray | toFirebirdZoneId (const QTimeZone &zone) |
| static QTimeZone | fromFirebirdZoneId (const QByteArray &idid) |
| static QTimeZone | zoneForFirebirdId (ISC_USHORT zoneId, const char *tzName) |
| ISC_TIMESTAMP_TZ | encodeQDateTimeTz (IStatus *iStatus, IUtil *util, const QDateTime &dt) |
| ISC_TIME_TZ | encodeQTimeTz (IStatus *iStatus, IUtil *util, const QDateTime &dt) |
| QDate | decodeFirebirdDate (IUtil *util, ISC_DATE date) |
| QTime | decodeFirebirdTime (IUtil *util, ISC_TIME time) |
| QDateTime | decodeFirebirdTimestamp (IUtil *util, const ISC_TIMESTAMP &ts) |
| QDateTime | decodeFirebirdTimestampTz (IStatus *iStatus, IUtil *util, const ISC_TIMESTAMP_TZ &tstz) |
| QDateTime | decodeFirebirdTimeTz (IStatus *iStatus, IUtil *util, const ISC_TIME_TZ &ttz) |
| void | encodeTextValue (char *datadata, int fbType, qsizetype lengthlength, const QByteArray &bytes) |
| QMetaType::Type blrTypeToQt | ( | unsigned char | blrType, |
| bool | hasScale ) |
Definition at line 108 of file qsql_firebird_helpers.cpp.
| QDate decodeFirebirdDate | ( | IUtil * | util, |
| ISC_DATE | date ) |
Definition at line 407 of file qsql_firebird_helpers.cpp.
| QTime decodeFirebirdTime | ( | IUtil * | util, |
| ISC_TIME | time ) |
Definition at line 416 of file qsql_firebird_helpers.cpp.
| QDateTime decodeFirebirdTimestamp | ( | IUtil * | util, |
| const ISC_TIMESTAMP & | ts ) |
Definition at line 427 of file qsql_firebird_helpers.cpp.
| QDateTime decodeFirebirdTimestampTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const ISC_TIMESTAMP_TZ & | tstz ) |
Definition at line 437 of file qsql_firebird_helpers.cpp.
| QDateTime decodeFirebirdTimeTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const ISC_TIME_TZ & | ttz ) |
Definition at line 458 of file qsql_firebird_helpers.cpp.
| QVariant decodeInt128Slot | ( | const char * | slot, |
| int | scale, | ||
| QSql::NumericalPrecisionPolicy | policy, | ||
| IMaster * | master, | ||
| IStatus * | status, | ||
| QString * | overflowText ) |
Definition at line 233 of file qsql_firebird_helpers.cpp.
| bool encodeInt128Slot | ( | const QVariant & | val, |
| int | scale, | ||
| char * | slot, | ||
| IMaster * | master, | ||
| IStatus * | status, | ||
| QString & | errorText ) |
Definition at line 188 of file qsql_firebird_helpers.cpp.
| ISC_DATE encodeQDate | ( | IUtil * | util, |
| const QDate & | d ) |
Definition at line 285 of file qsql_firebird_helpers.cpp.
| ISC_TIMESTAMP encodeQDateTime | ( | IUtil * | util, |
| const QDateTime & | dt ) |
Definition at line 311 of file qsql_firebird_helpers.cpp.
| ISC_TIMESTAMP_TZ encodeQDateTimeTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const QDateTime & | dt ) |
Definition at line 366 of file qsql_firebird_helpers.cpp.
| ISC_TIME encodeQTime | ( | IUtil * | util, |
| const QTime & | t ) |
Definition at line 301 of file qsql_firebird_helpers.cpp.
| ISC_TIME_TZ encodeQTimeTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const QDateTime & | dt ) |
Definition at line 388 of file qsql_firebird_helpers.cpp.
| void encodeTextValue | ( | char * | data, |
| int | fbType, | ||
| qsizetype | length, | ||
| const QByteArray & | bytes ) |
Encode a UTF-8 string into a CHAR/VARCHAR message slot: VARYING gets a 2-byte length prefix, TEXT is space-padded; data beyond the declared length is truncated. Shared by fillInputBuffer and lookupArrayDesc's bind loop so the Firebird text wire format lives in one place.
Definition at line 481 of file qsql_firebird_helpers.cpp.
| QSqlError fbError | ( | IMaster * | master, |
| IStatus * | status, | ||
| QSqlError::ErrorType | type ) |
Convert a Firebird status vector into a QSqlError. type is the context in which the error occurred, supplied by the caller (open() -> ConnectionError, prepare()/exec() -> StatementError, begin/commit/rollback -> TransactionError); QSqlError::ErrorType categorises errors by that context, not by the underlying Firebird cause. The SQLCODE is carried through as the native error code.
Definition at line 44 of file qsql_firebird_helpers.cpp.
Definition at line 54 of file qsql_firebird_helpers.cpp.
| QString fbErrorString | ( | IMaster * | master, |
| IStatus * | status ) |
Definition at line 28 of file qsql_firebird_helpers.cpp.
| QMetaType::Type fbTypeToQt | ( | int | fbType, |
| int | scale ) |
Definition at line 138 of file qsql_firebird_helpers.cpp.
References fbBaseType().
Commit (or roll back) a transaction whose handle must not outlive a failure: on a throw the interface is released and the member cleared before the rethrow, on success commit/rollback already released it, so the member is cleared too. Taking the handle by reference makes "released implies cleared" structural — every finish site shares this discipline instead of repeating it. (The bare-COMMIT path in exec() intentionally does NOT use this: a failed user COMMIT keeps the still-valid handle so it can be retried.)
Definition at line 75 of file qsql_firebird_helpers.cpp.
References Commit.
|
static |
Definition at line 337 of file qsql_firebird_helpers.cpp.
|
static |
Definition at line 177 of file qsql_firebird_helpers.cpp.
| ITransaction * startDefaultTransaction | ( | IAttachment * | att, |
| ThrowStatusWrapper & | st, | ||
| TxnWait | wait ) |
Start a transaction with the driver's default TPB: read-committed, record-version, read-write. wait selects isc_tpb_wait vs isc_tpb_nowait — the only axis on which the auto-started transaction (wait) and the explicit user transaction (nowait) differ.
Definition at line 97 of file qsql_firebird_helpers.cpp.
|
static |
Firebird names fixed-offset zones by their bare displacement ("+05:30"), while Qt uses "UTC+05:30"-style ids for them. Map between the two so offset-tagged QDateTimes bind and read back cleanly.
Definition at line 329 of file qsql_firebird_helpers.cpp.
|
static |
QTimeZone for the zone of a decoded TIMESTAMP/TIME WITH TIME ZONE value. Constructing a QTimeZone from its id is a lookup in the system's zone database and by far the most expensive step of decoding such a value, while a result set typically carries only a handful of distinct zones. Firebird's numeric zone id identifies the zone process-wide (region ids are fixed, offset ids encode the displacement), so resolve each id once per thread. tzName is the name fbclient decoded for zoneId.
Definition at line 355 of file qsql_firebird_helpers.cpp.