Bug #70854 [NEW]: Cannot change database
| From: | rmoisto at gmail dot com | Date: | Wed, 04 Nov 2015 14:50:38 +0000 |
| Subject: | Bug #70854 [NEW]: Cannot change database | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-197019@lists.php.net to get a copy of this message | ||
From: rmoisto at gmail dot com
Operating system: Ubuntu 15.10
PHP version: 7.0.0RC6
Package: MySQLi related
Bug Type: Bug
Bug description:Cannot change database
Description:
------------
The select_db function does not work and produces a Warning when using a
class that extends mysqli.
This worked perfectly with PHP 5.6. As I have both PHP versions
installed on this computer I switched between them several times to
confirm this.
I'm using PHP 7 RC6 that I compiled from source.
The web server is nginx, using PHP with FPM.
Test script:
---------------
<?php
class MyMysqli extends mysqli {
public function e_select_db($db) {
return $this->select_db($db);
}
}
$mysqli = new MyMysqli('localhost', 'root', 'password');
$mysqli->e_select_db('db');
Expected result:
----------------
Database is selected.
Actual result:
--------------
Database is not selected.
Also, the following Warning is written to the error log:
PHP message: PHP Warning: mysqli::select_db(): Couldn't fetch MyMysqli
in /var/www/public_html/test.php on line 4" while reading response
header from upstream, client: 127.0.0.1, server: localhost, request:
"GET /test.php HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php7-fpm.sock:", host: "localhost"
--
Edit bug report at https://bugs.php.net/bug.php?id=70854&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70854&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70854&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70854&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70854&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70854&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70854&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70854&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70854&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70854&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70854&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70854&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70854&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70854&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70854&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70854&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70854&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70854&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70854&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70854&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70854&r=mysqlcfg