KEYWORDS

Starting from v7.6.0, TiDB provides the KEYWORDS table. You can use this table to get information about keywords in TiDB.

  1. USE INFORMATION_SCHEMA;
  2. DESC keywords;

The output is as follows:

  1. +----------+--------------+------+------+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +----------+--------------+------+------+---------+-------+
  4. | WORD | varchar(128) | YES | | NULL | |
  5. | RESERVED | int(11) | YES | | NULL | |
  6. +----------+--------------+------+------+---------+-------+
  7. 2 rows in set (0.00 sec)

Field description:

  • WORD: The keyword.
  • RESERVED: Whether the keyword is reserved.

The following statement queries the information about ADD and USER keywords:

  1. SELECT * FROM INFORMATION_SCHEMA.KEYWORDS WHERE WORD IN ('ADD','USER');

From the output, you can see that ADD is a reserved keyword and USER is a non-reserved keyword.

  1. +------+----------+
  2. | WORD | RESERVED |
  3. +------+----------+
  4. | ADD | 1 |
  5. | USER | 0 |
  6. +------+----------+
  7. 2 rows in set (0.00 sec)