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" t1In 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? 🤔

