summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/mysql
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-09-03 18:37:52 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-09-03 18:37:52 -0500
commitd8352f9db21a44c56049d6a5b2223ff888676286 (patch)
treed42d56c1dcbab9701a7ad8fac3e46f4031391aa4 /src/sql/drivers/mysql
parented5df1398ec8899bfea12d75f12a0f1474ef2258 (diff)
downloadtqt3-d8352f9db21a44c56049d6a5b2223ff888676286.tar.gz
tqt3-d8352f9db21a44c56049d6a5b2223ff888676286.zip
Automated update from Qt3
Diffstat (limited to 'src/sql/drivers/mysql')
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp17
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index aca83545f..aad846243 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -504,6 +504,8 @@ bool TQMYSQLDriver::open( const TQString& db,
optionFlags |= CLIENT_ODBC;
else if ( opt == "CLIENT_SSL" )
optionFlags |= CLIENT_SSL;
+ else if ( opt == "MYSQL_OPT_RECONNECT" )
+ optionFlags |= MYSQL_OPT_RECONNECT;
else
tqWarning( "TQMYSQLDriver::open: Unknown connect option '%s'", (*it).latin1() );
}
@@ -544,6 +546,21 @@ void TQMYSQLDriver::close()
}
}
+bool TQMYSQLDriver::ping()
+{
+ if ( !isOpen() ) {
+ return FALSE;
+ }
+
+ if (mysql_ping( d->mysql )) {
+ return TRUE;
+ }
+ else {
+ setLastError( qMakeError("Unable to execute ping", TQSqlError::Statement, d ) );
+ return FALSE;
+ }
+}
+
TQSqlQuery TQMYSQLDriver::createQuery() const
{
return TQSqlQuery( new TQMYSQLResult( this ) );
diff --git a/src/sql/drivers/mysql/qsql_mysql.h b/src/sql/drivers/mysql/qsql_mysql.h
index 6b1daef3a..e4646256d 100644
--- a/src/sql/drivers/mysql/qsql_mysql.h
+++ b/src/sql/drivers/mysql/qsql_mysql.h
@@ -100,6 +100,7 @@ public:
const TQString & host = TQString::null,
int port = -1 );
void close();
+ bool ping();
TQSqlQuery createQuery() const;
TQStringList tables( const TQString& user ) const;
TQSqlIndex primaryIndex( const TQString& tablename ) const;