aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/parser/ast
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2014-12-14 08:24:32 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2014-12-14 08:24:32 -0500
commite571839e140139a6a819077e94cf8cc01c13b29f (patch)
tree8263635257cfb5ed979a584a958103b700bf31e7 /SQLiteStudio3/coreSQLiteStudio/parser/ast
parent407eac41f46936e3f346bb5a964a682e578b4237 (diff)
parent89214766d8e3e7b8dd749a1fa18a5b9727f5010d (diff)
Merge tag 'upstream/3.0.0'
Upstream version 3.0.0 # gpg: Signature made Sun 14 Dec 2014 08:24:31 AM EST using RSA key ID EBE9BD91 # gpg: Good signature from "Unit 193 <unit193@gmail.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.org>" # gpg: aka "Unit 193 <unit193@ubuntu.com>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/parser/ast')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitestatement.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitestatement.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitestatement.cpp
index 482baf8..f14273d 100644
--- a/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitestatement.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/parser/ast/sqlitestatement.cpp
@@ -358,7 +358,9 @@ TokenPtr SqliteStatement::getDbTokenFromNmDbnm(const QString &tokensMapKey1, con
// if (tokensMap[tokensMapKey2].size() == 0)
// return TokenPtr();
- if (!tokensMap.contains("DOT") && tokensMap[tokensMapKey2].size() == 0)
+ TokenList listForKey1 = extractPrintableTokens(tokensMap[tokensMapKey1]);
+ TokenList listForKey2 = extractPrintableTokens(tokensMap[tokensMapKey2]);
+ if (!tokensMap.contains("DOT") && listForKey2.size() == 0)
{
// In this case the query is "SELECT * FROM test" and there is no database,
// but if there was a dot after the "test", then the "test" is a database name,
@@ -366,7 +368,7 @@ TokenPtr SqliteStatement::getDbTokenFromNmDbnm(const QString &tokensMapKey1, con
return TokenPtr();
}
- return extractPrintableTokens(tokensMap[tokensMapKey1])[0];
+ return extractPrintableTokens(listForKey1)[0];
}
TokenPtr SqliteStatement::getObjectTokenFromNmDbnm(const QString &tokensMapKey1, const QString &tokensMapKey2)
@@ -383,10 +385,12 @@ TokenPtr SqliteStatement::getObjectTokenFromNmDbnm(const QString &tokensMapKey1,
return TokenPtr();
}
- if (tokensMap[tokensMapKey2].size() == 0)
- return extractPrintableTokens(tokensMap[tokensMapKey1])[0];
+ TokenList listForKey1 = extractPrintableTokens(tokensMap[tokensMapKey1]);
+ TokenList listForKey2 = extractPrintableTokens(tokensMap[tokensMapKey2]);
+ if (listForKey2.size() == 0)
+ return extractPrintableTokens(listForKey1)[0];
- return extractPrintableTokens(tokensMap[tokensMapKey2])[1];
+ return extractPrintableTokens(listForKey2)[1];
}
TokenList SqliteStatement::getDbTokenListFromFullname(const QString &tokensMapKey)