- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 11:55 AM
Hi,
Here's a snippet of Eureka server-side JavaScript:
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('fred', 'abcd');
gr.query();
As 'fred' is obviously not a valid column name I'd expect either zero rows in the result set and/or an exception but instead get all rows in my table. Is this the correct behavior? I did come across a fix (PRB080092) that mentions handling a non-existent column by throwing an error. What am I missing here?
Thanks, Garry
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:47 PM
Update : You have to add the below property in the table(sys_properties) with value set to true and type as "True/false".
glide.invalid_query.returns_no_rows=true
NOTE: This is fixed on Fuji Patch2.
Please mark the answer as correct if this resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 01:33 PM
Garry,
This is a known issue which is fixed in Fuji. You can check from ServiceNow KB: PRB618449: GlideRecord.addQuery(name, undefined) causes severe performance degradatio...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 01:40 PM
Can you please confirm if this is fixed on Fuji. I have tried on latest Fuji Patch 3 and it still doesn't work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 04:47 PM
Update : You have to add the below property in the table(sys_properties) with value set to true and type as "True/false".
glide.invalid_query.returns_no_rows=true
NOTE: This is fixed on Fuji Patch2.
Please mark the answer as correct if this resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2015 04:31 AM
Hi Pradeep,
Yes, adding the property and setting it true in Eureka does the trick: no rows are returned from an invalid query; thanks for the quick response!
I intend to upgrade my Eureka to latest Fuji soon and wonder about the behavior on Fuji: will an invalid query simply return no rows or is an exception thrown? Does this property exist on Fuji? If set to false, what happens on an invalid query?
Garry