[PEAR-BUG] Bug #18637 [Opn->Fbk]: Cannot parse ALTER TABLE queries

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=18637&edit=1

 ID:               18637
 Updated by:       [email protected]
 Reported By:      tom at switchsystems dot co dot uk
 Summary:          Cannot parse ALTER TABLE queries
-Status:           Open
+Status:           Feedback
 Type:             Bug
 Package:          SQL_Parser
 Package Version:  0.6.0
 PHP Version:      5.3.5
 Roadmap Versions: 
 New Comment:

-Status: Open
+Status: Feedback
Can you try the version in svn

svn co http://svn.php.net/repository/pear/packages/SQL_Parser/trunk
SQL_Parser


Previous Comments:
------------------------------------------------------------------------

[2011-06-30 15:32:17] exp_tom

-PHP Version: 5.3.6
+PHP Version: 5.3.5


------------------------------------------------------------------------

[2011-06-30 15:29:44] exp_tom

Description:
------------
The parser cannot cope with ALTER TABLE queries:
Caught exception: Parse error: Unknown action: alter on line 1
ALTER TABLE `groups` ADD `type` TINYINT UNSIGNED NOT NULL DEFAULT '0'
AFTER `permissionInheritance`
^ found: "ALTER"
in: /usr/share/php/SQL/Parser.php#318


Test script:
---------------
<?php
$p = new SQL_Parser(null,SQL_Parser::DIALECT_MYSQL);
$p->parse('ALTER TABLE `groups` ADD `type` TINYINT UNSIGNED NOT NULL
DEFAULT '0' AFTER `permissionInheritance`;');
?>

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18637&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.