#50323 [Com]: No ability to connect to database named 't;', no chance to escape semicolon

From: Date: Sun, 29 Nov 2009 21:29:22 +0000
Subject: #50323 [Com]: No ability to connect to database named 't;', no chance to escape semicolon
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-145193@lists.php.net to get a copy of this message
ID: 50323 Comment by: kelt3we at gmail dot com Reported By: winner5 at interia dot pl Status: Open Bug Type: PDO related Operating System: Linux PHP Version: 5.3.1 New Comment: This is by no means a proper way to provide feedback to a bug report, even if the user's claim is wrong. Next time remember this is not a humor site ;-) Previous Comments: ------------------------------------------------------------------------ [2009-11-29 14:51:23] fa@php.net IBTB (In before the bogus): http://xkcd.com/327/ ------------------------------------------------------------------------ [2009-11-29 14:09:18] alfredorj at walla dot com Why do you don't go to see if I'm on the corner? This bug is not a bug! Who does make a database with ";" chars? You are a really loser. ------------------------------------------------------------------------ [2009-11-29 13:25:13] winner5 at interia dot pl Description: ------------ There is no way to escape semicolon in dsn to be treated like a char, not as a separator. Reproduce code: --------------- <?php $pdo = new PDO('mysql:host=localhost;dbname=t\\;', 'user', 'pass'); ?> Expected result: ---------------- Successfully established connection Actual result: -------------- Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000] [1049] Unknown database 't\'' in ./index.php:1 Stack trace: #0 ./index.php(1): PDO->__construct('mysql:host=loca...', 'user', 'pass') #1 {main} thrown in ./index.php on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50323&edit=1

« previous php.bugs (#145193) next »