pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.36k stars 5.85k forks source link

ERROR 1105 (HY000): other error: Invalid regexp pattern #56811

Open Yriuns opened 1 month ago

Yriuns commented 1 month ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t0` (
  `c` bigint(20) unsigned zerofill NOT NULL,
  PRIMARY KEY (`c`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

SELECT t0.c FROM  t0 WHERE ((t0.c)>(((t0.c)REGEXP('{}'))));

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

query ok

3. What did you see instead (Required)

ERROR 1105 (HY000): other error: Invalid regexp pattern: Syntax(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex parse error:
    (?i){}
        ^
error: repetition operator missing expression
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.3.0
Edition: Community
Git Commit Hash: 1a0c3ac3292fff7742faa0c00a662ccb66ba40db
Git Branch: HEAD
UTC Build Time: 2024-08-20 10:23:00
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
windtalker commented 4 weeks ago

This is actually the same bug with https://github.com/pingcap/tidb/issues/48360, the root cause is the regexp lib we use in TiKV is not 100% compatible with the regexp lib we use in go.

Yriuns commented 4 weeks ago

This is actually the same bug with #48360, the root cause is the regexp lib we use in TiKV is not 100% compatible with the regexp lib we use in go.

Thanks a lot! But I noticed that the issue you refer to was open in nearly one year ago, so it will not be fixed?