aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/parser/ast
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-04-19 22:30:21 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-04-19 22:30:21 -0400
commita308f430f694423064ebc86fd0506c8c6fdb3d93 (patch)
treeceacd24fecf92f40980f8d8f3fd169e317c886af /SQLiteStudio3/coreSQLiteStudio/parser/ast
parenta5b034d4a9c44f9bc1e83b01de82530f8fc63013 (diff)
Imported Upstream version 3.0.5upstream/3.0.5
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/parser/ast')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.cpp4
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.h9
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp7
3 files changed, 13 insertions, 7 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.cpp
index 454c0e3..d21578e 100644
--- a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.cpp
@@ -640,8 +640,8 @@ SqliteCreateTable::Column::Column(const QString &name, SqliteColumnType *type, c
this->constraints.last()->type != SqliteCreateTable::Column::Constraint::NAME_ONLY)
{
SqliteCreateTable::Column::Constraint* last = this->constraints.last();
- last->deferrable = constr->deferrable;
- last->initially = constr->initially;
+ last->foreignKey->deferrable = constr->deferrable;
+ last->foreignKey->initially = constr->initially;
delete constr;
// We don't want deleted constr to be added to list. We finish this now.
diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.h b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.h
index f3be244..877d0fa 100644
--- a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.h
+++ b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitecreatetable.h
@@ -21,6 +21,8 @@ class API_EXPORT SqliteCreateTable : public SqliteQuery
public:
class API_EXPORT Constraint : public SqliteStatement
{
+ friend class Column;
+
public:
enum Type
{
@@ -70,11 +72,14 @@ class API_EXPORT SqliteCreateTable : public SqliteQuery
QString id;
QString collationName = QString::null;
SqliteForeignKey* foreignKey = nullptr;
- SqliteDeferrable deferrable = SqliteDeferrable::null;
- SqliteInitially initially = SqliteInitially::null;
protected:
TokenList rebuildTokensFromContents();
+
+ private:
+ SqliteDeferrable deferrable = SqliteDeferrable::null; // only a temporary field for parse time, before merging with actual FK
+ SqliteInitially initially = SqliteInitially::null; // only a temporary field for parse time, before merging with actual FK
+
};
typedef QSharedPointer<Constraint> ConstraintPtr;
diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp
index 1429cef..12adf80 100644
--- a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqliteexpr.cpp
@@ -65,11 +65,12 @@ QString SqliteExpr::likeOp(SqliteExpr::LikeOp value)
SqliteExpr::NotNull SqliteExpr::notNullOp(const QString &value)
{
- if (value == "ISNULL")
+ QString upper = value.toUpper();
+ if (upper == "ISNULL")
return SqliteExpr::NotNull::ISNULL;
- else if (value == "NOTNULL")
+ else if (upper == "NOTNULL")
return SqliteExpr::NotNull::NOTNULL;
- else if (value == "NOT NULL")
+ else if (upper == "NOT NULL")
return SqliteExpr::NotNull::NOT_NULL;
else
return SqliteExpr::NotNull::null;