pingcap/tidb

The query in slow log can't be parsed when there is single comment in sql

Open

#30.886 geöffnet am 20. Dez. 2021

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (6.186 Forks)batch import
help wantedseverity/moderatesig/sql-infratype/bug

Repository-Metriken

Stars
 (40.090 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

If we execute the sql with tidb, and image it is a slow query.

select count(*) from t x ,t y
-- condition
where x.a<y.a
and x.a is not null -- comment

The query recorded in tidb slow log is select count(*) from t x ,t y -- condition where x.a<y.a and x.a is not null -- comment; , and we can't parse the sql correctly because we can't identify which sentences are commented. Compared with tidb,the mysql slow query in the log is

select count(*) from t x ,t y
-- condition
where x.a<y.a
and x.a is not null -- comment;

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

same with mysql

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

Contributor Guide