benpjohnson / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Undefined constant in column-def-processor.php #107

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Parse an SQL statement with an int column with a default value. 

Example:

$sql = "CREATE TABLE IF NOT EXISTS `engine4_urdemo_causebug` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `extra` int(11)  NOT NULL DEFAULT 56,
  PRIMARY KEY (`id`),
  INDEX client_idx (id)
) ENGINE=InnoDB;"

require_once 'php-sql-parser.php';

new PHPSQLParser($sql);
#########################
Fatal error:  Undefined class constant 'DEF_VALUE' in 
PHP-SQL-Parser/classes/processors/column-def-processor.php on line 337

########################
Steps to fix:

add 'const DEF_VALUE = "default-value";' to expression-types.php

Original issue reported on code.google.com by ml...@saleamp.com on 19 Dec 2013 at 11:14

GoogleCodeExporter commented 9 years ago
Ooops, I forgot the constant definition. Fixed in r836, thank you!

Original comment by pho...@gmx.de on 20 Dec 2013 at 5:44