KernelPanic
Joined: 02/25/08
Posts: 4 |
MySQL Aliases are not respected.
02/25/08 1:28 AM
Running BlueDragon 6.2JX with MySql5.
An example query
<cfquery name="test">Select title as "BookName",sales from books.</cfquery>
The following will fail with the error that the field does not exist: <cfoutput>#test.BookName#</cfoutput>
However, the following will work:
<cfoutput>#test.title#</cfoutput>
It did work under mysql 3.23, any solutions?
|
|
Link | Top | Bottom
|
KernelPanic
Joined: 02/25/08
Posts: 4 |
RE: MySQL Aliases are not respected.
02/25/08 1:36 AM
Further to this: Ive read http://www.newatlanta.com/c/auth/support/bluedragon/bugtracking/detail?page=2&bugId=2568
And it references: http://bugs.mysql.com/bug.php?id=22757
but we are using version 5.1.5 of the connector.
|
|
Link | Top | Bottom
|
hyde11
Joined: 10/04/07
Posts: 8 |
RE: MySQL Aliases are not respected.
02/25/08 11:02 AM
I can't image how it worked. Your alias should not be in quotes; you also need to remove the period at the end of the query string - so rewrite as:
<cfquery name="test">Select title as BookName, sales from books</cfquery>
This should work.
|
|
Link | Top | Bottom
|
Joined:
Posts: 0 |
RE: MySQL Aliases are not respected.
02/25/08 11:57 AM
I tested the mysql 5.1.5 driver and found, as you did, that aliases were not working.
Try opening BlueDragon Admin UI and configure your mysql datasource connection string like this: useOldAliasMetadataBehavior=true
Let me know if this resolves the problem. Evidently, this is a known issue with mysql connector. http://bugs.mysql.com/bug.php?id=33561
|
|
Link | Top | Bottom
|
hyde11
Joined: 10/04/07
Posts: 8 |
RE: MySQL Aliases are not respected.
02/25/08 2:10 PM
Or you could use the old version of the driver. I just checked and I am using 5.05 and it works fine.
|
|
Link | Top | Bottom
|
KernelPanic
Joined: 02/25/08
Posts: 4 |
RE: MySQL Aliases are not respected.
02/25/08 5:28 PM
Lori, thats the answer I have found and it works well.
Hyde11, sorry, I just pieced the example strings in my original posts to show the point, sorry for the errors.
The old driver is always an option, however, in this case, im just going to run with useOldAliasMetadataBehavior=true in the connection string.
Thanks all for the help.
|
|
Link | Top | Bottom
|