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

Request #12962 more compatible getServerVersion with other MDB2 wrapper
Submitted: 2008-01-23 13:32 UTC
From: afz Assigned: quipo
Status: Closed Package: MDB2_Driver_ibase (version CVS)
PHP Version: Irrelevant OS:
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 : 23 - 15 = ?

 
 [2008-01-23 13:32 UTC] afz (Ali Fazelzadeh)
Description: ------------ hi, this patch for more compatible getServerVersion with other MDB2 wrapper.(BTW, i repeat patch of #12958). tanks

Comments

 [2008-01-23 13:32 UTC] afz (Ali Fazelzadeh)
Index: ibase.php =================================================================== RCS file: /repository/pear/MDB2/MDB2/Driver/ibase.php,v retrieving revision 1.212 diff -u -r1.212 ibase.php --- ibase.php 22 Jan 2008 15:52:12 -0000 1.212 +++ ibase.php 23 Jan 2008 08:24:01 -0000 @@ -693,14 +693,16 @@ $server_info = $this->connected_server_info; } elseif ($this->options['server_version']) { $server_info = $this->options['server_version']; - } elseif ($this->options['DBA_username']) { - $ibserv = @ibase_service_attach($this->dsn['hostspec'], $this->options['DBA_username'], $this->options['DBA_password']); + } else { + $ibserv = @ibase_service_attach($this->dsn['hostspec'], + $this->options['DBA_username']? $this->options['DBA_username'] : $this->dsn['username'], + $this->options['DBA_username']? $this->options['DBA_password'] : $this->dsn['password']); $server_info = @ibase_server_info($ibserv, IBASE_SVC_SERVER_VERSION); @ibase_service_detach($ibserv); } if (!$server_info) { return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, - 'Requires either "server_version" or "DBA_username"/"DBA_password" option', __FUNCTION__); + 'Requires either "server_version" option', __FUNCTION__); } // cache server_info $this->connected_server_info = $server_info; @@ -899,8 +901,7 @@ */ function lastInsertID($table = null, $field = null) { - $seq = $table.(empty($field) ? '' : '_'.$field); - return $this->currID($seq); + return $this->currID($table); } // }}}
 [2008-01-25 05:44 UTC] afz (Ali Fazelzadeh)
updated patch: Index: ibase.php =================================================================== RCS file: /repository/pear/MDB2/MDB2/Driver/ibase.php,v retrieving revision 1.212 diff -u -r1.212 ibase.php --- ibase.php 22 Jan 2008 15:52:12 -0000 1.212 +++ ibase.php 25 Jan 2008 06:00:46 -0000 @@ -693,14 +693,16 @@ $server_info = $this->connected_server_info; } elseif ($this->options['server_version']) { $server_info = $this->options['server_version']; - } elseif ($this->options['DBA_username']) { - $ibserv = @ibase_service_attach($this->dsn['hostspec'], $this->options['DBA_username'], $this->options['DBA_password']); + } else { + $ibserv = @ibase_service_attach($this->dsn['hostspec'], + $this->options['DBA_username']? $this->options['DBA_username'] : $this->dsn['username'], + $this->options['DBA_username']? $this->options['DBA_password'] : $this->dsn['password']); $server_info = @ibase_server_info($ibserv, IBASE_SVC_SERVER_VERSION); @ibase_service_detach($ibserv); } if (!$server_info) { return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, - 'Requires either "server_version" or "DBA_username"/"DBA_password" option', __FUNCTION__); + 'Requires either "server_version" option', __FUNCTION__); } // cache server_info $this->connected_server_info = $server_info;
 [2008-01-27 18:30 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.
 [2008-01-30 03:28 UTC] afz (Ali Fazelzadeh)
still not fixed, new patch is: Index: ibase.php =================================================================== RCS file: /repository/pear/MDB2/MDB2/Driver/ibase.php,v retrieving revision 1.214 diff -u -r1.214 ibase.php --- ibase.php 27 Jan 2008 18:30:02 -0000 1.214 +++ ibase.php 30 Jan 2008 03:39:20 -0000 @@ -694,8 +694,8 @@ } elseif ($this->options['server_version']) { $server_info = $this->options['server_version']; } else { - $username = isset($this->options['DBA_username']) ? $this->options['DBA_username'] : $this->dsn['username']; - $password = isset($this->options['DBA_password']) ? $this->options['DBA_password'] : $this->dsn['password']; + $username = $this->options['DBA_username'] ? $this->options['DBA_username'] : $this->dsn['username']; + $password = $this->options['DBA_password'] ? $this->options['DBA_password'] : $this->dsn['password']; $ibserv = @ibase_service_attach($this->dsn['hostspec'], $username, $password); $server_info = @ibase_server_info($ibserv, IBASE_SVC_SERVER_VERSION); @ibase_service_detach($ibserv);
 [2008-01-30 07:28 UTC] quipo (Lorenzo Alberton)
ah, yes, I forgot it was initialized in the constructor and thus always defined... fixed.