Bug #20587 | Left join and order | ||
---|---|---|---|
Submitted: | 20 Jun 2006 21:33 | Modified: | 11 Dec 2007 17:43 |
Reporter: | Luis Llana | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1 | OS: | Linux (Linux) |
Assigned to: | CPU Architecture: | Any |
[20 Jun 2006 21:33]
Luis Llana
[21 Jun 2006 10:12]
Tonci Grgin
Hi Luis and thanks for your problem report. Can you please do the following: Try to repeat the problem with latest version of JDBC driver from http://dev.mysql.com/downloads/connector/j/3.1.html If problem persists, add dump of your data and table structurs and complete java project to this bug report so I can test it. In any case post your progress here.
[23 Jun 2006 19:58]
Luis Llana
Sample of failing Java source code
Attachment: PrJDBC.java (text/x-java), 2.00 KiB.
[23 Jun 2006 20:03]
Luis Llana
Failing database. Dump made with mysqlhotcopy.
Attachment: vazmacon.tgz (application/x-tgz, text), 109.12 KiB.
[23 Jun 2006 20:12]
Luis Llana
I have installed the mysql-connector-java-3.1.13-bin.jar in JAVA_HOME/jre/lib/ext and the problem remains. I hope that there is no other older version of the connector interfering. Also I have just submitted a dump of the failing database and a program that shows the problem.
[26 Jun 2006 8:00]
Tonci Grgin
Luis, thanks for info provided! I was able o verify this behavior with data and test case provided. MySQL connector/J 3.1.12 and 3.1.13 JDK 1.6 Win XP Pro SP2 Synopsis: When prepared statement contais "ORDER BY" clause and *returning column is part of multi-field index* resultset and resultset metadata do not return second table name, just field name: rs.fields[1].tableName = "" rsmd.fields[1].tableName = "" which causes an error to be thrown: Exception in thread "main" java.sql.SQLException: Column 'obras.nombre' not found. at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:970) at com.mysql.jdbc.ResultSet.getString(ResultSet.java:4755) If you drop multi-field index containing column from result(UNIQUE KEY `idxNombreCliente` (`nombre`,`cliente`)): alter table obras drop index idxNombreCliente; your example works: run: nombre:obras: Naclares de Oca, 14. Pol. Las Mercedes nombre:obras: null
[26 Jun 2006 8:01]
Tonci Grgin
Mysqldump of data
Attachment: test.zip (application/x-zip-compressed, text), 55.40 KiB.
[26 Jun 2006 16:39]
Mark Matthews
Changing category, as it's the server that's returning erroneus metadata.
[26 Apr 2007 14:14]
Luis Llana
Hello, After several months without trying the testing program, I have just tried it today a standard debian and it works. $ dpkg -l mysql-server-5.0 Desired=Unknown/Install/Remove/Purge/Hold | Estado=No/Instalado/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: mayúsc.=malo) ||/ Nombre Versión Descripción +++-======================-======================-============================================================ ii mysql-server-5.0 5.0.32-7etch1 mysql database server binaries
[27 Apr 2007 5:49]
Tonci Grgin
Luis, thanks for your feedback and your interest in MySQL. Glad things are fixed in 5.0.