Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsql_mysql.cpp File Reference

(d99d355e4913eed78f7db3c78b19b9af4da02043)

#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 <qloggingcategory.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qsqlquery.h>
#include <qsqlrecord.h>
#include <qstringlist.h>
#include <qtimezone.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 void setUtcTimeZone (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 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 41 of file qsql_mysql.cpp.

Function Documentation

◆ checkPreparedQueries()

static bool checkPreparedQueries ( MYSQL * mysql)
inlinestatic

Definition at line 118 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 72 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 96 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 550 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 223 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 328 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 304 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 320 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 313 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 1102 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 1086 of file qsql_mysql.cpp.

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

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 213 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 295 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 84 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 283 of file qsql_mysql.cpp.

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

Referenced by QMYSQLResult::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 1219 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 1185 of file qsql_mysql.cpp.

References opt, qCWarning, and qUtf16Printable.

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 1212 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 1247 of file qsql_mysql.cpp.

References qCWarning, and qUtf16Printable.

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 1207 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

◆ setUtcTimeZone()

static void setUtcTimeZone ( MYSQL * mysql)
inlinestatic

Definition at line 132 of file qsql_mysql.cpp.

Referenced by QMYSQLDriver::open().

+ Here is the caller graph for this function:

Variable Documentation

◆ qMySqlConnectionCount

int qMySqlConnectionCount = 0
static

◆ qMySqlInitHandledByUser

bool qMySqlInitHandledByUser = false
static