pingcap / pingcap/ticdc

respect `case-sensitive` in schema store

Open
#6,096 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

severity/moderate type/bug
Dominant language
Go
Stars
56
Forks
63
Avg merge
2d 20h
Merged PRs (30d)
34

Description

What did you do?

The schema store currently uses different sources for schema/table names depending on the DDL type. Most paths use catalog metadata, while some paths use names from the original SQL or job.TableName. These values may differ only in letter case.

With case-sensitive table filters enabled, the same catalog object can therefore be treated as a different table.

The affected paths include:

  • CREATE TABLE ... LIKE: the referenced table name is parsed from SQL when checking the filter and barrier dependency.
  • RENAME TABLE and ALTER TABLE ... RENAME TO: the old table identity is reconstructed from SQL and used for filtering and barrier/name-change handling.
  • RENAME TABLES: the same issue applies to each old table name.
  • CREATE VIEW and DROP VIEW: the table name is taken from job.TableName, which may be normalized to lower case instead of preserving the catalog name.
  • TableNameStore: rename events use exact string keys, so a case mismatch may leave stale table-name entries.
What did you expect to see?

Schema store should resolve DDL objects to their catalog identities before applying table filters or updating internal name state. Original SQL casing should only be preserved where it is required for reconstructing the downstream query.

Please add focused tests covering mixed-case schema/table names with both case-sensitive and case-insensitive filters.

What did you see instead?

As described above.

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

(paste TiCDC version here)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the schema store paths for CREATE TABLE ... LIKE, RENAME TABLE(S), ALTER TABLE ... RENAME TO, CREATE/DROP VIEW, and TableNameStore rename events. Add focused tests using mixed-case schema and table names with both case-sensitive and case-insensitive filters. Done means DDL objects resolve to catalog identities for filtering and internal name state, while required downstream query reconstruction preserves original SQL casing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.