pingcap / pingcap/tidb

The error code not same for `REGEXP`function

Open
#58,277 3 comments 0 reactions 0 assignees View on GitHub
compatibility-mysql80 severity/minor sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

```
SELECT 'ghi' REGEXP 'ghi[';
```

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

```
mysql> SELECT 'ghi' REGEXP 'ghi[';
ERROR 3696 (HY000): The regular expression contains an unclosed bracket expression.
```

### 3. What did you see instead (Required)

```
mysql> SELECT 'ghi' REGEXP 'ghi[';
ERROR 1139 (42000): Got error 'error parsing regexp: missing closing ]: `[`' from regexp
```

### 4. What is your TiDB version? (Required)

```
mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.5.0-alpha-343-g59dff48ea2
Edition: Community
Git Commit Hash: 59dff48ea2ea17f823f47ece9ef3a15209645bb4
Git Branch: master
UTC Build Time: 2024-12-16 03:41:31
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.