diff --git a/library/Msd/Sql/Parser/Statement/Alter.php b/library/Msd/Sql/Parser/Statement/Alter.php new file mode 100644 index 0000000..4374212 --- /dev/null +++ b/library/Msd/Sql/Parser/Statement/Alter.php @@ -0,0 +1,36 @@ +setState('Alter'); + $endOfStatement = $sql->getPosition(';'); + $statement = $sql->getData($endOfStatement); + $sql->setPointer($endOfStatement+1); + return $statement; + } +} diff --git a/library/Msd/Sql/Parser/Statement/Create.php b/library/Msd/Sql/Parser/Statement/Create.php index 072ad2e..72d49f8 100644 --- a/library/Msd/Sql/Parser/Statement/Create.php +++ b/library/Msd/Sql/Parser/Statement/Create.php @@ -25,8 +25,12 @@ class Msd_Sql_Parser_Statement_Create implements Msd_Sql_Parser_Interface * * @return void */ - public function parse(Msd_Sql_Object $statement) + public function parse(Msd_Sql_Object $sql) { + $sql->setState('Create'); + $endOfStatement = $sql->getPosition(';'); + $statement = $sql->getData($endOfStatement); + $sql->setPointer($endOfStatement+1); return $statement; } } diff --git a/library/Msd/Sql/Parser/Statement/Drop.php b/library/Msd/Sql/Parser/Statement/Drop.php index f08ecbb..8302f7f 100644 --- a/library/Msd/Sql/Parser/Statement/Drop.php +++ b/library/Msd/Sql/Parser/Statement/Drop.php @@ -25,8 +25,12 @@ class Msd_Sql_Parser_Statement_Drop implements Msd_Sql_Parser_Interface * * @return void */ - public function parse(Msd_Sql_Object $statement) + public function parse(Msd_Sql_Object $sql) { + $sql->setState('Drop'); + $endOfStatement = $sql->getPosition(';'); + $statement = $sql->getData($endOfStatement); + $sql->setPointer($endOfStatement+1); return $statement; } } diff --git a/library/Msd/Sql/Parser/Statement/Insert.php b/library/Msd/Sql/Parser/Statement/Insert.php index 5df23f3..09d5aec 100644 --- a/library/Msd/Sql/Parser/Statement/Insert.php +++ b/library/Msd/Sql/Parser/Statement/Insert.php @@ -25,8 +25,12 @@ class Msd_Sql_Parser_Statement_Insert implements Msd_Sql_Parser_Interface * * @return void */ - public function parse(Msd_Sql_Object $statement) + public function parse(Msd_Sql_Object $sql) { + $sql->setState('Insert'); + $endOfStatement = $sql->getPosition(';'); + $statement = $sql->getData($endOfStatement); + $sql->setPointer($endOfStatement+1); return $statement; } } diff --git a/library/Msd/Sql/Parser/Statement/Lock.php b/library/Msd/Sql/Parser/Statement/Lock.php index 1356bc9..f206965 100644 --- a/library/Msd/Sql/Parser/Statement/Lock.php +++ b/library/Msd/Sql/Parser/Statement/Lock.php @@ -25,8 +25,12 @@ class Msd_Sql_Parser_Statement_Lock implements Msd_Sql_Parser_Interface * * @return void */ - public function parse(Msd_Sql_Object $statement) + public function parse(Msd_Sql_Object $sql) { + $sql->setState('Lock'); + $endOfStatement = $sql->getPosition(';'); + $statement = $sql->getData($endOfStatement); + $sql->setPointer($endOfStatement+1); return $statement; } } diff --git a/library/Msd/Sql/Parser/Statement/Unlock.php b/library/Msd/Sql/Parser/Statement/Unlock.php index 413225d..3c28afb 100644 --- a/library/Msd/Sql/Parser/Statement/Unlock.php +++ b/library/Msd/Sql/Parser/Statement/Unlock.php @@ -25,8 +25,12 @@ class Msd_Sql_Parser_Statement_Unlock implements Msd_Sql_Parser_Interface * * @return void */ - public function parse(Msd_Sql_Object $statement) + public function parse(Msd_Sql_Object $sql) { + $sql->setState('Unlock'); + $endOfStatement = $sql->getPosition(';'); + $statement = $sql->getData($endOfStatement); + $sql->setPointer($endOfStatement+1); return $statement; } }