? Success

User tests: Successful: Unsuccessful:

avatar orware
orware
13 Feb 2014

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

avatar orware orware - open - 13 Feb 2014
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar brianteeman brianteeman - change - 2 Sep 2014
Category SQL
avatar roland-d
roland-d - comment - 27 Feb 2015

Please see #3432 for test instructions.

avatar zero-24
zero-24 - comment - 11 Apr 2015

@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!

avatar zero-24 zero-24 - change - 11 Apr 2015
Status Pending Ready to Commit
avatar zero-24 zero-24 - alter_testresult - 11 Apr 2015 - roland-d: Tested successfully
avatar zero-24 zero-24 - test_item - 11 Apr 2015 - Tested successfully
avatar zero-24 zero-24 - change - 11 Apr 2015
Labels Added: ?
avatar wilsonge wilsonge - change - 25 May 2015
Milestone Added:
avatar wilsonge wilsonge - reference | 0fbca80 - 25 May 15
avatar wilsonge wilsonge - merge - 25 May 2015
avatar wilsonge wilsonge - close - 25 May 2015
avatar wilsonge wilsonge - change - 25 May 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-05-25 00:52:11
Closed_By wilsonge
avatar wilsonge wilsonge - close - 25 May 2015
avatar wilsonge
wilsonge - comment - 25 May 2015

Merged - thanks!

Add a Comment

Login with GitHub to post a comment