Bug 30 : Incorrect table alias when joining with quoted identifiers
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.5
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
17/12/2007
Updated 
17/12/2007
Type 
Bug
 
Attachments 
No attachments

If you are using quoted identifiers and performing a join against a table with a similar name (starting with the same character)...

... then the table alias used to join the second table will incorrectly contain a quoted identifier character (in MySql thats a backtick).

 
Rob 17 Dec 09:10
Example of sql...

SELECT a.id, a.name
, da.id, da.key, da.value, da.base_id
FROM `base` a
LEFT OUTER JOIN `baseDetail` d` ON a.id = d`.base_id

Rob 17 Dec 09:12
Fixed code:

The bug is in the DeployUtil.getAlias() method.

It now checks to see that the letter used to build the sql alias is in fact a valid letter (when it used to just return the first character regardless).

I'll likely put out a 0.9.4b including this bug fix.

Rob 07 Feb 09:40
Fixed in 0.9.5

fixed.

woResponse

Upload a file