Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the doc of comment #564

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 11 additions & 23 deletions docs/MatrixOne/Reference/Language-Structure/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,56 +56,44 @@ MatrixOne supports three comment styles:
1 row in set (0.01 sec)
```

## MySQL-compatible comment syntax
## MatrixOne specific comment syntax

The same as MySQL, MatrixOne supports a variant of C comment style:
- MatrixOne supports C comment style as below:

```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)
```

Or:

```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 specific comment syntax

MatrixOne supports a variant of C comment style:
- MatrixOne dose not support C comment style as below:

```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";
```

Or:

```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";
```

## Constraints
Expand Down
Loading