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

Bug #9081 MDB2 pgsql dropDatabase issue
Submitted: 2006-10-18 15:01 UTC
From: ale dot pas at tiscali dot it Assigned: quipo
Status: Closed Package: MDB2_Driver_pgsql
PHP Version: 5.1.4 OS: linux
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 : 11 + 11 = ?

 
 [2006-10-18 15:01 UTC] ale dot pas at tiscali dot it (alessandro pasotti)
Description: ------------ A call to dropDatabase() returns MDB2_Ok but the database is not dropped. Test script: --------------- $mdb2->loadModule('Manager'); $this->assertFalse(PEAR::isError($mdb2)); $this->assertTrue(in_array($new_db_name, $mdb2->listDatabases())); // Drop DB $this->assertTrue(MDB2_OK == $mdb2->dropDatabase($new_db_name)); $this->assertFalse(in_array($new_db_name, $mdb2->listDatabases())); Expected result: ---------------- The last instruction should return false but returns true (the DB is still in the list reported by listDatabases(). DB user permission are Ok and the DB is really still there.

Comments

 [2006-10-19 09:00 UTC] ale dot pas at tiscali dot it
This code fails at random (once every 2-5 run) --------------------------------- require_once 'MDB2.php'; $mdb2 =& MDB2::connect('pgsql://***:***@localhost:5432/template1'); $mdb2->loadModule('Manager'); var_dump($mdb2->listDatabases()); $mdb2->dropDatabase('test_geodb'); var_dump($mdb2->listDatabases()); var_dump($mdb2->createDatabase('test_geodb')); -------------------------------------- This code always works: -------------------------------------- $dbconn = pg_connect("host=localhost dbname=template1 user=*** password=***") or die('Could not connect: ' . pg_last_error()); $query = 'select datname from pg_database'; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); while($row = pg_fetch_row($result)){ $dblist[] = $row[0]; } var_dump(db_list()); if(in_array('test_geodb', db_list())){ $query = 'DROP DATABASE test_geodb'; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); } var_dump(db_list()); $query = 'CREATE DATABASE test_geodb'; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); pg_close($dbconn); function db_list(){ $query = 'select datname from pg_database'; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); while($row = pg_fetch_row($result)){ $dblist[] = $row[0]; } return $dblist; }
 [2006-12-25 19:18 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-03-01 13:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-05-04 16:28 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-11-10 00:23 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!