Bug #32867 Caching Prepared Statements causes erroneous execution of left join queries
Submitted: 30 Nov 2007 9:10 Modified: 31 Mar 2014 15:09
Reporter: Surya Prabha Vadlamani Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.0 OS:Any
Assigned to: Alexander Soklakov CPU Architecture:Any
Tags: left join queries, prepared statement caches

[30 Nov 2007 9:10] Surya Prabha Vadlamani
Description:
If the prepared statements are cached in the My connector/J JDBC driver, left join queries do not work properly. 

In the left join query, if there is no corresponding row in the right table, null values are returned for its columns. The bug is that, if the above scenarios happens once, from then onwards, the query always returns NULL values for the columns of the right table. This does not happen when we switch off caching of Prepared Statements in the driver. 

How to repeat:
Create two tables with one-one relation. Turn on caching of prepared statements in the driver. Execute a left join query on the tables. Have the data such that for some rows of the left table, there are no corresponding rows in the right table.
[30 Nov 2007 11:54] Tonci Grgin
Hi Surya and thanks for your report. Please attach full test case showing the problem... Now, just by reading it, what else would you expect caching to do?
[1 Jan 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[2 Jan 2008 8:20] Tonci Grgin
Hi Surya. I'm still waiting on test case / explanation, I thought it was serious for you...
[31 Mar 2014 15:09] Alexander Soklakov
I close this report as "Can't repeat" because there is no feedback for a long time and codebase is too old. Please, feel free to reopen it if the problem still exists in current driver.