Commit 5eab85b
fix: use per-query cache for masked members in collectFrom to resolve cross-cube mask joins
When a member is masked, evaluateSymbolSql takes a different code path
(mask.sql instead of regular sql), which may reference members from
other cubes requiring additional joins. The compilerCache is shared
across queries and doesn't account for masking state, so a prior
unmasked evaluation would return stale cached results.
Fix: use this.queryCache (per-query, keyed by maskedMembers) instead
of this.compilerCache for masked members in collectFrom. This ensures
masked members get fresh evaluations that include their mask SQL
dependencies.
Also fix joined mask test assertions to only query masked_order_id
(order_id has no mask definition so it gets default NULL mask).
Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>1 parent a2a6fc9 commit 5eab85b
2 files changed
Lines changed: 13 additions & 15 deletions
File tree
- packages
- cubejs-schema-compiler/src/adapter
- cubejs-testing/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2846 | 2846 | | |
2847 | 2847 | | |
2848 | 2848 | | |
2849 | | - | |
2850 | | - | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
2851 | 2852 | | |
2852 | 2853 | | |
2853 | 2854 | | |
2854 | 2855 | | |
2855 | | - | |
2856 | | - | |
| 2856 | + | |
| 2857 | + | |
2857 | 2858 | | |
2858 | 2859 | | |
2859 | 2860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
867 | | - | |
| 866 | + | |
| 867 | + | |
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
977 | | - | |
| 977 | + | |
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
982 | | - | |
983 | | - | |
984 | | - | |
| 982 | + | |
| 983 | + | |
985 | 984 | | |
986 | 985 | | |
987 | 986 | | |
| |||
1165 | 1164 | | |
1166 | 1165 | | |
1167 | 1166 | | |
1168 | | - | |
| 1167 | + | |
1169 | 1168 | | |
1170 | 1169 | | |
1171 | 1170 | | |
| |||
1235 | 1234 | | |
1236 | 1235 | | |
1237 | 1236 | | |
1238 | | - | |
| 1237 | + | |
1239 | 1238 | | |
1240 | 1239 | | |
1241 | 1240 | | |
1242 | 1241 | | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
| 1242 | + | |
1246 | 1243 | | |
1247 | 1244 | | |
1248 | 1245 | | |
| |||
0 commit comments