Repository navigation
Support server-side column masking feature #65744
Copy link
Copy link
Open
Labels
affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.type/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Summary
Tracking issue for server-side column-level masking in TiDB.
Goal: support policy-based masking at query-result time, with optional operation restrictions and policy lifecycle management.
Scope
- New masking policy DDL / SHOW syntax
- Expression-based masking (
CASE WHEN ...,current_user(),current_role()) RESTRICT ONoperation controls- Supported masking functions and type coverage
- System table metadata (
masking_type, policy state, binding metadata) - Privilege model for policy management
Current Status (as of February 27, 2026)
- Parser phase is in progress and being iterated in dedicated PR(s)
- Design doc
- User Document
- Test Resport (internal)
v8.5 release branch for customer
Planned PR Breakdown
phase1-parser: syntax / AST / parser testsphaseX-executor|planner|privilege|infoschema: incremental runtime implementation PRs- docs PRs for design/spec alignment when needed
- Add system table mysq.tidb_masking_policy
- infoschema: add masking policy integration
- ddl related statements implementation
- column masking related builtins functions
MASK_FULLMASK_PARTIALMASK_DATEMASK_NULL SHOW MASKING POLICITIES FOR tablestatement- Make masking policy take effect (planner, executor part)
Issue found
- BR compatibility, need special handling #67052
- batch point-get code path is not covered by masking policy
Notes
- This feature is TiDB-specific (not full MySQL parity).
- Current baseline follows the latest spec revision (no backward-compat layer for pre-merge drafts).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.type/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Activity
parser,ast: support column masking grammar (#66031)
meta: add masking policy metadata (#66032)
meta,session: add mysql.tidb_masking_policy table (#66033)
infoschema: add masking policy integration (#66034)
meta,session: add mysql.tidb_masking_policy table (pingcap#66033)
ddl: support masking policy DDL (#66035)
*: add column-level masking design doc (#66563)