Skip to content

[Bug]: MySQL语法报错后解析性能直线下降 #377

Closed
@JackWang032

Description

@JackWang032

Version

v4.x

Which SQL?

MySQL

SQL content

CREATE TABLE table_97 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_97 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_97 AS
SELECT
    *
FROM
    origin_table_97;

CREATE TABLE table_98 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_98 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_98 AS
SELECT
    *
FROM
    origin_table_98;

CREATE TABLE table_99 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_99 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_99 AS
SELECT
    *
FROM
    origin_table_99;

CREATE TABLE table_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_100 AS
SELECT
    *
FROM
    origin_table_100;


CREATE TABLE table_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_100 AS
SELECT
    *
FROM
    origin_table_100;


CREATE TABLE table_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_100 AS
SELECT
    *
FROM
    origin_table_100;

SELECT 
    A.user_id,
    A.user_name,
    B.total_order_amount,
    C.average_product_price,
    D.max_order_date,
    E.min_quantity,
    F.product_category_count
FROM 
    -- has error after 'FROM'
    (SELECT user_id, user_name FROM  ) A
JOIN 
    (SELECT user_id, SUM(order_total) AS total_order_amount
     FROM orders
     GROUP BY user_id) B ON A.user_id = B.user_id
JOIN 
    (SELECT O.user_id, AVG(P.price) AS average_product_price
     FROM orders O
     JOIN order_items OI ON O.order_id = OI.order_id
     JOIN products P ON OI.product_id = P.product_id
     GROUP BY O.user_id) C ON A.user_id = C.user_id
JOIN 
    (SELECT user_id, MAX(order_date) AS max_order_date
     FROM orders
     GROUP BY user_id) D ON A.user_id = D.user_id;

JavaScript/TypeScript code

No response

What happened?

补全、语法校验卡死
iShot_2024-12-04_10 18 49

Relevant log output

No response

Metadata

Metadata

Assignees

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