grammar: proper support the index_column rule

This commit is contained in:
Peinthor Rene
2014-08-18 19:16:45 +02:00
parent 2cadb38719
commit 6d47c749f8
3 changed files with 289 additions and 217 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -363,7 +363,7 @@ tableconstraint
indexedcolumn
:
id (AUTOINCREMENT)?
id (COLLATE collationname)? (ASC|DESC)? (AUTOINCREMENT)?
;
conflictclause

View File

@@ -320,6 +320,14 @@ Table CreateTableWalker::table()
tab.fields().at(fieldindex)->setPrimaryKey(true);
tc = tc->getNextSibling();
if(tc != antlr::nullAST
&& (tc->getType() == sqlite3TokenTypes::ASC
|| tc->getType() == sqlite3TokenTypes::DESC))
{
// TODO save ASC / DESC information?
tc = tc->getNextSibling();
}
if(tc != antlr::nullAST && tc->getType() == sqlite3TokenTypes::AUTOINCREMENT)
{
tab.fields().at(fieldindex)->setAutoIncrement(true);