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

Bug #3077 MDB2_Tools_Manager munging <start></start> value
Submitted: 2005-01-02 19:54 UTC
From: justinh Assigned: lsmith
Status: Closed Package: MDB2
PHP Version: Irrelevant OS: -
Roadmaps: (Not assigned)    
Subscription  


 [2005-01-02 19:54 UTC] justinh
Description: ------------ There's a small problem in the Manager library which causes problems when you supply a <on></on> tag in a <sequence>. The variable the query is assigned to is wrong and thus causes an MDB2_Error when run. Also, a few lines later, the value aquired from querying the database for the MAX($field) is overwritten with 1, thus losing the value. --- pear/MDB2/MDB2/Tools/Manager.php Thu Nov 25 11:34:24 2004 +++ /home/justinh/public_html/sVote/Libraries/MDB2/Tools/Manager.php Sun Jan 2 10:48:14 2005 @@ -667,7 +667,7 @@ $table = $sequence['on']['table']; $field = $sequence['on']['field']; if ($this->db->supports('summary_functions')) { - $field = "SELECT MAX($field) FROM $table"; + $query = "SELECT MAX($field) FROM $table"; } else { $query = "SELECT $field FROM $table ORDER BY $field DESC"; } @@ -679,8 +679,6 @@ } if (isset($sequence['start']) && is_numeric($sequence['start'])) { $start = $sequence['start']; - } else { - $start = 1; } $this->expectError(MDB2_ERROR_ALREADY_EXISTS); $result = $this->db->manager->createSequence($sequence_name, $start); Reproduce code: --------------- - Expected result: ---------------- - Actual result: -------------- -

Comments

 [2005-01-02 20:08 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.