Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Dave DeVol / Dave DeVol (Dave DeVol)
Created: 10/15/2009
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,251028 / 270419
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 20
Problem:
cfquery not returning named query variable in certain instances. i.e cfquery name="testQRY" will result in "Variable TESTQRY is undefined. " with a query that includeds a LEFT JOIN and GROUP BY & HAVING COUNT and there is no data in the LEFT JOIN result set. There is no access to the name of the query like testQry.RecordCount
Method:
Create 2 tables://Table 1USE [BUGDB]GO/****** Object: Table [dbo].[test] Script Date: 10/15/2009 12:44:52 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[test]([UserID] [uniqueidentifier] NULL,[ID] [int] NULL) ON [PRIMARY]//Table 2USE [BUGDB]GO/****** Object: Table [dbo].[Request_test] Script Date: 10/15/2009 12:45:50 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[Request_test]([RequestID] [int] IDENTITY(1050,1) NOT NULL,[UserID] [uniqueidentifier] NULL, CONSTRAINT [PK_RequestTest] PRIMARY KEY CLUSTERED ([RequestID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 70) ON [PRIMARY]) ON [PRIMARY]//RUN:<cfquery name="testQRY">SELECT U.UserID FROM [test] U LEFT JOIN Request_test R ON (R.UserID = U.UserID) WHERE U.ID = 1 GROUP BY U.UserID HAVING COUNT(R.RequestID) > 0 GROUP BY U.UserID HAVING COUNT(R.RequestID) > 0</cfquery>
Result:
Variable TESTQRY is undefined. <br>The error occurred on line 19.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040311
External Customer Info:
External Company:
External Customer Name: Dave DeVol
External Customer Email: 0F6F1E9A411BA0FB99201549
External Test Config: 10/15/2009
Attachments:
Comments: