History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SQL-34
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Bob Swift
Reporter: Chris Shepperd
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Confluence SQL Plugin

Sql plugin doesn't handle column labels correctly

Created: 07/May/08 03:43 PM   Updated: 17/Jun/08 05:10 PM
Component/s: None
Affects Version/s: 3.4.0
Fix Version/s: None

Time Tracking:
Not Specified

Environment: java 1.6, confluence 2.8

Labels:


 Description  « Hide
when a sql is similar to the following

select first_name as 'Name' from user

you get the error "Column 'first_name' not found"

Doesn't matter if you have columnLabel=true or not

This is due to getting the result from the resultset using the column name every time instead of using the column label every time (which is by default the column name unless otherwise specified)



 All   Comments   Work Log   Change History   FishEye   Crucible   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Bob Swift - 07/May/08 04:54 PM
Hmmm... We use this all the time and don't have any trouble. What database are you using?

Arne Schirmacher - 08/May/08 03:04 AM
I had the same problem after upgrading from mysql-connector-java-5.0.8-bin.jar to mysql-connector-java-5.1.6-bin.jar. Suddenly all sql queries having that "select columnname as 'othername'" stopped working. Our MySQL database is: Server version 5.0.32-Debian_7etch5-log, Protocol version 10.

So it might be a configuration problem. However I thought that any mysql connector should be compatible to older MySQL database releases, and 5.0 is not that old. The rest of Confluence worked just fine with the 5.1 connector and the 5.0 database.

SQL-26 might be the same issue.


Chris Shepperd - 08/May/08 08:02 AM
We are using mysql-5.0.51a with mysql-connector-java-5.1.6-bin.jar.

Jeff Schnitter - 17/Jun/08 05:10 PM
I ran into the same problem when I upgraded to the 5.1.6 connector. My teammate researched it and found that it appears to be a bug that's been fixed in the 5.1 MySQL branch: http://lists.mysql.com/commits/47149.

I was able to bypass the problem by changing the url in the resource definition in server.xml to include useOldAliasMetadataBehavior=true, ie

 url = "jdbc:mysql://localhost:3306/mydb?autoReconnect=true&useOldAliasMetadataBehavior=true"