Skip to content

Commit 0df6148

Browse files
committed
unittest: add test for literalvalue in default constraint
1 parent f3a2a74 commit 0df6148

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tests/testsqlobjects.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void TestTable::parseSQLdefaultexpr()
109109
QString sSQL = "CREATE TABLE chtest(\n"
110110
"id integer primary key,\n"
111111
"dumpytext text default('axa') CHECK(dumpytext == \"aa\"),\n"
112+
"date datetime default CURRENT_TIMESTAMP,"
112113
"zoi integer)";
113114

114115
Table tab = Table::parseSQL(sSQL);
@@ -126,6 +127,8 @@ void TestTable::parseSQLdefaultexpr()
126127
QCOMPARE(tab.fields().at(1)->check(), QString("dumpytext == \"aa\""));
127128
QCOMPARE(tab.fields().at(2)->defaultValue(), QString(""));
128129
QCOMPARE(tab.fields().at(2)->check(), QString(""));
130+
QCOMPARE(tab.fields().at(3)->defaultValue(), QString("CURRENT_TIMESTAMP"));
131+
QCOMPARE(tab.fields().at(3)->check(), QString(""));
129132

130133
QVERIFY(tab.fields().at(0)->primaryKey());
131134
}

0 commit comments

Comments
 (0)