Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsql_mysql.cpp File Reference
#include "qsql_mysql_p.h"
#include <qcoreapplication.h>
#include <qvariant.h>
#include <qvarlengtharray.h>
#include <qdatetime.h>
#include <qdebug.h>
#include <qfile.h>
#include <qlist.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qsqlquery.h>
#include <qsqlrecord.h>
#include <qstringlist.h>
#include <QtSql/private/qsqldriver_p.h>
#include <QtSql/private/qsqlresult_p.h>
#include "moc_qsql_mysql_p.cpp"
+ Include dependency graph for qsql_mysql.cpp:

Go to the source code of this file.

Classes

struct  QT_MYSQL_TIME
 
class  QMYSQLDriverPrivate
 
class  QMYSQLResult
 
class  QMYSQLResultPrivate
 
struct  QMYSQLResultPrivate::QMyField
 

Typedefs

using my_bool = decltype(mysql_stmt_bind_result(nullptr, nullptr))
 

Functions

static QVariant qDateFromString (const QString &val)
 
static QVariant qTimeFromString (const QString &val)
 
static QVariant qDateTimeFromString (QString &val)
 
static bool checkPreparedQueries (MYSQL *mysql)
 
static QSqlError qMakeError (const QString &err, QSqlError::ErrorType type, const QMYSQLDriverPrivate *p)
 
static QMetaType qDecodeMYSQLType (enum_field_types mysqltype, uint flags)
 
static QSqlField qToField (MYSQL_FIELD *field)
 
static QSqlError qMakeStmtError (const QString &err, QSqlError::ErrorType type, MYSQL_STMT *stmt)
 
static bool qIsBlob (enum_field_types t)
 
static bool qIsTimeOrDate (enum_field_types t)
 
static bool qIsInteger (int t)
 
static bool qIsBitfield (enum_field_types type)
 
static uint64_t qDecodeBitfield (const QMYSQLResultPrivate::QMyField &f, const char *outField)
 
static QT_MYSQL_TIMEtoMySqlDate (QDate date, QTime time, int type)
 
static void qLibraryInit ()
 
static void qLibraryEnd ()
 
static void setOptionFlag (uint &optionFlags, QStringView opt)
 
static bool setOptionString (MYSQL *mysql, mysql_option option, QStringView v)
 
static bool setOptionInt (MYSQL *mysql, mysql_option option, QStringView v)
 
static bool setOptionBool (MYSQL *mysql, mysql_option option, QStringView v)
 
static bool setOptionProtocol (MYSQL *mysql, mysql_option option, QStringView v)
 

Variables

static int qMySqlConnectionCount = 0
 
static bool qMySqlInitHandledByUser = false
 

Typedef Documentation

◆ my_bool

using my_bool = decltype(mysql_stmt_bind_result(nullptr, nullptr))

Definition at line 39 of file qsql_mysql.cpp.

Function Documentation

◆ checkPreparedQueries()

static bool checkPreparedQueries ( MYSQL *  mysql)
inlinestatic

Definition at line 108 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ qDateFromString()

static QVariant qDateFromString ( const QString val)
inlinestatic

Definition at line 68 of file qsql_mysql.cpp.

References Qt::ISODate, and Q_UNUSED.

Referenced by QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qDateTimeFromString()

static QVariant qDateTimeFromString ( QString val)
inlinestatic

Definition at line 92 of file qsql_mysql.cpp.

References Qt::ISODate, and Q_UNUSED.

Referenced by QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qDecodeBitfield()

static uint64_t qDecodeBitfield ( const QMYSQLResultPrivate::QMyField f,
const char *  outField 
)
inlinestatic

Definition at line 529 of file qsql_mysql.cpp.

References i.

Referenced by QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qDecodeMYSQLType()

static QMetaType qDecodeMYSQLType ( enum_field_types  mysqltype,
uint  flags 
)
static

Definition at line 201 of file qsql_mysql.cpp.

Referenced by QMYSQLResultPrivate::bindInValues(), QMYSQLResult::nextResult(), qToField(), and QMYSQLResult::reset().

+ Here is the caller graph for this function:

◆ qIsBitfield()

static bool qIsBitfield ( enum_field_types  type)
inlinestatic

Definition at line 307 of file qsql_mysql.cpp.

Referenced by QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qIsBlob()

static bool qIsBlob ( enum_field_types  t)
static

Definition at line 283 of file qsql_mysql.cpp.

Referenced by QMYSQLResultPrivate::bindBlobs(), and QMYSQLResultPrivate::bindInValues().

+ Here is the caller graph for this function:

◆ qIsInteger()

static bool qIsInteger ( int  t)
static

Definition at line 299 of file qsql_mysql.cpp.

Referenced by QMYSQLResultPrivate::bindInValues(), and QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qIsTimeOrDate()

static bool qIsTimeOrDate ( enum_field_types  t)
static

Definition at line 292 of file qsql_mysql.cpp.

Referenced by QMYSQLResultPrivate::bindInValues(), and QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qLibraryEnd()

static void qLibraryEnd ( )
static

Definition at line 1086 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::~QMYSQLDriver().

+ Here is the caller graph for this function:

◆ qLibraryInit()

static void qLibraryInit ( )
static

Definition at line 1070 of file qsql_mysql.cpp.

References qAddPostRoutine(), qMySqlConnectionCount, qMySqlInitHandledByUser, and qWarning.

Referenced by QMYSQLDriver::QMYSQLDriver(), and QMYSQLDriver::QMYSQLDriver().

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

◆ qMakeError()

static QSqlError qMakeError ( const QString err,
QSqlError::ErrorType  type,
const QMYSQLDriverPrivate p 
)
static

Definition at line 191 of file qsql_mysql.cpp.

References QString::fromUtf8(), and QString::number().

Referenced by QMYSQLResult::nextResult(), QMYSQLResult::prepare(), and QMYSQLResult::reset().

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

◆ qMakeStmtError()

static QSqlError qMakeStmtError ( const QString err,
QSqlError::ErrorType  type,
MYSQL_STMT *  stmt 
)
static

Definition at line 274 of file qsql_mysql.cpp.

References QString::fromLatin1(), and QString::number().

Referenced by QMYSQLResult::exec(), QMYSQLResult::fetch(), QMYSQLResult::fetchNext(), and QMYSQLResult::prepare().

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

◆ qTimeFromString()

static QVariant qTimeFromString ( const QString val)
inlinestatic

Definition at line 80 of file qsql_mysql.cpp.

References Qt::ISODate, and Q_UNUSED.

Referenced by QMYSQLResult::data().

+ Here is the caller graph for this function:

◆ qToField()

static QSqlField qToField ( MYSQL_FIELD *  field)
static

Definition at line 261 of file qsql_mysql.cpp.

References QString::fromUtf8(), and qDecodeMYSQLType().

Referenced by QMYSQLResult::record(), and QMYSQLDriver::record().

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

◆ setOptionBool()

static bool setOptionBool ( MYSQL *  mysql,
mysql_option  option,
QStringView  v 
)
static

Definition at line 1201 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ setOptionFlag()

static void setOptionFlag ( uint optionFlags,
QStringView  opt 
)
static

Definition at line 1169 of file qsql_mysql.cpp.

References opt, and qWarning.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ setOptionInt()

static bool setOptionInt ( MYSQL *  mysql,
mysql_option  option,
QStringView  v 
)
static

Definition at line 1194 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ setOptionProtocol()

static bool setOptionProtocol ( MYSQL *  mysql,
mysql_option  option,
QStringView  v 
)
static

Definition at line 1228 of file qsql_mysql.cpp.

References qWarning.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ setOptionString()

static bool setOptionString ( MYSQL *  mysql,
mysql_option  option,
QStringView  v 
)
static

Definition at line 1189 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ toMySqlDate()

static QT_MYSQL_TIME * toMySqlDate ( QDate  date,
QTime  time,
int  type 
)
static

Definition at line 835 of file qsql_mysql.cpp.

References date, QDate::day(), QTime::hour(), QT_MYSQL_TIME::hour, QTime::minute(), QDate::month(), QTime::msec(), Q_ASSERT, QTime::second(), time, and QDate::year().

Referenced by QMYSQLResult::exec().

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

Variable Documentation

◆ qMySqlConnectionCount

int qMySqlConnectionCount = 0
static

◆ qMySqlInitHandledByUser

bool qMySqlInitHandledByUser = false
static