mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Grammar: Fix multiple primary keys with conflict clause
Fix handling of multiple primary keys followed by a conflict clause like in thix table definition: CREATE TABLE [explore_records] ( [system_id] INTEGER NOT NULL REFERENCES [star_systems](id), [player_id] INTEGER NOT NULL REFERENCES [players](id), PRIMARY KEY ([player_id], [system_id]) ON CONFLICT ABORT ) This partially fixes EoD's problem in issue #63.
This commit is contained in:
@@ -312,8 +312,10 @@ Table CreateTableWalker::table()
|
||||
int fieldindex = tab.findField(col);
|
||||
if(fieldindex != -1)
|
||||
tab.fields().at(fieldindex)->setPrimaryKey(true);
|
||||
tc = tc->getNextSibling(); // skip ident and comma
|
||||
tc = tc->getNextSibling();
|
||||
do
|
||||
{
|
||||
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