Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.6

Bug #14052 MDB2_Schema Error: schema validation error
Submitted: 2008-06-03 05:20 UTC
From: pprocacci Assigned: ifeghali
Status: Closed Package: MDB2_Schema (version 0.8.2)
PHP Version: 5.2.6 OS: FreeBSD 7.0
Roadmaps: (Not assigned)    
Subscription  


 [2008-06-03 05:20 UTC] pprocacci (Paul Procacci)
Description: ------------ I have an application I am designing to be database agnostic, however my preliminary work is being done in postgres as I write it. When trying to get a data definition in xml via MDB2_Schema I get the following error: MDB2_Schema Error: schema validation error While attempting to figure out why I am getting this error, I narrowed down the problem to line 874 in: MDB2/Schema/Validate.php There is a regex test again the variable $field_value which fails. $field_value for me has a value of 'now()', but a test isn't included to test for this string, hence the reason for the fail. Am I missing something obvious? My PG table trimmed: create table articles ( article_id serial PRIMARY KEY, article_date timestamp not null default current_timestamp, ); Test script: --------------- #!/usr/local/bin/php -q <?php require_once('MDB2/Schema.php'); $dsn = array( 'phptype' => "pgsql", 'username' => "username", 'password' => "password", 'hostspec' => "localhost", 'database' => "testdb" ); $options = array( 'ssl' => false, 'persistent' => false, 'debug' => 2, 'portability' => MDB2_PORTABILITY_ALL ); $mdb2 = MDB2_Schema::factory($dsn,$options); if(PEAR::isError($mdb2)){ die($mdb2->getMessage()); } else { $definition = $mdb2->getDefinitionFromDatabase(); if (PEAR::isError($definition)) { print $definition->getMessage(); exit; } print $definition; } $mdb2->disconnect(); ?> Expected result: ---------------- I expect my script would reach 'print $definition;' in my example code. Actual result: -------------- The actual result is the output of 'print $definition->getMessage();' which is the summary of this bug report.

Comments

 [2008-07-13 17:09 UTC] hschletz (Holger Schletz)
CURRENT_TIMESTAMP and now() are equivalent functions. PostgreSQL always reports them as now(). I added a patch to recognize now() as valid.
 [2008-11-15 19:05 UTC] ifeghali (Igor Feghali)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.