Skip to content

Error finding temporary result set in CTE SQL statement #28919

@zihaoAK47

Description

@zihaoAK47

Bug Report

Which version of ShardingSphere did you use?

master dd44eb00aba6f63efdba6f

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

Correct execution result and return 1

Actual behavior

ERROR 10007 (42S02): Table or view cte does not exist.
12346

Reason analyze (If you can)

SimpleTableSegmentBinder.java
QQ20231102-175243

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

mysql version: 8.0.27

server.yaml

mode:
  type: Cluster
  repository:
    type: ZooKeeper
    props:
      namespace: poc_sharding
      server-lists: 127.0.0.1:2181
      retryIntervalMilliseconds: 500
      timeToLiveSeconds: 60
      maxRetries: 3
      operationTimeoutMilliseconds: 500

sqlFederation:
  sqlFederationEnabled: true
  executionPlanCache:
    initialCapacity: 2000
    maximumSize: 65535
create database test;

use test;

REGISTER STORAGE UNIT ds_0 (
    URL="jdbc:mysql://127.0.0.1:3304/test_db?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="root",
    PASSWORD="root",
    PROPERTIES("maximumPoolSize"="10","idleTimeout"="30000")
);

with cte as (select 1) select * from cte;

Example codes for reproduce this issue (such as a github link).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions