Bug #6215
closed
SQL extension: returning the results of a join query
Category:
Saxon extensions
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
- Status changed from New to In Progress
Sorry about the delay. I have finally got around to re-establishing a test environment where I can debug this.
First thing is, I've established that (at least with PostgresSQL), with a query of the form
SELECT date AS date2, price AS price2 FROM book WHERE author = ?'
the current code (which calls resultSetMetaData.getColumnName()
) is in fact using "date2" and "price2" as the column labels. Using resultSetMetaData.getColumnLabel()
gives exactly the same result.
Next experiment, if I give both columns the same AS name, it doesn't complain and just returns a map in which one of the fields (the first one) is missing (because of course the duplicate name has overridden it).
I noticed the same thing with MySQL. With one table or joins of unique tables with unique column names, I can use AS to rename a column.
- Status changed from In Progress to Resolved
- Applies to branch 12, trunk added
- Fix Committed on Branch 12, trunk added
I have added some test cases that establish the "AS" column name is used when available; and I have changed the code so that a unique key name is generated in the result map if the supplied column names are not unique.
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.4 added
Bug fix applied in the Saxon 12.4 maintenance release
Please register to edit this issue
Also available in: Atom
PDF