Skip to content

data branch protect snapshot insert breaks when source identifiers contain apostrophes #24925

Closed as not planned

Description

@Ariznawlll

Bug

When DATA BRANCH CREATE TABLE writes the branch-protect snapshot row into mo_snapshots, source account/database/table names are interpolated into a SQL string literal. If a legal identifier contains an apostrophe, the internal insert SQL is malformed.

Reproduce

drop database if exists br_matrix_quoted;
create database br_matrix_quoted;
use br_matrix_quoted;
create table `quote'src`(a int primary key, b varchar(20));\ninsert into `quote'src` values (1, 'single-quote');\ndata branch create table `quote'dst` from `quote'src`;\nselect count(*) from `quote'dst`;\n```\n\n## Expected behavior\n\nThe branch table should be created successfully and the branch-protect snapshot metadata insert should escape string literals correctly.\n\n## Notes\n\nThe branch-protect snapshot insert should escape single quotes in account/database/table names before embedding them in SQL string literals.

Activity

  1. Ariznawlll commented on Jun 11, 2026

    @Ariznawlll
    CollaboratorAuthor

    Consolidated into #24924, which tracks the data branch quoted-identifier behavior bugs together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions