Skip to content

Commit

Permalink
modify the doc of comment (#564)
Browse files Browse the repository at this point in the history
Co-authored-by: dengn <[email protected]>
  • Loading branch information
lacrimosaprinz and dengn authored Oct 30, 2023
1 parent b8ad1cc commit 23f5d25
Showing 1 changed file with 11 additions and 23 deletions.
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

0 comments on commit 23f5d25

Please sign in to comment.