summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/drivers/mySQL
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/kexidb/drivers/mySQL')
-rw-r--r--kexi/kexidb/drivers/mySQL/mySQL.pro6
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlconnection.cpp44
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlconnection.h27
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp38
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlconnection_p.h14
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlcursor.cpp32
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlcursor.h12
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqldriver.cpp54
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqldriver.h17
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp8
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp8
-rw-r--r--kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h2
12 files changed, 132 insertions, 130 deletions
diff --git a/kexi/kexidb/drivers/mySQL/mySQL.pro b/kexi/kexidb/drivers/mySQL/mySQL.pro
index cc6eddd6..6c443be3 100644
--- a/kexi/kexidb/drivers/mySQL/mySQL.pro
+++ b/kexi/kexidb/drivers/mySQL/mySQL.pro
@@ -2,11 +2,11 @@ include( ../common.pro )
INCLUDEPATH += $(MYSQL_INC) $(MYSQL_INC)/mysql
-contains(CONFIG,debug) {
+tqcontains(CONFIG,debug) {
win32:LIBS += $(MYSQL_LIB)/debug/libmysql.lib
win32:QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMTD.LIB
}
-!contains(CONFIG,debug) {
+!tqcontains(CONFIG,debug) {
# win32:LIBS += $(MYSQL_LIB)/opt/mysqlclient.lib
win32:LIBS += $(MYSQL_LIB)/opt/libmysql.lib
# win32:QMAKE_LFLAGS += /NODEFAULTLIB:MSVCRT.LIB
@@ -14,7 +14,7 @@ contains(CONFIG,debug) {
TARGET = kexidb_mysqldriver$$KDELIBDEBUG
-system( bash kmoc )
+system( bash ktqmoc )
SOURCES = \
mysqlconnection_p.cpp \
diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
index 7417b698..18682a4f 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp
@@ -20,10 +20,10 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
-#include <qvariant.h>
-#include <qfile.h>
-#include <qdict.h>
-#include <qregexp.h>
+#include <tqvariant.h>
+#include <tqfile.h>
+#include <tqdict.h>
+#include <tqregexp.h>
#include <kgenericfactory.h>
#include <kdebug.h>
@@ -68,9 +68,9 @@ bool MySqlConnection::drv_connect(KexiDB::ServerVersionInfo& version)
version.release = v - version.major*10000 - version.minor*100;
#else //better way to get the version info: use 'version' built-in variable:
//! @todo this is hardcoded for now; define api for retrieving variables and use this API...
- QString versionString;
+ TQString versionString;
const tristate res = querySingleString("SELECT @@version", versionString, /*column*/0, false /*!addLimitTo1*/);
- QRegExp versionRe("(\\d+)\\.(\\d+)\\.(\\d+)");
+ TQRegExp versionRe("(\\d+)\\.(\\d+)\\.(\\d+)");
if (res==true && versionRe.exactMatch(versionString)) { // (if querySingleString failed, the version will be 0.0.0...
version.major = versionRe.cap(1).toInt();
version.minor = versionRe.cap(2).toInt();
@@ -84,7 +84,7 @@ bool MySqlConnection::drv_disconnect() {
return d->db_disconnect();
}
-Cursor* MySqlConnection::prepareQuery(const QString& statement, uint cursor_options) {
+Cursor* MySqlConnection::prepareQuery(const TQString& statement, uint cursor_options) {
return new MySqlCursor(this,statement,cursor_options);
}
@@ -92,7 +92,7 @@ Cursor* MySqlConnection::prepareQuery( QuerySchema& query, uint cursor_options )
return new MySqlCursor( this, query, cursor_options );
}
-bool MySqlConnection::drv_getDatabasesList( QStringList &list ) {
+bool MySqlConnection::drv_getDatabasesList( TQStringList &list ) {
KexiDBDrvDbg << "MySqlConnection::drv_getDatabasesList()" << endl;
list.clear();
MYSQL_RES *res;
@@ -100,7 +100,7 @@ bool MySqlConnection::drv_getDatabasesList( QStringList &list ) {
if((res=mysql_list_dbs(d->mysql,0)) != 0) {
MYSQL_ROW row;
while ( (row = mysql_fetch_row(res))!=0) {
- list<<QString(row[0]);
+ list<<TQString(row[0]);
}
mysql_free_result(res);
return true;
@@ -111,7 +111,7 @@ bool MySqlConnection::drv_getDatabasesList( QStringList &list ) {
return false;
}
-bool MySqlConnection::drv_createDatabase( const QString &dbName) {
+bool MySqlConnection::drv_createDatabase( const TQString &dbName) {
KexiDBDrvDbg << "MySqlConnection::drv_createDatabase: " << dbName << endl;
// mysql_create_db deprecated, use SQL here.
if (drv_executeSQL("CREATE DATABASE " + (dbName)))
@@ -120,7 +120,7 @@ bool MySqlConnection::drv_createDatabase( const QString &dbName) {
return false;
}
-bool MySqlConnection::drv_useDatabase(const QString &dbName, bool *cancelled, MessageHandler* msgHandler)
+bool MySqlConnection::drv_useDatabase(const TQString &dbName, bool *cancelled, MessageHandler* msgHandler)
{
Q_UNUSED(cancelled);
Q_UNUSED(msgHandler);
@@ -134,19 +134,19 @@ bool MySqlConnection::drv_closeDatabase() {
return true;
}
-bool MySqlConnection::drv_dropDatabase( const QString &dbName) {
+bool MySqlConnection::drv_dropDatabase( const TQString &dbName) {
//TODO is here escaping needed
return drv_executeSQL("drop database "+dbName);
}
-bool MySqlConnection::drv_executeSQL( const QString& statement ) {
+bool MySqlConnection::drv_executeSQL( const TQString& statement ) {
return d->executeSQL(statement);
}
-Q_ULLONG MySqlConnection::drv_lastInsertRowID()
+TQ_ULLONG MySqlConnection::drv_lastInsertRowID()
{
//! @todo
- return (Q_ULLONG)mysql_insert_id(d->mysql);
+ return (TQ_ULLONG)mysql_insert_id(d->mysql);
}
int MySqlConnection::serverResult()
@@ -154,9 +154,9 @@ int MySqlConnection::serverResult()
return d->res;
}
-QString MySqlConnection::serverResultName()
+TQString MySqlConnection::serverResultName()
{
- return QString::null;
+ return TQString();
}
void MySqlConnection::drv_clearServerResult()
@@ -166,19 +166,19 @@ void MySqlConnection::drv_clearServerResult()
d->res = 0;
}
-QString MySqlConnection::serverErrorMsg()
+TQString MySqlConnection::serverErrorMsg()
{
return d->errmsg;
}
-bool MySqlConnection::drv_containsTable( const QString &tableName )
+bool MySqlConnection::drv_containsTable( const TQString &tableName )
{
bool success;
- return resultExists(QString("show tables like %1")
- .arg(driver()->escapeString(tableName)), success) && success;
+ return resultExists(TQString("show tables like %1")
+ .tqarg(driver()->escapeString(tableName)), success) && success;
}
-bool MySqlConnection::drv_getTablesList( QStringList &list )
+bool MySqlConnection::drv_getTablesList( TQStringList &list )
{
KexiDB::Cursor *cursor;
m_sql = "show tables";
diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection.h b/kexi/kexidb/drivers/mySQL/mysqlconnection.h
index bafb889d..e0fb4382 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlconnection.h
+++ b/kexi/kexidb/drivers/mySQL/mysqlconnection.h
@@ -22,11 +22,11 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#ifndef MYSQLCONNECTION_H
#define MYSQLCONNECTION_H
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kexidb/connection.h>
#include "mysqlcursor.h"
-#include <qdict.h>
+#include <tqdict.h>
namespace KexiDB {
@@ -40,11 +40,12 @@ class MySqlConnectionInternal;
class MySqlConnection : public Connection
{
Q_OBJECT
+ TQ_OBJECT
public:
virtual ~MySqlConnection();
- virtual Cursor* prepareQuery( const QString& statement = QString::null, uint cursor_options = 0 );
+ virtual Cursor* prepareQuery( const TQString& statement = TQString(), uint cursor_options = 0 );
virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 );
virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type,
@@ -57,24 +58,24 @@ class MySqlConnection : public Connection
virtual bool drv_connect(KexiDB::ServerVersionInfo& version);
virtual bool drv_disconnect();
- virtual bool drv_getDatabasesList( QStringList &list );
- virtual bool drv_createDatabase( const QString &dbName = QString::null );
- virtual bool drv_useDatabase( const QString &dbName = QString::null, bool *cancelled = 0,
+ virtual bool drv_getDatabasesList( TQStringList &list );
+ virtual bool drv_createDatabase( const TQString &dbName = TQString() );
+ virtual bool drv_useDatabase( const TQString &dbName = TQString(), bool *cancelled = 0,
MessageHandler* msgHandler = 0 );
virtual bool drv_closeDatabase();
- virtual bool drv_dropDatabase( const QString &dbName = QString::null );
- virtual bool drv_executeSQL( const QString& statement );
- virtual Q_ULLONG drv_lastInsertRowID();
+ virtual bool drv_dropDatabase( const TQString &dbName = TQString() );
+ virtual bool drv_executeSQL( const TQString& statement );
+ virtual TQ_ULLONG drv_lastInsertRowID();
virtual int serverResult();
- virtual QString serverResultName();
- virtual QString serverErrorMsg();
+ virtual TQString serverResultName();
+ virtual TQString serverErrorMsg();
virtual void drv_clearServerResult();
//TODO: move this somewhere to low level class (MIGRATION?)
- virtual bool drv_getTablesList( QStringList &list );
+ virtual bool drv_getTablesList( TQStringList &list );
//TODO: move this somewhere to low level class (MIGRATION?)
- virtual bool drv_containsTable( const QString &tableName );
+ virtual bool drv_containsTable( const TQString &tableName );
MySqlConnectionInternal* d;
diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp
index 9797ca96..50b94ae2 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp
@@ -18,10 +18,10 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
-#include <qcstring.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qfile.h>
+#include <tqcstring.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
#include <kdebug.h>
@@ -67,37 +67,37 @@ void MySqlConnectionInternal::storeResult()
none is specified). If the server is on a remote machine, then a port is
the port that the remote server is listening on.
*/
-//bool MySqlConnectionInternal::db_connect(QCString host, QCString user,
-// QCString password, unsigned short int port, QString socket)
+//bool MySqlConnectionInternal::db_connect(TQCString host, TQCString user,
+// TQCString password, unsigned short int port, TQString socket)
bool MySqlConnectionInternal::db_connect(const KexiDB::ConnectionData& data)
{
if (!(mysql = mysql_init(mysql)))
return false;
KexiDBDrvDbg << "MySqlConnectionInternal::connect()" << endl;
- QCString localSocket;
- QString hostName = data.hostName;
+ TQCString localSocket;
+ TQString hostName = data.hostName;
if (hostName.isEmpty() || hostName.lower()=="localhost") {
if (data.useLocalSocketFile) {
if (data.localSocketFileName.isEmpty()) {
//! @todo move the list of default sockets to a generic method
- QStringList sockets;
- #ifndef Q_WS_WIN
+ TQStringList sockets;
+ #ifndef TQ_WS_WIN
sockets.append("/var/lib/mysql/mysql.sock");
sockets.append("/var/run/mysqld/mysqld.sock");
sockets.append("/tmp/mysql.sock");
- for(QStringList::ConstIterator it = sockets.constBegin(); it != sockets.constEnd(); it++)
+ for(TQStringList::ConstIterator it = sockets.constBegin(); it != sockets.constEnd(); it++)
{
- if(QFile(*it).exists()) {
- localSocket = ((QString)(*it)).local8Bit();
+ if(TQFile(*it).exists()) {
+ localSocket = ((TQString)(*it)).local8Bit();
break;
}
}
#endif
}
else
- localSocket = QFile::encodeName(data.localSocketFileName);
+ localSocket = TQFile::encodeName(data.localSocketFileName);
}
else {
//we're not using local socket
@@ -131,17 +131,17 @@ bool MySqlConnectionInternal::db_disconnect()
/* ************************************************************************** */
/*! Selects dbName as the active database so it can be used.
*/
-bool MySqlConnectionInternal::useDatabase(const QString &dbName) {
+bool MySqlConnectionInternal::useDatabase(const TQString &dbName) {
//TODO is here escaping needed?
return executeSQL("USE " + dbName);
}
/*! Executes the given SQL statement on the server.
*/
-bool MySqlConnectionInternal::executeSQL(const QString& statement) {
+bool MySqlConnectionInternal::executeSQL(const TQString& statement) {
// KexiDBDrvDbg << "MySqlConnectionInternal::executeSQL: "
// << statement << endl;
- QCString queryStr=statement.utf8();
+ TQCString queryStr=statement.utf8();
const char *query=queryStr;
if(mysql_real_query(mysql, query, strlen(query)) == 0)
{
@@ -153,8 +153,8 @@ bool MySqlConnectionInternal::executeSQL(const QString& statement) {
return false;
}
-QString MySqlConnectionInternal::escapeIdentifier(const QString& str) const {
- return QString(str).replace('`', "'");
+TQString MySqlConnectionInternal::escapeIdentifier(const TQString& str) const {
+ return TQString(str).tqreplace('`', "'");
}
//--------------------------------------
diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h
index 5bb77487..85d8c57b 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h
+++ b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h
@@ -22,7 +22,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#include <kexidb/connection_p.h>
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
#include <my_global.h>
#endif
#include <mysql_version.h>
@@ -31,8 +31,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
typedef struct st_mysql MYSQL;
#undef bool
-class QCString;
-class QString;
+class TQCString;
+class TQString;
#ifdef MYSQLMIGRATE_H
#define NAMESPACE KexiMigration
@@ -64,20 +64,20 @@ class MySqlConnectionInternal : public KexiDB::ConnectionInternal
bool db_disconnect();
//! Selects a database that is about to be used
- bool useDatabase(const QString &dbName = QString::null);
+ bool useDatabase(const TQString &dbName = TQString());
//! Execute SQL statement on the database
- bool executeSQL( const QString& statement );
+ bool executeSQL( const TQString& statement );
//! Stores last operation's result
virtual void storeResult();
//! Escapes a table, database or column name
- QString escapeIdentifier(const QString& str) const;
+ TQString escapeIdentifier(const TQString& str) const;
MYSQL *mysql;
bool mysql_owned; //!< true if mysql pointer should be freed on destruction
- QString errmsg; //!< server-specific message of last operation
+ TQString errmsg; //!< server-specific message of last operation
int res; //!< result code of last operation on server
};
diff --git a/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp b/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp
index 7897fa97..abfdb44f 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp
@@ -31,7 +31,7 @@
using namespace KexiDB;
-MySqlCursor::MySqlCursor(KexiDB::Connection* conn, const QString& statement, uint cursor_options)
+MySqlCursor::MySqlCursor(KexiDB::Connection* conn, const TQString& statement, uint cursor_options)
: Cursor(conn,statement,cursor_options)
, d( new MySqlCursorData(conn) )
{
@@ -72,7 +72,7 @@ bool MySqlCursor::drv_open() {
}
}
- setError(ERR_DB_SPECIFIC,QString::fromUtf8(mysql_error(d->mysql)));
+ setError(ERR_DB_SPECIFIC,TQString::fromUtf8(mysql_error(d->mysql)));
return false;
}
@@ -106,9 +106,9 @@ void MySqlCursor::drv_getNextRecord() {
}
// This isn't going to work right now as it uses d->mysqlrow
-QVariant MySqlCursor::value(uint pos) {
+TQVariant MySqlCursor::value(uint pos) {
if (!d->mysqlrow || pos>=m_fieldCount || d->mysqlrow[pos]==0)
- return QVariant();
+ return TQVariant();
KexiDB::Field *f = (m_fieldsExpanded && pos<m_fieldsExpanded->count())
? m_fieldsExpanded->at(pos)->field : 0;
@@ -119,20 +119,20 @@ QVariant MySqlCursor::value(uint pos) {
/* moved to cstringToVariant()
//from most to least frequently used types:
if (!f || f->isTextType())
- return QVariant( QString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]) );
+ return TQVariant( TQString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]) );
else if (f->isIntegerType())
//! @todo support BigInteger
- return QVariant( QCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toInt() );
+ return TQVariant( TQCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toInt() );
else if (f->isFPNumericType())
- return QVariant( QCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toDouble() );
+ return TQVariant( TQCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toDouble() );
//default
- return QVariant(QString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]));*/
+ return TQVariant(TQString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]));*/
}
/* As with sqlite, the DB library returns all values (including numbers) as
- strings. So just put that string in a QVariant and let KexiDB deal with it.
+ strings. So just put that string in a TQVariant and let KexiDB deal with it.
*/
void MySqlCursor::storeCurrentRow(RowData &data) const
{
@@ -145,7 +145,7 @@ void MySqlCursor::storeCurrentRow(RowData &data) const
data.resize(m_fieldCount);
const uint fieldsExpandedCount = m_fieldsExpanded ? m_fieldsExpanded->count() : UINT_MAX;
- const uint realCount = QMIN(fieldsExpandedCount, m_fieldCount);
+ const uint realCount = TQMIN(fieldsExpandedCount, m_fieldCount);
for( uint i=0; i<realCount; i++) {
Field *f = m_fieldsExpanded ? m_fieldsExpanded->at(i)->field : 0;
if (m_fieldsExpanded && !f)
@@ -153,7 +153,7 @@ void MySqlCursor::storeCurrentRow(RowData &data) const
data[i] = KexiDB::cstringToVariant(d->mysqlrow[i], f, d->lengths[i]);
/* moved to cstringToVariant()
if (f && f->type()==Field::BLOB) {
- QByteArray ba;
+ TQByteArray ba;
ba.duplicate(d->mysqlrow[i], d->lengths[i]);
data[i] = ba;
KexiDBDbg << data[i].toByteArray().size() << endl;
@@ -161,7 +161,7 @@ void MySqlCursor::storeCurrentRow(RowData &data) const
//! @todo more types!
//! @todo look at what type mysql declares!
else {
- data[i] = QVariant(QString::fromUtf8((const char*)d->mysqlrow[i], d->lengths[i]));
+ data[i] = TQVariant(TQString::fromUtf8((const char*)d->mysqlrow[i], d->lengths[i]));
}*/
}
}
@@ -183,7 +183,7 @@ void MySqlCursor::drv_bufferMovePointerPrev() {
}
-void MySqlCursor::drv_bufferMovePointerTo(Q_LLONG to) {
+void MySqlCursor::drv_bufferMovePointerTo(TQ_LLONG to) {
//MYSQL_ROW_OFFSET ro=mysql_row_tell(d->mysqlres);
mysql_data_seek(d->mysqlres, to);
d->mysqlrow=mysql_fetch_row(d->mysqlres);
@@ -200,9 +200,9 @@ int MySqlCursor::serverResult()
return d->res;
}
-QString MySqlCursor::serverResultName()
+TQString MySqlCursor::serverResultName()
{
- return QString::null;
+ return TQString();
}
void MySqlCursor::drv_clearServerResult()
@@ -212,7 +212,7 @@ void MySqlCursor::drv_clearServerResult()
d->res = 0;
}
-QString MySqlCursor::serverErrorMsg()
+TQString MySqlCursor::serverErrorMsg()
{
return d->errmsg;
}
diff --git a/kexi/kexidb/drivers/mySQL/mysqlcursor.h b/kexi/kexidb/drivers/mySQL/mysqlcursor.h
index 09ace22b..4f48d602 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlcursor.h
+++ b/kexi/kexidb/drivers/mySQL/mysqlcursor.h
@@ -29,7 +29,7 @@ class MySqlCursorData;
class MySqlCursor: public Cursor {
public:
- MySqlCursor(Connection* conn, const QString& statement = QString::null, uint cursor_options = NoOptions );
+ MySqlCursor(Connection* conn, const TQString& statement = TQString(), uint cursor_options = NoOptions );
MySqlCursor(Connection* conn, QuerySchema& query, uint options = NoOptions );
virtual ~MySqlCursor();
virtual bool drv_open();
@@ -37,23 +37,23 @@ public:
// virtual bool drv_moveFirst();
virtual void drv_getNextRecord();
//virtual bool drv_getPrevRecord();
- virtual QVariant value(uint);
+ virtual TQVariant value(uint);
virtual void drv_clearServerResult();
virtual void drv_appendCurrentRecordToBuffer();
virtual void drv_bufferMovePointerNext();
virtual void drv_bufferMovePointerPrev();
- virtual void drv_bufferMovePointerTo(Q_LLONG to);
+ virtual void drv_bufferMovePointerTo(TQ_LLONG to);
virtual const char** rowData() const;
virtual void storeCurrentRow(RowData &data) const;
// virtual bool save(RowData& data, RowEditBuffer& buf);
virtual int serverResult();
- virtual QString serverResultName();
- virtual QString serverErrorMsg();
+ virtual TQString serverResultName();
+ virtual TQString serverErrorMsg();
protected:
- QVariant pValue(uint pos) const;
+ TQVariant pValue(uint pos) const;
// MYSQL_RES *m_res;
// MYSQL_ROW m_row;
// MYSQL *my_conn;
diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp
index c27681c0..9a1213b0 100644
--- a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp
@@ -19,16 +19,16 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
# include <mysql/config-win.h>
#endif
#include <mysql_version.h>
#include <mysql.h>
#define BOOL bool
-#include <qvariant.h>
-#include <qfile.h>
-#include <qdict.h>
+#include <tqvariant.h>
+#include <tqfile.h>
+#include <tqdict.h>
#include <kgenericfactory.h>
#include <kdebug.h>
@@ -54,7 +54,7 @@ KEXIDB_DRIVER_INFO( MySqlDriver, mysql )
*
* See: http://dev.mysql.com/doc/mysql/en/Column_types.html
*/
-MySqlDriver::MySqlDriver(QObject *parent, const char *name, const QStringList &args) : Driver(parent, name,args)
+MySqlDriver::MySqlDriver(TQObject *tqparent, const char *name, const TQStringList &args) : Driver(tqparent, name,args)
{
// KexiDBDrvDbg << "MySqlDriver::MySqlDriver()" << endl;
@@ -63,9 +63,9 @@ MySqlDriver::MySqlDriver(QObject *parent, const char *name, const QStringList &a
beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()";
beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true;
- beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false;
- beh->USING_DATABASE_REQUIRED_TO_CONNECT=false;
- beh->QUOTATION_MARKS_FOR_IDENTIFIER='`';
+ beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false;
+ beh->USING_DATABASE_RETQUIRED_TO_CONNECT=false;
+ beh->TQUOTATION_MARKS_FOR_IDENTIFIER='`';
beh->SQL_KEYWORDS = keywords;
initSQLKeywords(331);
@@ -103,16 +103,16 @@ MySqlDriver::drv_createConnection( ConnectionData &conn_data )
return new MySqlConnection( this, conn_data );
}
-bool MySqlDriver::isSystemDatabaseName(const QString &n) const
+bool MySqlDriver::isSystemDatabaseName(const TQString &n) const
{
return n.lower()=="mysql" || Driver::isSystemObjectName(n);
}
-bool MySqlDriver::drv_isSystemFieldName(const QString&) const {
+bool MySqlDriver::drv_isSystemFieldName(const TQString&) const {
return false;
}
-QString MySqlDriver::escapeString(const QString& str) const
+TQString MySqlDriver::escapeString(const TQString& str) const
{
//escape as in http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html
//! @todo support more characters, like %, _
@@ -120,20 +120,20 @@ QString MySqlDriver::escapeString(const QString& str) const
const int old_length = str.length();
int i;
for ( i = 0; i < old_length; i++ ) { //anything to escape?
- const unsigned int ch = str[i].unicode();
+ const unsigned int ch = str[i].tqunicode();
if (ch == '\\' || ch == '\'' || ch == '"' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\b' || ch == '\0')
break;
}
if (i >= old_length) { //no characters to escape
- return QString::fromLatin1("'") + str + QString::fromLatin1("'");
+ return TQString::tqfromLatin1("'") + str + TQString::tqfromLatin1("'");
}
- QChar *new_string = new QChar[ old_length * 3 + 1 ]; // a worst case approximation
+ TQChar *new_string = new TQChar[ old_length * 3 + 1 ]; // a worst case approximation
//! @todo move new_string to Driver::m_new_string or so...
int new_length = 0;
new_string[new_length++] = '\''; //prepend '
for ( i = 0; i < old_length; i++, new_length++ ) {
- const unsigned int ch = str[i].unicode();
+ const unsigned int ch = str[i].tqunicode();
if (ch == '\\') {
new_string[new_length++] = '\\';
new_string[new_length] = '\\';
@@ -175,37 +175,37 @@ QString MySqlDriver::escapeString(const QString& str) const
}
new_string[new_length++] = '\''; //append '
- QString result(new_string, new_length);
+ TQString result(new_string, new_length);
delete [] new_string;
return result;
}
-QString MySqlDriver::escapeBLOB(const QByteArray& array) const
+TQString MySqlDriver::escapeBLOB(const TQByteArray& array) const
{
return KexiDB::escapeBLOB(array, KexiDB::BLOBEscape0xHex);
}
-QCString MySqlDriver::escapeString(const QCString& str) const
+TQCString MySqlDriver::escapeString(const TQCString& str) const
{
//! @todo optimize using mysql_real_escape_string()?
//! see http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html
- return QCString("'")+QCString(str)
- .replace( '\\', "\\\\" )
- .replace( '\'', "\\''" )
- .replace( '"', "\\\"" )
- + QCString("'");
+ return TQCString("'")+TQCString(str)
+ .tqreplace( '\\', "\\\\" )
+ .tqreplace( '\'', "\\''" )
+ .tqreplace( '"', "\\\"" )
+ + TQCString("'");
}
/*! Add back-ticks to an identifier, and replace any back-ticks within
* the name with single quotes.
*/
-QString MySqlDriver::drv_escapeIdentifier( const QString& str) const {
- return QString(str).replace('`', "'");
+TQString MySqlDriver::drv_escapeIdentifier( const TQString& str) const {
+ return TQString(str).tqreplace('`', "'");
}
-QCString MySqlDriver::drv_escapeIdentifier( const QCString& str) const {
- return QCString(str).replace('`', "'");
+TQCString MySqlDriver::drv_escapeIdentifier( const TQCString& str) const {
+ return TQCString(str).tqreplace('`', "'");
}
#include "mysqldriver.moc"
diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.h b/kexi/kexidb/drivers/mySQL/mysqldriver.h
index 8282e215..7e6d5a35 100644
--- a/kexi/kexidb/drivers/mySQL/mysqldriver.h
+++ b/kexi/kexidb/drivers/mySQL/mysqldriver.h
@@ -30,26 +30,27 @@ namespace KexiDB {
class MySqlDriver : public Driver
{
Q_OBJECT
+ TQ_OBJECT
KEXIDB_DRIVER
public:
- MySqlDriver(QObject *parent, const char *name, const QStringList &args=QStringList());
+ MySqlDriver(TQObject *tqparent, const char *name, const TQStringList &args=TQStringList());
virtual ~MySqlDriver();
- virtual bool isSystemDatabaseName( const QString &n ) const;
+ virtual bool isSystemDatabaseName( const TQString &n ) const;
//! Escape a string for use as a value
- virtual QString escapeString(const QString& str) const;
- virtual QCString escapeString(const QCString& str) const;
+ virtual TQString escapeString(const TQString& str) const;
+ virtual TQCString escapeString(const TQCString& str) const;
//! Escape BLOB value \a array
- virtual QString escapeBLOB(const QByteArray& array) const;
+ virtual TQString escapeBLOB(const TQByteArray& array) const;
protected:
- virtual QString drv_escapeIdentifier( const QString& str) const;
- virtual QCString drv_escapeIdentifier( const QCString& str) const;
+ virtual TQString drv_escapeIdentifier( const TQString& str) const;
+ virtual TQCString drv_escapeIdentifier( const TQCString& str) const;
virtual Connection *drv_createConnection( ConnectionData &conn_data );
- virtual bool drv_isSystemFieldName( const QString& n ) const;
+ virtual bool drv_isSystemFieldName( const TQString& n ) const;
private:
static const char *keywords[];
diff --git a/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp b/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp
index e06adb5e..89dd8d77 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp
@@ -177,7 +177,7 @@ namespace KexiDB {
"MASTER_SSL_KEY",
"MASTER_USER",
"MAX_CONNECTIONS_PER_HOUR",
- "MAX_QUERIES_PER_HOUR",
+ "MAX_TQUERIES_PER_HOUR",
"MAX_ROWS",
"MAX_UPDATES_PER_HOUR",
"MEDIUM",
@@ -229,8 +229,8 @@ namespace KexiDB {
"PROCESS",
"PROCESSLIST",
"PURGE",
- "QUERY",
- "QUICK",
+ "TQUERY",
+ "TQUICK",
"RAID0",
"RAID_CHUNKS",
"RAID_CHUNKSIZE",
@@ -246,7 +246,7 @@ namespace KexiDB {
"REPAIR",
"REPEATABLE",
"REPLICATION",
- "REQUIRE",
+ "RETQUIRE",
"RESET",
"RESTORE",
"RETURNS",
diff --git a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp
index 2702626a..7b245d9a 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp
+++ b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp
@@ -143,7 +143,7 @@ bool MySqlPreparedStatement::execute()
else
assert(0); //impl. error
- for (QValueListConstIterator<QVariant> it = m_args.constBegin();
+ for (TQValueListConstIterator<TQVariant> it = m_args.constBegin();
(field = itFields.current()) && arg < m_realParamCount; ++it, ++itFields, arg++)
{
if (it==m_args.constEnd() || (*it).isNull()) {//no value to bind or the value is null: bind NULL
@@ -201,7 +201,7 @@ m_stringBuffer[ 1024 ]; ???
{
//! @todo what about unsigned > LLONG_MAX ?
bool ok;
- Q_LLONG value = (*it).toLongLong(&ok);
+ TQ_LLONG value = (*it).toLongLong(&ok);
if (ok) {
res = sqlite3_bind_int64(prepared_st_handle, arg, value);
if (SQLITE_OK != res) {
@@ -220,7 +220,7 @@ m_stringBuffer[ 1024 ]; ???
}
case KexiDB::Field::Boolean:
res = sqlite3_bind_text(prepared_st_handle, arg,
- QString::number((*it).toBool() ? 1 : 0).latin1(),
+ TQString::number((*it).toBool() ? 1 : 0).latin1(),
1, SQLITE_TRANSIENT /*??*/);
if (SQLITE_OK != res) {
//! @todo msg?
@@ -256,7 +256,7 @@ m_stringBuffer[ 1024 ]; ???
break;
case KexiDB::Field::BLOB:
{
- const QByteArray byteArray((*it).toByteArray());
+ const TQByteArray byteArray((*it).toByteArray());
res = sqlite3_bind_blob(prepared_st_handle, arg,
(const char*)byteArray, byteArray.size(), SQLITE_TRANSIENT /*??*/);
if (SQLITE_OK != res) {
diff --git a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h
index 01478e9e..14601a8b 100644
--- a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h
+++ b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h
@@ -39,7 +39,7 @@ class MySqlPreparedStatement : public PreparedStatement, public MySqlConnectionI
virtual bool execute();
- QCString m_tempStatementString;
+ TQCString m_tempStatementString;
#ifdef KEXI_USE_MYSQL_STMT
int m_realParamCount;