Skip to content

analyze cannot be with json's virtual column #57079

@hawkingrei

Description

@hawkingrei

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t1` (
  `id` bigint(20) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */ ,
  `c1` json DEFAULT NULL ,
  `c2` varchar(255) GENERATED ALWAYS AS (json_unquote(json_extract(`c1`, '$.code'))) VIRTUAL ,
  PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin /*T![auto_rand_base] AUTO_RANDOM_BASE=7765648957 */ ;
analyze table t1

2. What did you expect to see? (Required)

succeed to run

3. What did you see instead (Required)

(1054, "Unknown column 'c1' in 'expression'")

4. What is your TiDB version? (Required)

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.4This bug affects the 5.4.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.report/communityThe community has encountered this bug.severity/moderatesig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions