pingcap/tidb

Creating functional index with null column name worked in tidb

Open

#31.149 aberto em 29 de dez. de 2021

Ver no GitHub
 (1 comment) (0 reactions) (1 assignee)Go (6.186 forks)batch import
help wantedseverity/moderatesig/sql-infratype/bug

Métricas do repositório

Stars
 (40.090 stars)
Métricas de merge de PR
 (Mesclagem média 14d 4h) (346 fundiu PRs em 30d)

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t(a INT, b INT, INDEX c((null)));

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

mysql> CREATE TABLE t(a INT, b INT, INDEX c((null)));
ERROR 3761 (HY000): The used storage engine cannot index the expression 'NULL'.

3. What did you see instead (Required)

mysql> CREATE TABLE t(a INT, b INT, INDEX c((null)));
Query OK, 0 rows affected (0.07 sec)

mysql> show create table t;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                              |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `a` int(11) DEFAULT NULL,
  `b` int(11) DEFAULT NULL,
  KEY `c` ((null))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

| Release Version: v5.3.0
Edition: Community
Git Commit Hash: 4a1b2e9fe5b5afb1068c56de47adb07098d768d6
Git Branch: heads/refs/tags/v5.3.0
UTC Build Time: 2021-11-24 13:31:24
GoVersion: go1.16.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |

Guia do colaborador