概述
列表视图对可空字段做 IS NULL 过滤时,唯一真正生效的是 { field, operator: 'equals', value: null }(映射成查询 op =,引擎把 ["field","=",null] 当 IS NULL)。其余写法静默出错:
operator: 'is' / 'is_null' → 引擎发出 op is/isnull,静默忽略 → 返回整表(无报错,只是行数错——比 400 更危险,权限/分配类视图上易出安全问题)。
operator: 'is_empty' → 400 The operator "is_empty" is not permitted → 整个 grid 空白。
定位
packages/adapters/driver-sql/src/sql-driver.ts:2683-2684 —— default 分支把未知 operator 原样透传 knex,规格白名单未在数组 where 路径生效。
:2742-2776 —— 缺 $null case 处理。
期望
- 未知 operator 应报错而非静默透传返整表;
- 或让
is_null / is_empty 成为受支持的 null 判断 op,与 equals+null 语义统一。
来源(项目 dogfood):steedos-labs/os-tianshun-mtc#28
概述
列表视图对可空字段做 IS NULL 过滤时,唯一真正生效的是
{ field, operator: 'equals', value: null }(映射成查询 op=,引擎把["field","=",null]当 IS NULL)。其余写法静默出错:operator: 'is'/'is_null'→ 引擎发出 opis/isnull,静默忽略 → 返回整表(无报错,只是行数错——比 400 更危险,权限/分配类视图上易出安全问题)。operator: 'is_empty'→ 400The operator "is_empty" is not permitted→ 整个 grid 空白。定位
packages/adapters/driver-sql/src/sql-driver.ts:2683-2684—— default 分支把未知 operator 原样透传 knex,规格白名单未在数组 where 路径生效。:2742-2776—— 缺$nullcase 处理。期望
is_null/is_empty成为受支持的 null 判断 op,与equals+null 语义统一。来源(项目 dogfood):steedos-labs/os-tianshun-mtc#28