pingcap/tidb

Improve error message on SPATIAL types/indexes not supported

Open

#29 370 ouverte le 2 nov. 2021

Voir sur GitHub
 (10 commentaires) (1 réaction) (0 assignés)Go (6 186 forks)batch import
help wantedseverity/minorsig/sql-infratype/bugtype/compatibility

Métriques du dépôt

Stars
 (40 090 stars)
Métriques de merge PR
 (Merge moyen 14j 4h) (346 PRs mergées en 30 j)

Description

Bug Report

You can improve the parser to say this feature is not supported or a more specific error message like "SPATIAL index is not supported yet".

1. Minimal reproduce step

create table ti (pk int primary key, p point not null SRID 0, spatial index (p)) charset utf8mb4 engine=innodb;

2. What did you expect to see?

No error in MySQL

3. What did you see instead

mysql> create table ti (pk int primary key, p point not null SRID 0, spatial index (p)) charset utf8mb4 engine=innodb;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 44 near "point not null SRID 0, spatial index (p)) charset utf8mb4 engine=innodb" 

4. What is your TiDB version?

+-------------------------+--------------------------------------------------------------------------+
| Variable_name           | Value                                                                    |
+-------------------------+--------------------------------------------------------------------------+
| innodb_version          | 5.6.25                                                                   |
| protocol_version        | 10                                                                       |
| tidb_analyze_version    | 2                                                                        |
| tidb_row_format_version | 2                                                                        |
| tls_version             | TLSv1,TLSv1.1,TLSv1.2                                                    |
| version                 | 5.7.25-TiDB-v5.2.2                                                       |
| version_comment         | TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible |
| version_compile_machine | x86_64                                                                   |
| version_compile_os      | osx10.8                                                                  |
+-------------------------+--------------------------------------------------------------------------+

Guide contributeur