/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/** * Special case: * HSQLDB might define a column VARCHAR without parameter. With Firebird * dialect, this is forbidden, so a default parameter has to be appended:
**/ void HsqlSchemaImportTest::testVarcharWithoutParam()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" " "VARCHAR)");
/** * Special case: * Hsqldb might use one parameter for defining column with type TIMESTAMP. * With Firebird this is illegal.
*/ void HsqlSchemaImportTest::testTimestampWithParam()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myText\" " "TIMESTAMP(0))");
// instead of asserting parameter size, look at the deparsed string, // because it's Firebird specific
OUString fbSql = aCreateParser.compose();
CPPUNIT_ASSERT(fbSql.indexOf("0") < 0); //does not contain
}
/** * Special case: * HSQLDB uses keyword NOW without quotes. Firebird uses single quotes 'NOW'
*/ void HsqlSchemaImportTest::testDefaultValueNow()
{
FbCreateStmtParser aCreateParser;
aCreateParser.parse(
u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, \"myDate\" " "TIMESTAMP DEFAULT NOW)");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.