Bug #67431 [NEW]: PDO::__construct tries to use login role as DB name if DB name isn't present

From: Date: Fri, 13 Jun 2014 02:57:02 +0000
Subject: Bug #67431 [NEW]: PDO::__construct tries to use login role as DB name if DB name isn't present
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186169@lists.php.net to get a copy of this message
From: phansys at gmail dot com Operating system: Ubuntu 14.10 PHP version: Irrelevant Package: PDO PgSQL Bug Type: Bug Bug description:PDO::__construct tries to use login role as DB name if DB name isn't present Description: ------------ I'm trying to open a PDO connection through PGSQL in order to create a new database with a login role created manually in PostgreSQL DB (called 'login_role_name'). PDO PDO support => enabled PDO drivers => pgsql pdo_pgsql PDO Driver for PostgreSQL => enabled PostgreSQL(libpq) Version => 9.3.4 Module version => 1.0.2 Revision => $Id$ pgsql PostgreSQL Support => enabled PostgreSQL(libpq) Version => 9.3.4 PostgreSQL(libpq) => PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2, 64-bit Multibyte character support => enabled SSL support => enabled Active Persistent Links => 0 Active Links => 0 Directive => Local Value => Master Value pgsql.allow_persistent => On => On pgsql.auto_reset_persistent => Off => Off pgsql.ignore_notice => Off => Off pgsql.log_notice => Off => Off pgsql.max_links => Unlimited => Unlimited pgsql.max_persistent => Unlimited => Unlimited Test script: --------------- $conn = new \PDO("pgsql:host=0.0.0.0;port=5432;", 'login_role_name', 'login_role_pass'); var_dump($conn); Expected result: ---------------- object(PDO)#1 (0) { } Actual result: -------------- PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] FATAL: database "login_role_name" does not exist' in ... -- Edit bug report at https://bugs.php.net/bug.php?id=67431&edit=1 --

« previous php.bugs (#186169) next »