Home » Database » MDB2 » Bug #2057
typo which results in all notnulls == 0 being set as NOT NULL
Details
| Submitted | 2004-08-04 18:28 UTC |
|---|---|
| From | worker at mompopmedia dot com |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | 5.0.0 |
| OS | Mandrake 10 |
| Roadmaps | (Not assigned) |
Comments
[2004-08-04 18:28 UTC] worker at mompopmedia dot com
Description:
------------
in the xml schema format, if <notnull>0</notnull> all datatype drivers eval incorrectly. eg:
$notnull = isset($field['notnull']) ? ' NOT NULL' : '';
which means $field['notnull'] = 0 evals to "Not NULL". it should be:
$notnull = (isset($field['notnull']) && $field['notnull'] !== 0) ? ' NOT NULL' : '';
Thanks,
michael
[2004-08-05 12:24 UTC] smith at backendmedia dot com
I will commit a fix once I am done refactoring the MDB2_Manager class. If you are bored I wouldnt mind if you refacor the dumpDatabase() method to use a cleaner solution that separates the logic from the xml syntax. Maybe XML_Serializer would be a good choice.
[2004-08-05 16:23 UTC] smith at backendmedia dot com
This bug has been fixed in CVS.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.
In case this was a pear.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.