summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-10-20 00:21:38 (GMT)
committerBill King <bill.king@nokia.com>2009-10-20 00:25:33 (GMT)
commitdfd6221d960ec8c563a687684000c3a9c4f58079 (patch)
treecbda4d719904a1f46fb7194624061ee760a34c0c /tests
parentbbbb62552b1c0f68b960c1412c66b6381e7dd4d1 (diff)
downloadQt-dfd6221d960ec8c563a687684000c3a9c4f58079.zip
Qt-dfd6221d960ec8c563a687684000c3a9c4f58079.tar.gz
Qt-dfd6221d960ec8c563a687684000c3a9c4f58079.tar.bz2
Misc mysql test fixes.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 13d68ff..82b6066 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1072,17 +1072,20 @@ void tst_QSqlDatabase::recordMySQL()
int revision = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 2, 2 ).toInt();
int vernum = (major << 16) + (minor << 8) + revision;
-#ifdef QT3_SUPPORT
/* The below is broken in mysql below 5.0.15
see http://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html
specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded
with space on insert, and trailing spaces are removed on select.
*/
if( vernum >= ((5 << 16) + 15) ) {
+#ifdef QT3_SUPPORT
bin10 = FieldDef("binary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abc ")));
varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abcv ")));
- }
+#else
+ bin10 = FieldDef("binary(10)", QVariant::ByteArray, QString("123abc "));
+ varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QString("123abcv "));
#endif
+ }
static QDateTime dt(QDate::currentDate(), QTime(1, 2, 3, 0));
static const FieldDef fieldDefs[] = {
@@ -2468,7 +2471,7 @@ void tst_QSqlDatabase::mysql_savepointtest()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 1 ).toInt()<4.1 )
+ if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 1 ).toDouble()<4.1 )
QSKIP( "Test requires MySQL >= 4.1", SkipSingle );
QSqlQuery q(db);