Skip to content

Can't find column with constant expression #56218

@hawkingrei

Description

@hawkingrei

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

SELECT 

            (SELECT 
                    100.00 
                FROM
                    (SELECT 
                    '2024-09-15' AS DATE ) newTb
                WHERE
                    T0.DATE = DATE_ADD(newTb.DATE, INTERVAL 1 MONTH)) AS 'PROFIT'
    FROM
        (SELECT 
        '2024-09-15' AS DATE
        ) T0
    GROUP BY T0.DATE 
     WITH ROLLUP
    ;

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

+--------+
| PROFIT |
+--------+
| <null> |
| <null> |
+--------+

3. What did you see instead (Required)

(1105, "Can't find column Column#3 in schema Column: [] Unique key: []")

4. What is your TiDB version? (Required)

+-----------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------+
| Release Version: v8.4.0-alpha-187-g3ae6470ea7 |
| Edition: Community |
| Git Commit Hash: 3ae6470 |
| Git Branch: HEAD |
| UTC Build Time: 2024-09-18 02:31:43 |
| GoVersion: go1.21.10 |
| Race Enabled: false |
| Check Table Before Drop: false |
| Store: tikv |
+-----------------------------------------------------------+

Metadata

Metadata

Assignees

Labels

affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.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