Query Timeout in Coldfusion, but not in MySQL Workbench
I am developing a webapp on Coldfusion 8,0,1,195765 Enterprise running on a SUSE Linux Enterprise 10 SP2 Server, backed with a MySQL 5.0.26 database.
I am using the following query to select records from the database. Usually the query is generated from a form, but I have set it with fixed attributes to get the issue I am having figured out:
SELECT i.building_id, i.room_number, i.last_service, i.po_number, i.comments, i.cost, i.serial_number, t.full_name, i.last_user, i.barcode, i.age, i.id, i.scratch FROM item i, item_type t WHERE i.item_type = t.short_code AND building_id = 'TEST' ORDER BY i.id
The item table contains a list of items, i.item_type is a 4 character short code. item_type contains records with the 4 character code and its associated full name.
This query only returns 1 row with my current database contents. When I run the query within MySQL workbench connected to the server, it returns the one row in around 0.050 seconds. However, when I test the query through Coldfusion with the following code:
<cfquery name="test" datasource=#Application.dsn#>
SELECT i.building_id, i.room_number, i.last_service, i.po_number, i.comments, i.cost, i.serial_number, t.full_name, i.last_user, i.barcode, i.age, i.id, i.scratch FROM item i, item_type t WHERE i.item_type = t.short_code AND building_id = 'TEST' ORDER BY i.id
</cfquery>
<cfdump var="#test#">
The query hangs and eventually times out.
The extra strange part is that the query executes fine from Coldfusion if I remove the ORDER BY statament...
I have been unable to figure out what is causing the problem, since everything works fine outside of Coldfusion, and it is a pretty simple query.
Thanks for any help!
