Skip to main content
Question

Smoke test gives false positive?

  • July 27, 2026
  • 1 reply
  • 17 views

Forum|alt.badge.img+6

I have a few smoke tests that seem to be weird.
I have a prefilter like:

t1.sales_manager_user_id = (select top (1) u.user_id from dbo.users as u where u.tsf_user = dbo.tsf_user() and u.sales_manager = 1)

My dev user isn't setup in dbo.users so dbo.tsf_user() won’t find me.

The smoke test tests:


-- Prefilter appointment_list.i_am_sales_manager
select top 1 *
from (
select
0 as tsf_dummy
from "appointment_list" t1
) t1
where sales_manager_user_id = (select top (1) u.user_id from dbo.users as u where u.tsf_user = dbo.tsf_user() and u.sales_manager = 1)

and gives:

Invalid column name 'sales_manager_user_id'.

But the colum does exist in dbo.appointment_list but it doesn't in the subquery that is used by the smoketest generator (what is tsf_dummy doing here?):

select 0 as tsf_dummy from "appointment_list" t1

In my perception the prefilter query is added in runtime as a simple where clause:

SELECT *
FROM "appointment_list" t1
WHERE sales_manager_user_id = (
SELECT TOP (1)
u.user_id
FROM dbo.users AS u
WHERE u.tsf_user = dbo.tsf_user()
AND u.sales_manager = 1
);

And this works flawlessly.

Am I missing someting or is my smoketest missing something?
🤔

 

1 reply

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • July 27, 2026

The columns referencing the source table should be prefixed with t1 so they are recognized properly by the platform.

The column sales_manager_user_id doesn't seem to be prefixed in the final query.

If this is not possible, Lenient prefilter queries should be turned on.