mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
grammar: Fix using unquoted keywords as DEFAULT values in constraints
This fixes tables like these where a keyword (in this case NO) is used as an unquoted default value for a column: CREATE TABLE test(a DEFAULT NO); See issue #877.
This commit is contained in:
@@ -429,6 +429,11 @@ QString identifier(antlr::RefAST ident)
|
||||
|
||||
QString concatTextAST(antlr::RefAST t, bool withspace = false)
|
||||
{
|
||||
// When this is called for a KEYWORDASTABLENAME token, we must take the child's content to get the actual value
|
||||
// instead of 'KEYWORDASTABLENAME' as a string. The same applies for KEYWORDASCOLUMNNAME tokens.
|
||||
if(t != antlr::nullAST && (t->getType() == sqlite3TokenTypes::KEYWORDASTABLENAME || t->getType() == sqlite3TokenTypes::KEYWORDASCOLUMNNAME))
|
||||
return concatTextAST(t->getFirstChild());
|
||||
|
||||
QStringList stext;
|
||||
while(t != antlr::nullAST)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user