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

Bug #12208 wrong verification of clob fields with mysql(i) backend
Submitted: 2007-10-09 05:44 UTC
From: cwiedmann Assigned: wiesemann
Status: Closed Package: DB_Table (version 1.5.0)
PHP Version: Irrelevant OS: Windows_NT
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 13 - 13 = ?

 
 [2007-10-09 05:44 UTC] cwiedmann (Carsten Wiedmann)
Description: ------------ Hi Mark, in "$GLOBALS['_DB_TABLE']['valid_type']" -> 'mysql'/'mysqli' (manager.php), the key 'clob' have a value of 'blob','longtext'. But the field type in MySQL can also be TINYTEXT, TEXT or MEDIUMTEXT. This depends on the length you define for this field. Now we have the situation, that a table can be created with e.g. "drop", but can't be verified. (I don't know, if this is also a problem with other databases.) Regards, Carsten Test script: --------------- <?php require_once 'MDB2.php'; require_once 'DB/Table.php'; class Test_Table extends DB_Table { var $col = array( 'db_table' => array( 'type' => 'clob', 'size' => 2048 ) ); } $conn = MDB2::connect('mysqli://root@localhost/test'); if (PEAR::isError($conn)) { die($conn->getMessage()); } echo 'Connected to database<br><br>'; $testTable = new Test_Table($conn, 'db_table', 'drop'); if ($testTable->error) { die($testTable->error->getMessage()); } unset($testTable); echo 'Table created<br><br>'; $testTable = new Test_Table($conn, 'db_table', 'verify'); if ($testTable->error) { die($testTable->error->getMessage()); } unset($testTable); echo 'Table verified<br><br>'; ?> Expected result: ---------------- Connected to database Table created Table verified Actual result: -------------- Connected to database Table created DB_TABLE Error - Verification failed: wrong column type (column='db_table', type='text')

Comments

 [2007-11-21 16:26 UTC] wiesemann (Mark Wiesemann)
Thanks for the report. As I don't have access to all supported DBMS, I'll only fix this for 'mysql' and 'mysqli' for now. (=> summary adjusted accordingly)
 [2007-11-21 16:27 UTC] wiesemann (Mark Wiesemann)
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.