11-escape.md 1.4 KB
Newer Older
D
dingbo 已提交
1
---
2 3
sidebar-label: Escape
title: Escape
D
dingbo 已提交
4 5
---

6
## Escape Characters
D
dingbo 已提交
7

8 9 10 11 12 13 14 15 16 17
| Escape Character | **Actual Meaning**       |
| :--------------: | ------------------------ |
|       `\'`       | Single quote '           |
|       `\"`       | Double quote "           |
|        \n        | Line Break               |
|        \r        | Carriage Return          |
|        \t        | tab                      |
|       `\\`       | Back Slash \             |
|       `\%`       | % see below for details  |
|       `\_`       | \_ see below for details |
D
dingbo 已提交
18 19

:::note
20
Escape characters are available from version 2.4.0.4 .
D
dingbo 已提交
21 22 23

:::

24
## Restrictions
D
dingbo 已提交
25

26 27 28 29 30 31
1. If there are escape characters in identifiers (database name, table name, column name)
   - Identifier without ``: Error will be returned because identifier must be constituted of digits, ASCII characters or underscore and can't be started with digits
   - Identifier quoted with ``: Original content is kept, no escaping
2. If there are escape characters in values
   - The escape characters will be escaped as the above table. If the escape character doesn't match any supported one, the escape character "\" will be ignored.
   - "%" and "\_" are used as wildcards in `like`. `\%` and `\_` should be used to represent literal "%" and "\_" in `like`,. If `\%` and `\_` are used out of `like` context, the evaluation result is "`\%`"and "`\_`", instead of "%" and "\_".