Skip to content

Commit

Permalink
modify the doc of comment (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrimosaprinz authored Oct 25, 2023
1 parent 1c65b4a commit bfaafeb
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions docs/MatrixOne/Reference/Language-Structure/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,58 +56,46 @@ MatrixOne 支持以下注释格式:
1 row in set (0.01 sec)
```

## MySQL 兼容的注释语法
## MatrixOne 可执行的注释语法

MatrixOne 也跟 MySQL 保持一致,支持 C 语言注释格式:
- MatrixOne 支持 C 语言注释格式:

```sql
mysql> select 100 /*! Specific code */ -99;
mysql> select 100-99; // This comment continues to the end of line
+----------+
| 100 - 99 |
+----------+
| 1 |
+----------+
1 row in set (0.02 sec)
1 row in set (0.03 sec)
```

或:

```sql
mysql> select 100 /*!50110 Specific code */ -99;
mysql> // This comment continues to the line
-> select 100-99;
+----------+
| 100 - 99 |
+----------+
| 1 |
+----------+
1 row in set (0.02 sec)
```

## MatrixOne 可执行的注释语法

MatrixOne 还支持另一种 C 语言注释格式:
- MatrixOne 不支持的 C 语言注释格式:

```sql
mysql> select 100-99; // This comment continues to the end of line
+----------+
| 100 - 99 |
+----------+
| 1 |
+----------+
1 row in set (0.03 sec)
mysql> select 100 /*! Specific code */ -99;
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 28 near " code */ -99";
```

或:

```sql
mysql> // This comment continues to the line
-> select 100-99;
+----------+
| 100 - 99 |
+----------+
| 1 |
+----------+
mysql> select 100 /*!50110 Specific code */ -99;
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 33 near " code */ -99";
```

## 限制

MatrixOne 暂不支持嵌套注释。
- MatrixOne 暂不支持嵌套注释。

0 comments on commit bfaafeb

Please sign in to comment.