mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
grammar: fix crash and autoincrement in primary key table_constraints
This commit is contained in:
@@ -318,10 +318,17 @@ Table CreateTableWalker::table()
|
||||
int fieldindex = tab.findField(col);
|
||||
if(fieldindex != -1)
|
||||
tab.fields().at(fieldindex)->setPrimaryKey(true);
|
||||
do
|
||||
|
||||
tc = tc->getNextSibling();
|
||||
if(tc != antlr::nullAST && tc->getType() == sqlite3TokenTypes::AUTOINCREMENT)
|
||||
{
|
||||
tab.fields().at(fieldindex)->setAutoIncrement(true);
|
||||
tc = tc->getNextSibling();
|
||||
}
|
||||
while(tc != antlr::nullAST && tc->getType() == sqlite3TokenTypes::COMMA)
|
||||
{
|
||||
tc = tc->getNextSibling(); // skip ident and comma
|
||||
} while(tc->getType() == sqlite3TokenTypes::COMMA);
|
||||
}
|
||||
} while(tc != antlr::nullAST && tc->getType() != sqlite3TokenTypes::RPAREN);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user