diff options
Diffstat (limited to 'tests/auto/qsqlquery/tst_qsqlquery.cpp')
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 5ed9cfa..8fe6f2e 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -194,7 +194,6 @@ private slots: void sqlServerReturn0_data() { generic_data(); } void sqlServerReturn0(); - private: // returns all database connections void generic_data(const QString &engine=QString()); @@ -333,6 +332,8 @@ void tst_QSqlQuery::createTestTables( QSqlDatabase db ) // ### stupid workaround until we find a way to hardcode this // in the MySQL server startup script q.exec( "set table_type=innodb" ); + else if(tst_Databases::isPostgreSQL(db)) + QVERIFY_SQL( q, exec("set client_min_messages='warning'")); if(tst_Databases::isPostgreSQL(db)) QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest" ) + " (id serial NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id)) WITH OIDS" ) ); @@ -395,7 +396,7 @@ void tst_QSqlQuery::char1SelectUnicode() QSKIP("Needs someone with more Unicode knowledge than I have to fix", SkipSingle); if ( db.driver()->hasFeature( QSqlDriver::Unicode ) ) { - QString uniStr( QChar( 0xfb50 ) ); + QString uniStr( QChar( 'का' ) ); QSqlQuery q( db ); if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 ) @@ -508,9 +509,7 @@ void tst_QSqlQuery::mysqlOutValues() QVERIFY_SQL( q, exec( "create procedure " + qTableName( "qtestproc" ) + " () " "BEGIN select * from " + qTableName( "qtest" ) + " order by id; END" ) ); QVERIFY_SQL( q, exec( "call " + qTableName( "qtestproc" ) + "()" ) ); - QEXPECT_FAIL("", "There's a mysql bug that means only selects think they return data when running in prepared mode", Continue); QVERIFY_SQL( q, next() ); - QEXPECT_FAIL("", "There's a mysql bug that means only selects think they return data when running in prepared mode", Continue); QCOMPARE( q.value( 1 ).toString(), QString( "VarChar1" ) ); QVERIFY_SQL( q, exec( "drop procedure " + qTableName( "qtestproc" ) ) ); @@ -1631,8 +1630,7 @@ void tst_QSqlQuery::prepare_bind_exec() { // new scope for SQLITE - static const unsigned short utf8arr[] = { 0xfb50,0xfb60,0xfb70,0xfb80,0xfbe0,0xfbf0,0x00 }; - static const QString utf8str = QString::fromUtf16( utf8arr ); + static const QString utf8str = QString::fromUtf8( "काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥" ); static const QString values[6] = { "Harry", "Trond", "Mark", "Ma?rk", "?", ":id" }; @@ -1645,12 +1643,15 @@ void tst_QSqlQuery::prepare_bind_exec() QString createQuery; + if(tst_Databases::isPostgreSQL(db)) + QVERIFY_SQL( q, exec("set client_min_messages='warning'")); + if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( "QTDS" ) ) - createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int primary key, name nvarchar(20) null)"; - else if ( db.driverName().startsWith( "QMYSQL" ) && useUnicode ) - createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int not null primary key, name varchar(20) character set utf8)"; + createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int primary key, name nvarchar(200) null)"; + else if ( tst_Databases::isMySQL(db) && useUnicode ) + createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int not null primary key, name varchar(200) character set utf8)"; else - createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int not null primary key, name varchar(20))"; + createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int not null primary key, name varchar(200))"; QVERIFY_SQL( q, exec( createQuery ) ); |