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

Bug #10548 Table info throws error
Submitted: 2007-03-29 07:05 UTC
From: ogmueller Assigned: quipo
Status: Closed Package: MDB2 (version 2.4.0)
PHP Version: 5.2.1 OS: Win2k
Roadmaps: (Not assigned)    
Subscription  


 [2007-03-29 07:05 UTC] ogmueller (Oliver Mueller)
Description: ------------ If i use $mdb2->reverse->tableInfo( 'my_table' ) in an Oracle 9 environment, I get the following error message: [Error message: it was not specified an existing table constraint] The problem seems to be a call to getTableConstraintDefinition($table, $index_name) which is called with a constraint name instead of an index name. If i change the query $query = 'SELECT "all".constraint_type, cols.column_name'; $query.= ' FROM all_constraints "all", all_cons_columns cols'; $query.= ' WHERE ("all".table_name='.$db->quote($table, 'text').' OR "all".table_name='.$db->quote(strtoupper($table), 'text').')'; $query.= ' AND ("all".index_name=%s OR "all".index_name=%s)'; $query.= ' AND "all".constraint_name = cols.constraint_name'; $query.= ' AND "all".owner = '.$db->quote(strtoupper($db->dsn['username']), 'text'); into $query = 'SELECT "all".constraint_type, cols.column_name'; $query.= ' FROM all_constraints "all", all_cons_columns cols'; $query.= ' WHERE ("all".table_name='.$db->quote($table, 'text').' OR "all".table_name='.$db->quote(strtoupper($table), 'text').')'; $query.= ' AND ("all".constraint_name=%s OR "all".constraint_name=%s)'; $query.= ' AND "all".constraint_name = cols.constraint_name'; $query.= ' AND "all".owner = '.$db->quote(strtoupper($db->dsn['username']), 'text'); everything works fine... the problem is, that the upper query will only have PKs in the index name column, but no foreign key indexes. Test script: --------------- // any Oracle table with foreign key constraints $mdb2->reverse->tableInfo( 'my_table' ); Expected result: ---------------- table info Actual result: -------------- object(MDB2_Error)#23

Comments

 [2007-03-29 09:41 UTC] quipo (Lorenzo Alberton)
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.