Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsql_ibase.cpp File Reference
#include "qsql_ibase_p.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qtimezone.h>
#include <QtCore/qdeadlinetimer.h>
#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
#include <QtCore/qmap.h>
#include <QtCore/qmutex.h>
#include <QtCore/qvariant.h>
#include <QtCore/qvarlengtharray.h>
#include <QtSql/qsqlerror.h>
#include <QtSql/qsqlfield.h>
#include <QtSql/qsqlindex.h>
#include <QtSql/qsqlquery.h>
#include <QtSql/private/qsqlcachedresult_p.h>
#include <QtSql/private/qsqldriver_p.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <mutex>
+ Include dependency graph for qsql_ibase.cpp:

Go to the source code of this file.

Classes

struct  QIBaseEventBuffer
 
class  QIBaseDriverPrivate
 
class  QIBaseResult
 
class  QIBaseResultPrivate
 

Macros

#define FBVERSION   SQL_DIALECT_V6
 
#define SQLDA_CURRENT_VERSION   SQLDA_VERSION1
 
#define blr_boolean_dtype   blr_bool
 

Typedefs

typedef QMap< void *, QIBaseDriver * > QIBaseBufferDriverMap
 

Functions

static bool getIBaseError (QString &msg, const ISC_STATUS *status, ISC_LONG &sqlcode)
 
static void createDA (XSQLDA *&sqlda)
 
static void enlargeDA (XSQLDA *&sqlda, int n)
 
static void initDA (XSQLDA *sqlda)
 
static void delDA (XSQLDA *&sqlda)
 
static QMetaType::Type qIBaseTypeName (int iType, bool hasScale)
 
static QMetaType::Type qIBaseTypeName2 (int iType, bool hasScale)
 
static ISC_TIMESTAMP toTimeStamp (const QDateTime &dt)
 
static QDateTime fromTimeStamp (char *buffer)
 
static ISC_TIME toTime (QTime t)
 
static QTime fromTime (char *buffer)
 
static ISC_DATE toDate (QDate t)
 
static QDate fromDate (char *buffer)
 
 Q_GLOBAL_STATIC (QMutex, qMutex)
 
static void qFreeEventBuffer (QIBaseEventBuffer *eBuffer)
 
template<typename T >
static QList< QVarianttoList (char **buf, int count)
 
static char * readArrayBuffer (QList< QVariant > &list, char *buffer, short curDim, short *numElements, ISC_ARRAY_DESC *arrayDesc)
 
template<typename T >
static char * fillList (char *buffer, const QList< QVariant > &list, T *=nullptr)
 
template<>
char * fillList< float > (char *buffer, const QList< QVariant > &list, float *)
 
static char * qFillBufferWithString (char *buffer, const QString &string, short buflen, bool varying, bool array)
 
static char * createArrayBuffer (char *buffer, const QList< QVariant > &list, QMetaType::Type type, short curDim, ISC_ARRAY_DESC *arrayDesc, QString &error)
 
static ISC_EVENT_CALLBACK qEventCallback (char *result, ISC_USHORT length, const ISC_UCHAR *updated)
 

Variables

constexpr qsizetype QIBaseChunkSize = SHRT_MAX / 2
 

Macro Definition Documentation

◆ blr_boolean_dtype

#define blr_boolean_dtype   blr_bool

Definition at line 38 of file qsql_ibase.cpp.

◆ FBVERSION

#define FBVERSION   SQL_DIALECT_V6

Definition at line 30 of file qsql_ibase.cpp.

◆ SQLDA_CURRENT_VERSION

#define SQLDA_CURRENT_VERSION   SQLDA_VERSION1

Definition at line 33 of file qsql_ibase.cpp.

Typedef Documentation

◆ QIBaseBufferDriverMap

Definition at line 372 of file qsql_ibase.cpp.

Function Documentation

◆ createArrayBuffer()

static char * createArrayBuffer ( char *  buffer,
const QList< QVariant > &  list,
QMetaType::Type  type,
short  curDim,
ISC_ARRAY_DESC *  arrayDesc,
QString error 
)
static

Definition at line 728 of file qsql_ibase.cpp.

References createArrayBuffer(), elements, error, fillList< float >(), list, qFillBufferWithString(), QList< T >::size(), toDate(), toTime(), and toTimeStamp().

Referenced by createArrayBuffer(), and QIBaseResultPrivate::writeArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createDA()

static void createDA ( XSQLDA *&  sqlda)
static

Definition at line 67 of file qsql_ibase.cpp.

References SQLDA_CURRENT_VERSION.

Referenced by QIBaseResult::prepare().

+ Here is the caller graph for this function:

◆ delDA()

static void delDA ( XSQLDA *&  sqlda)
static

Definition at line 129 of file qsql_ibase.cpp.

References i.

Referenced by QIBaseResultPrivate::cleanup(), and QIBaseResult::exec().

+ Here is the caller graph for this function:

◆ enlargeDA()

static void enlargeDA ( XSQLDA *&  sqlda,
int  n 
)
static

Definition at line 78 of file qsql_ibase.cpp.

References SQLDA_CURRENT_VERSION.

Referenced by QIBaseResult::prepare().

+ Here is the caller graph for this function:

◆ fillList()

template<typename T >
static char * fillList ( char *  buffer,
const QList< QVariant > &  list,
T *  = nullptr 
)
static

Definition at line 682 of file qsql_ibase.cpp.

References list.

◆ fillList< float >()

template<>
char * fillList< float > ( char *  buffer,
const QList< QVariant > &  list,
float *   
)

Definition at line 693 of file qsql_ibase.cpp.

References list.

Referenced by createArrayBuffer().

+ Here is the caller graph for this function:

◆ fromDate()

static QDate fromDate ( char *  buffer)
static

Definition at line 294 of file qsql_ibase.cpp.

References QDate::addDays(), and d.

Referenced by QIBaseResult::gotoNext(), and readArrayBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromTime()

static QTime fromTime ( char *  buffer)
static

Definition at line 275 of file qsql_ibase.cpp.

Referenced by QIBaseResult::gotoNext(), and readArrayBuffer().

+ Here is the caller graph for this function:

◆ fromTimeStamp()

static QDateTime fromTimeStamp ( char *  buffer)
static

Definition at line 222 of file qsql_ibase.cpp.

References QDate::addDays(), and d.

Referenced by QIBaseResult::gotoNext(), and readArrayBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIBaseError()

static bool getIBaseError ( QString msg,
const ISC_STATUS *  status,
ISC_LONG &  sqlcode 
)
static

Definition at line 51 of file qsql_ibase.cpp.

References QString::clear(), QString::fromUtf8(), and QString::isEmpty().

Referenced by QIBaseResult::exec(), QIBaseDriverPrivate::isError(), and QIBaseResultPrivate::isError().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDA()

static void initDA ( XSQLDA *  sqlda)
static

Definition at line 88 of file qsql_ibase.cpp.

References i.

Referenced by QIBaseResult::prepare().

+ Here is the caller graph for this function:

◆ Q_GLOBAL_STATIC()

Q_GLOBAL_STATIC ( QMutex  ,
qMutex   
)

◆ qEventCallback()

static ISC_EVENT_CALLBACK qEventCallback ( char *  result,
ISC_USHORT  length,
const ISC_UCHAR *  updated 
)
static

Definition at line 1816 of file qsql_ibase.cpp.

References QMetaObject::invokeMethod(), Q_ARG, and Qt::QueuedConnection.

Referenced by QIBaseDriver::subscribeToNotification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qFillBufferWithString()

static char * qFillBufferWithString ( char *  buffer,
const QString string,
short  buflen,
bool  varying,
bool  array 
)
static

Definition at line 704 of file qsql_ibase.cpp.

References QString::data(), QString::leftJustified(), QString::length(), str, and QString::toUtf8().

Referenced by createArrayBuffer(), and QIBaseResult::exec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qFreeEventBuffer()

static void qFreeEventBuffer ( QIBaseEventBuffer eBuffer)
static

Definition at line 376 of file qsql_ibase.cpp.

Referenced by QIBaseDriver::close(), QIBaseDriver::subscribeToNotification(), and QIBaseDriver::unsubscribeFromNotification().

+ Here is the caller graph for this function:

◆ qIBaseTypeName()

static QMetaType::Type qIBaseTypeName ( int  iType,
bool  hasScale 
)
static

Definition at line 141 of file qsql_ibase.cpp.

References blr_boolean_dtype, qWarning, and QMetaType::UnknownType.

Referenced by QIBaseDriver::primaryIndex(), QIBaseDriver::record(), and QIBaseResultPrivate::writeArray().

+ Here is the caller graph for this function:

◆ qIBaseTypeName2()

static QMetaType::Type qIBaseTypeName2 ( int  iType,
bool  hasScale 
)
static

Definition at line 178 of file qsql_ibase.cpp.

References QMetaType::UnknownType.

Referenced by QIBaseResult::gotoNext(), and QIBaseResult::record().

+ Here is the caller graph for this function:

◆ readArrayBuffer()

static char * readArrayBuffer ( QList< QVariant > &  list,
char *  buffer,
short  curDim,
short *  numElements,
ISC_ARRAY_DESC *  arrayDesc 
)
static

Definition at line 547 of file qsql_ibase.cpp.

References QList< T >::append(), blr_boolean_dtype, fromDate(), fromTime(), fromTimeStamp(), QString::fromUtf8(), i, list, o, Q_FALLTHROUGH, and readArrayBuffer().

Referenced by QIBaseResultPrivate::fetchArray(), and readArrayBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toDate()

static ISC_DATE toDate ( QDate  t)
static

Definition at line 285 of file qsql_ibase.cpp.

References date, and QDate::daysTo().

Referenced by QDateTimePrivate::create(), createArrayBuffer(), and QIBaseResult::exec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toList()

template<typename T >
static QList< QVariant > toList ( char **  buf,
int  count 
)
static

Definition at line 537 of file qsql_ibase.cpp.

References i.

Referenced by QAndroidStyle::Android9PatchDrawable::Android9PatchDrawable(), QSQLiteResult::execBatch(), QMimerSQLResult::execBatch(), QV4::ExecutionEngine::metaTypeFromJS(), and QTreeModel::sortItems().

+ Here is the caller graph for this function:

◆ toTime()

static ISC_TIME toTime ( QTime  t)
static

Definition at line 269 of file qsql_ibase.cpp.

References QTime::msecsTo().

Referenced by QDateTimePrivate::create(), createArrayBuffer(), and QIBaseResult::exec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toTimeStamp()

static ISC_TIMESTAMP toTimeStamp ( const QDateTime dt)
static

Definition at line 212 of file qsql_ibase.cpp.

References QDateTime::date(), QDate::daysTo(), QTime::msecsTo(), and QDateTime::time().

Referenced by createArrayBuffer(), and QIBaseResult::exec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ QIBaseChunkSize

constexpr qsizetype QIBaseChunkSize = SHRT_MAX / 2
constexpr