User tests: Successful: Unsuccessful:
This fix is to revert back to original behavior needed to allow bounded variables to be used within the PDO Driver (and specifically within the Oracle Driver that inherits from it).
Without the fix above, what happens is the instance of JDatabaseQuery stored in $query ends up getting replaced with a simple string on line 701 and that eventually gets stored in the parent::setQuery() call on line 708.
Later, when execute() is called, since the string is not an instance of JDatabaseQuery, the checks within execute that trigger the bounded variables to be set no longer function correctly and the variables end up being unbounded and results in a query error.
With the simple corrections above, the $query instance remains intact with a separate $sql variable being used instead to hold the "stringified" version of the query with the database prefix replacements and that gets used to prepare the query within the database connection.
This allows the parent::setQuery() call on line 708 to still store a reference to the JDatabaseQuery instance properly and for everything to work as expected for the bounded variables.
-Omar
Labels |
Removed:
?
|
Status | New | ⇒ | Pending |
Category | ⇒ | SQL |
@test successful using the db tester at: https://github.com/mManishTrivedi/dbtester
Before the PR:
# Database connection successfully created.
# Query successfully run but Table fetching result is Zero.
# Table list successfully fetched.
array(0) { }
After the PR:
# Database connection successfully created.
# Table list successfully fetched.
array(1) { [0]=> string(20) "jos_dbtesting_sqlite" }
As @roland-d try this with the same results at: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=33494
I move this here to RTC. Thanks!
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-25 00:52:11 |
Closed_By | ⇒ | wilsonge |
Merged - thanks!
Please see #3432 for test instructions.