Problem with inner join transformation

Hi all!
I have two data sources: postgresql and mysql.
I have a panel variable $var. Depending on its value I have two scenarios:

  1. if $var == 1 then the first data source returns:
a b c d
a1 b1 c1 d1
a2 b2 c2 d2

And the second data source returns:

a e
a1 e1
a2 e2

I use join by field transformation: mode inner on field ‘a’. And everything works fine, just like I want it to. But I have the second scenario…

  1. if $var == 0 then first data source returns the exact same thing as in the first scenario but with the first column null:
a b c d
null b1 c1 d1
null b2 c2 d2

And the second data source always returns nothing.
So, I want to apply join transformation only for the first scenario, but not for the second one.
Is there any way to apply inner join transformation depending on the value of the variable $var?
Thanks!

P.S.
Also, this inner join transformation works in a strange way. I have two dataframes: one is empty and the other is not. But the transformation somehow joins the data anyway, although based on mathematical logic it should not.

Do you want to get empty result when column a has null values?

I think you can achieve that by filtering out null values using Filter data by values transformation before Join by field:

No, let me try to clarify:
Case 1:
Both data frames is not empty ($var = 1) → apply inner join
Case 2:
One data frame is empty and the other is not ($var = 0) → show only a non-empty result and do not apply inner join

I would try to return dummy data instead of empty response by datasource means to make join work, or may be consider another join types…

Thank you! Using dummy data really helped fix the problem, but I still regard it as a bug because inner join should works differently.