summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2010-04-07 05:42:36 (GMT)
committerBill King <bill.king@nokia.com>2010-04-07 05:42:36 (GMT)
commitddd1e4aefcb8e52125656588b0bb76ec246b5d29 (patch)
tree29e1feed857032beaadc1512665e9255bbf7d37a /tests
parentccda3100c7a0487d314fb58ba315f06b1b40af9c (diff)
downloadQt-ddd1e4aefcb8e52125656588b0bb76ec246b5d29.zip
Qt-ddd1e4aefcb8e52125656588b0bb76ec246b5d29.tar.gz
Qt-ddd1e4aefcb8e52125656588b0bb76ec246b5d29.tar.bz2
Fix test sql for sql server.
Sql server requires explicitly setting fields to be nullable.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
index 8a084bb..38e5387 100644
--- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -181,7 +181,11 @@ void tst_QSqlTableModel::createTestTables()
QVERIFY_SQL( q, exec("create table " + test3 + "(id int, random varchar(20), randomtwo varchar(20))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50), column3 varchar(50))"));
+ if(!tst_Databases::isSqlServer(db))
+ QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50), column3 varchar(50))"));
+ else
+ QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50) NULL, column3 varchar(50))"));
+
QVERIFY_SQL( q, exec("create table " + qTableName("emptytable", __FILE__) + "(id int)"));