Author: paul
Date: 2006-12-21 22:51:40 +0100 (Thu, 21 Dec 2006)
New Revision: 4324
Log:
r17419@polar: paul | 2006-12-21 13:18:01 -0600
Minor wording revisions. Add example.
Modified:
trunk/refman-4.1/language-structure.xml
trunk/refman-5.0/language-structure.xml
trunk/refman-5.1/language-structure.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:17391
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:13823
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:13015
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:17419
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:13823
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:13015
Modified: trunk/refman-4.1/language-structure.xml
===================================================================
--- trunk/refman-4.1/language-structure.xml 2006-12-21 17:27:07 UTC (rev 4323)
+++ trunk/refman-4.1/language-structure.xml 2006-12-21 21:51:40 UTC (rev 4324)
Changed blocks: 3, Lines Added: 26, Lines Deleted: 13; 3531 bytes
@@ -1394,26 +1394,39 @@
</para>
<para>
- If an identifier is a reserved word, you must quote it as
- described in <xref linkend="identifiers"/>. Exception: A word that
- follows a period in a qualified name must be an identifier, so it
- need not be quoted even if it is reserved.
+ Reserved words are permitted as identifiers if you quote them as
+ described in <xref linkend="identifiers"/>:
</para>
+<programlisting>
+mysql> <userinput>CREATE TABLE interval (begin INT, end INT);</userinput>
+ERROR 1064 (42000): You have an error in your SQL syntax; check
+the manual that corresponds to your MySQL server version for
+the right syntax to use near 'interval (begin INT, end INT)'
+
+mysql> <userinput>CREATE TABLE `interval` (begin INT, end INT);</userinput>
+Query OK, 0 rows affected (0.01 sec)
+</programlisting>
+
<para>
+ Exception: A word that follows a period in a qualified name must
+ be an identifier, so it need not be quoted even if it is reserved.
+ </para>
+
+ <para>
Function names are permitted as identifiers. For example,
<literal>ABS</literal> is acceptable as a column name. However, by
default, no whitespace is allowed in function invocations between
the function name and the following
‘<literal>(</literal>’ character. This requirement
- allows a function call to be distinguished from a reference to a
- non-function call.
+ enables the parser to distinguish whether the name is used in a
+ function call or in non-function context.
</para>
<para>
- A side effect of this behavior is that omitting a space in some
- contexts causes an identifier to be interpreted as a function
- name. For example, this statement is legal:
+ A side effect of this requirement is that omitting a space in some
+ contexts causes the parser to interpret an identifier as a
+ function name. For example, this statement is legal:
</para>
<programlisting>
@@ -1421,7 +1434,7 @@
</programlisting>
<para>
- But omitting the space after <literal>abs</literal> causes a
+ But omitting the space after <literal>abs</literal> results in a
syntax error because the statement then appears to invoke the
<literal>ABS()</literal> function:
</para>
@@ -1445,14 +1458,14 @@
<para>
The words in the following table are explicitly reserved in MySQL
- ¤t-series;. At some point, you might update to a higher
+ ¤t-series;. At some point, you might upgrade to a higher
version, so it's a good idea to have a look at future reserved
words, too. You can find these in the manuals that cover higher
versions of MySQL. Most of the words in the table are forbidden by
standard SQL as column or table names (for example,
<literal>GROUP</literal>). A few are reserved because MySQL needs
- them and (currently) uses a <command>yacc</command> parser. A
- reserved word can be used as an identifier if you quote it.
+ them and uses a <command>yacc</command> parser. A reserved word
+ can be used as an identifier if you quote it.
</para>
<xi:include href="reservedwords.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Modified: trunk/refman-5.0/language-structure.xml
===================================================================
--- trunk/refman-5.0/language-structure.xml 2006-12-21 17:27:07 UTC (rev 4323)
+++ trunk/refman-5.0/language-structure.xml 2006-12-21 21:51:40 UTC (rev 4324)
Changed blocks: 3, Lines Added: 26, Lines Deleted: 13; 3531 bytes
@@ -1433,26 +1433,39 @@
</para>
<para>
- If an identifier is a reserved word, you must quote it as
- described in <xref linkend="identifiers"/>. Exception: A word that
- follows a period in a qualified name must be an identifier, so it
- need not be quoted even if it is reserved.
+ Reserved words are permitted as identifiers if you quote them as
+ described in <xref linkend="identifiers"/>:
</para>
+<programlisting>
+mysql> <userinput>CREATE TABLE interval (begin INT, end INT);</userinput>
+ERROR 1064 (42000): You have an error in your SQL syntax; check
+the manual that corresponds to your MySQL server version for
+the right syntax to use near 'interval (begin INT, end INT)'
+
+mysql> <userinput>CREATE TABLE `interval` (begin INT, end INT);</userinput>
+Query OK, 0 rows affected (0.01 sec)
+</programlisting>
+
<para>
+ Exception: A word that follows a period in a qualified name must
+ be an identifier, so it need not be quoted even if it is reserved.
+ </para>
+
+ <para>
Function names are permitted as identifiers. For example,
<literal>ABS</literal> is acceptable as a column name. However, by
default, no whitespace is allowed in function invocations between
the function name and the following
‘<literal>(</literal>’ character. This requirement
- allows a function call to be distinguished from a reference to a
- non-function call.
+ enables the parser to distinguish whether the name is used in a
+ function call or in non-function context.
</para>
<para>
- A side effect of this behavior is that omitting a space in some
- contexts causes an identifier to be interpreted as a function
- name. For example, this statement is legal:
+ A side effect of this requirement is that omitting a space in some
+ contexts causes the parser to interpret an identifier as a
+ function name. For example, this statement is legal:
</para>
<programlisting>
@@ -1460,7 +1473,7 @@
</programlisting>
<para>
- But omitting the space after <literal>abs</literal> causes a
+ But omitting the space after <literal>abs</literal> results in a
syntax error because the statement then appears to invoke the
<literal>ABS()</literal> function:
</para>
@@ -1484,14 +1497,14 @@
<para>
The words in the following table are explicitly reserved in MySQL
- ¤t-series;. At some point, you might update to a higher
+ ¤t-series;. At some point, you might upgrade to a higher
version, so it's a good idea to have a look at future reserved
words, too. You can find these in the manuals that cover higher
versions of MySQL. Most of the words in the table are forbidden by
standard SQL as column or table names (for example,
<literal>GROUP</literal>). A few are reserved because MySQL needs
- them and (currently) uses a <command>yacc</command> parser. A
- reserved word can be used as an identifier if you quote it.
+ them and uses a <command>yacc</command> parser. A reserved word
+ can be used as an identifier if you quote it.
</para>
<xi:include href="reservedwords.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Modified: trunk/refman-5.1/language-structure.xml
===================================================================
--- trunk/refman-5.1/language-structure.xml 2006-12-21 17:27:07 UTC (rev 4323)
+++ trunk/refman-5.1/language-structure.xml 2006-12-21 21:51:40 UTC (rev 4324)
Changed blocks: 3, Lines Added: 26, Lines Deleted: 13; 3531 bytes
@@ -1633,26 +1633,39 @@
</para>
<para>
- If an identifier is a reserved word, you must quote it as
- described in <xref linkend="identifiers"/>. Exception: A word that
- follows a period in a qualified name must be an identifier, so it
- need not be quoted even if it is reserved.
+ Reserved words are permitted as identifiers if you quote them as
+ described in <xref linkend="identifiers"/>:
</para>
+<programlisting>
+mysql> <userinput>CREATE TABLE interval (begin INT, end INT);</userinput>
+ERROR 1064 (42000): You have an error in your SQL syntax; check
+the manual that corresponds to your MySQL server version for
+the right syntax to use near 'interval (begin INT, end INT)'
+
+mysql> <userinput>CREATE TABLE `interval` (begin INT, end INT);</userinput>
+Query OK, 0 rows affected (0.01 sec)
+</programlisting>
+
<para>
+ Exception: A word that follows a period in a qualified name must
+ be an identifier, so it need not be quoted even if it is reserved.
+ </para>
+
+ <para>
Function names are permitted as identifiers. For example,
<literal>ABS</literal> is acceptable as a column name. However, by
default, no whitespace is allowed in function invocations between
the function name and the following
‘<literal>(</literal>’ character. This requirement
- allows a function call to be distinguished from a reference to a
- non-function call.
+ enables the parser to distinguish whether the name is used in a
+ function call or in non-function context.
</para>
<para>
- A side effect of this behavior is that omitting a space in some
- contexts causes an identifier to be interpreted as a function
- name. For example, this statement is legal:
+ A side effect of this requirement is that omitting a space in some
+ contexts causes the parser to interpret an identifier as a
+ function name. For example, this statement is legal:
</para>
<programlisting>
@@ -1660,7 +1673,7 @@
</programlisting>
<para>
- But omitting the space after <literal>abs</literal> causes a
+ But omitting the space after <literal>abs</literal> results in a
syntax error because the statement then appears to invoke the
<literal>ABS()</literal> function:
</para>
@@ -1684,14 +1697,14 @@
<para>
The words in the following table are explicitly reserved in MySQL
- ¤t-series;. At some point, you might update to a higher
+ ¤t-series;. At some point, you might upgrade to a higher
version, so it's a good idea to have a look at future reserved
words, too. You can find these in the manuals that cover higher
versions of MySQL. Most of the words in the table are forbidden by
standard SQL as column or table names (for example,
<literal>GROUP</literal>). A few are reserved because MySQL needs
- them and (currently) uses a <command>yacc</command> parser. A
- reserved word can be used as an identifier if you quote it.
+ them and uses a <command>yacc</command> parser. A reserved word
+ can be used as an identifier if you quote it.
</para>
<xi:include href="reservedwords.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r4324 - in trunk: . refman-4.1 refman-5.0 refman-5.1 | paul | 21 Dec |