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

Request #6055 strange code in mysql_reverse
Submitted: 2005-11-24 09:36 UTC
From: alex at cgi-central dot net Assigned: lsmith
Status: Closed Package: MDB2_Driver_mysql
PHP Version: 4.3.11 OS: any
Roadmaps: (Not assigned)    

 [2005-11-24 09:36 UTC] alex at cgi-central dot net
Description: ------------ I'm unable to understand meaning of code shown below in mysql reverse class. It caused script to fail on very usual MySQL database (usual table with primary key, etc.) After commenting out this code, everything works well. May be I don't understad something? Test script: --------------- --- MDB2/Driver/Reverse/mysql.php 16 Oct 2005 09:39:50 -0000 1.34 +++ MDB2/Driver/Reverse/mysql.php 24 Nov 2005 09:31:23 -0000 @@ -241,10 +246,10 @@ if ($row['key_name'] == 'PRIMARY') { $definition['primary'] = true; } - if (!$row['non_unique']) { - return $db->raiseError(MDB2_ERROR, null, null, - 'getTableConstraintDefinition: it was not specified an existing table index'); - } +// if (!$row['non_unique']) { +// return $db->raiseError(MDB2_ERROR, null, null, +// 'getTableConstraintDefinition: it was not specified an existing table index'); +// }


 [2005-11-24 14:18 UTC] lsmith
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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. It should be getTableConstraintDefinition() without the "s" .. I also fixed this in the call inside MDB2_Schema
 [2005-11-24 14:21 UTC] lsmith
Ups, wrong note .. I fixed this error by ignoring when the index/constraint was not found inside MDB2_Schema. The reason for these raiseError() calls is that MDB2 separates the concept of an index and constraint whereas MDB2 really does not.