Skip to content

Comments

This document describes the comment syntax supported by MatrixOne.

MatrixOne supports the following annotation formats:

  • Use # comments:
mysql> select 100-99; # Comment content
+-------------+
| 100 - 99 |
+-------------+
| 1 |
+-------------+
1 row in set (0.01 sec)
  • Use -- to comment a line. -- (double dash) comment style requires that the second dash be followed by at least one space or control character (such as spaces, tabs, line breaks, etc.).
mysql> select 100-99; -- Comment content
+-------------+
| 100 - 99 |
+-------------+
| 1 |
+-------------+
1 row in set (0.01 sec)
  • The comment content starts with /* and ends with */, the same way it is used in C. This syntax allows comments to be extended to multiple lines.
mysql> select 100 /* Comment content */ -99;
+-------------+
| 100 - 99 |
+-------------+
| 1 |
+-------------+
1 row in set (0.01 sec)

or:

mysql> select 100
/*
Comment content
*/
-99;
+-------------+
| 100 - 99 |
+-------------+
| 1 |
+-------------+
1 row in set (0.01 sec)

MatrixOne Executable Annotation Syntax

  • MatrixOne supports C language annotation format:
mysql> select 100-99; // This comment continues to the end of line
+-------------+
| 100 - 99 |
+-------------+
| 1 |
+-------------+
1 row in set (0.03 sec)

or:

mysql> // This comment continues to the line
    -> select 100-99;
+-------------+
| 100 - 99 |
+-------------+
| 1 |
+-------------+
  • C language annotation formats that MatrixOne does not support:
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:

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

limit

  • MatrixOne does not support nested annotations yet.