-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI_DB_driver->simple_query() doesn't handle the return of CI_DB_driver->initialize() when db_debug options is FALSE #4223
Conversation
Pull current develop branch to submit a bug report later
…ze() when db_debug = FALSE #4223
@@ -774,7 +774,10 @@ public function simple_query($sql) | |||
{ | |||
if ( ! $this->conn_id) | |||
{ | |||
$this->initialize(); | |||
if( !$this->initialize() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( ! $this->initialize())
* fixed PHP code style
@@ -774,7 +774,10 @@ public function simple_query($sql) | |||
{ | |||
if ( ! $this->conn_id) | |||
{ | |||
$this->initialize(); | |||
if( ! $this->initialize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing a space after the if ...
Also, please leave a comment after you push changes as commits don't issue notifications.
* added missing space character
Hi, I added the lost space character again. Hope this does it now ;) regards |
CI_DB_driver->simple_query() to check initialize() return value
CI_DB_driver->simple_query() to check initialize() return value
Overview description
Hi @ll,
today I wanted to test my rewritten ci error pages. When I was testing the ENVIROMENT "production", my database configuration will set db_debug to false and I noticed a FATAL error in my php_error.log. :(
I found out that in file system/database/DB_driver.php:777 (the function simple_query() does not respect the return value from $this->initialize(). The $this->initialize() normally never come back on a database connection error because it calls the CI_DB_driver->display_error() method WHEN db_debug option is set to TRUE.
In my production ENV the db_debug is set to FALSE so $this->initialize() returns me an FALSE but simply_query silent discard the return value and call execute(). !!_"*! ;)
regards
j0inty
Steps to reproduce
Use session with qb->pdo->pgsql
config/database.php options
$query_builder = TRUE;
Actual results
CI Error Log Entry:
PHP error_log entry
Expected results
Get only the "Unable to connect ..." message in CI Log and not the "Severity: Error --> Call to a member function ..." from PHP, too.
CI Error Log Entry
The project site is showing up again without to display the db error page as expected. ;)
regards
j0inty