Author: paul
Date: 2006-02-02 21:08:11 +0100 (Thu, 02 Feb 2006)
New Revision: 1188
Log:
r2797@kite-hub: paul | 2006-02-02 12:56:35 -0600
Revise system variable sections.
Modified:
trunk/
trunk/refman-4.1/database-administration.xml
trunk/refman-4.1/language-structure.xml
trunk/refman-5.0/database-administration.xml
trunk/refman-5.0/language-structure.xml
trunk/refman-5.1/database-administration.xml
trunk/refman-5.1/language-structure.xml
trunk/refman-common/titles.en.ent
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:7055
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2793
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:7055
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2797
Modified: trunk/refman-4.1/database-administration.xml
===================================================================
--- trunk/refman-4.1/database-administration.xml 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-4.1/database-administration.xml 2006-02-02 20:08:11 UTC (rev 1188)
@@ -2010,10 +2010,6 @@
<title>&title-server-system-variables;</title>
- <remark role="todo">
- not a great node name; there is also a System Variables node.
- </remark>
-
<indexterm>
<primary>system variables</primary>
</indexterm>
@@ -2033,11 +2029,15 @@
</indexterm>
<para>
- The server maintains many system variables that indicate how
- it is configured. All of them have default values. They can be
- set at server startup using options on the command line or in
- option files. Most of them can be set at runtime using the
- <literal>SET</literal> statement.
+ The <command>mysqld</command> server maintains many system
+ variables that indicate how it is configured. All of them have
+ default values. They can be set at server startup using
+ options on the command line or in option files. Most of them
+ can be changed dynamically while the server is running by
+ means of the <literal>SET</literal> statement, which enables
+ you to modify operation of the server without having to stop
+ and restart it. Also, you can refer to their values in
+ expressions.
</para>
<para>
@@ -2054,16 +2054,12 @@
<option>--delay_key_write=ON</option> does not.
</para>
- <remark role="note">
- The next few paragraphs also appear in system-variables. If
- you make changes one place, change them both.
- </remark>
-
<para>
- Beginning with MySQL 4.0.3, the <command>mysqld</command>
- server maintains two kinds of variables. Global variables
- affect the overall operation of the server. Session variables
- affect its operation for individual client connections.
+ Beginning with MySQL 4.0.3, the server maintains two kinds of
+ system variables. Global variables affect the overall
+ operation of the server. Session variables affect its
+ operation for individual client connections. A given system
+ variable can have both a global and a session value.
</para>
<para>
@@ -2072,8 +2068,9 @@
specified in option files or on the command line. After the
server starts, those global variables that are dynamic can be
changed by connecting to the server and issuing a <literal>SET
- GLOBAL <replaceable>var_name</replaceable></literal>
- statement. To change a global variable, you must have the
+ GLOBAL <replaceable>var_name</replaceable> =
+ <replaceable>value</replaceable></literal> statement. To
+ change a global variable, you must have the
<literal>SUPER</literal> privilege.
</para>
@@ -2081,23 +2078,27 @@
The server also maintains a set of session variables for each
client that connects. The client's session variables are
initialized at connect time using the current values of the
- corresponding global variables. For those session variables
- that are dynamic, the client can change them by issuing a
- <literal>SET SESSION
- <replaceable>var_name</replaceable></literal> statement.
- Setting a session variable requires no special privilege, but
- a client can change only its own session variables, not those
- of any other client.
+ corresponding global variables. For example, the client's SQL
+ mode is controlled by the session <literal>sql_mode</literal>
+ value, which is initiated when the client connects to the
+ value of the global <literal>sql_mode</literal> value. For
+ those session variables that are dynamic, the client can
+ change them by issuing a <literal>SET SESSION
+ <replaceable>var_name</replaceable> =
+ <replaceable>value</replaceable></literal> statement. Setting
+ a session variable requires no special privilege, but a client
+ can change only its own session variables, not those of any
+ other client.
</para>
<para>
A change to a global variable is visible to any client that
- accesses that global variable. However, it affects the
- corresponding session variable that is initialized from the
- global variable only for clients that connect after the
- change. It does not affect the session variable for any client
- that is currently connected (not even that of the client that
- issues the <literal>SET GLOBAL</literal> statement).
+ accesses that global variable. However, the change affects the
+ corresponding session variable only for clients that connect
+ after the change. The global variable change does not affect
+ the session variable for any client that is currently
+ connected (not even that of the client that issues the
+ <literal>SET GLOBAL</literal> statement).
</para>
<para>
@@ -2110,12 +2111,12 @@
1024<superscript>3</superscript>. For example, when used to
set <literal>key_buffer_size</literal>, the suffixes indicate
units of kilobytes, megabytes, or gigabygtes. Thus, the
- following command starts the server with a key buffer size of
+ following command starts the server with a query cache size of
16 megabytes:
</para>
<programlisting>
-mysqld --key_buffer_size=16M
+mysqld --query_cache_size=16M
</programlisting>
<para>
@@ -2123,7 +2124,7 @@
</para>
<programlisting>
-mysqld --set-variable=key_buffer_size=16M
+mysqld --set-variable=query_cache_size=16M
</programlisting>
<para>
@@ -2133,9 +2134,9 @@
</para>
<para>
- At runtime, use the <literal>SET</literal> statement to set
- system variables. In this context, suffix letters cannot be
- used, but the value can take the form of an expression:
+ When you assign a value to a system variable with
+ <literal>SET</literal>, you cannot use suffix letters in the
+ value. However, the value can take the form of an expression:
</para>
<programlisting>
@@ -2145,7 +2146,7 @@
<para>
To specify explicitly whether to set the global or session
variable, use the <literal>GLOBAL</literal> or
- <literal>SESSION</literal> options:
+ <literal>SESSION</literal> modifier:
</para>
<programlisting>
@@ -2154,19 +2155,10 @@
</programlisting>
<para>
- Without either option, the statement sets the session
- variable.
- </para>
-
- <para>
- <xref linkend="dynamic-system-variables"/>, lists the
- variables that can be set at runtime.
- </para>
-
- <para>
If you want to restrict the maximum value to which a system
- variable can be set with the <literal>SET</literal> statement,
- you can specify this maximum by using an option of the form
+ variable can be set at runtime with the <literal>SET</literal>
+ statement, you can specify this maximum by using an option of
+ the form
<option>--maximum-<replaceable>var_name</replaceable></option>
at server startup. For example, to prevent the value of
<literal>query_cache_size</literal> from being increased to
@@ -2176,9 +2168,8 @@
</para>
<para>
- You can view system variables and their values by using the
- <literal>SHOW VARIABLES</literal> statement. See
- <xref linkend="system-variables"/>, for more information.
+ To view system variables and their values, use the
+ <literal>SHOW VARIABLES</literal> statement.
</para>
<programlisting>
@@ -2223,10 +2214,17 @@
+---------------------------------+-------------------------------------+
</programlisting>
- <indexterm>
- <primary>variables</primary>
- <secondary>values</secondary>
- </indexterm>
+ <para>
+ The <command>mysql</command> server maintains many system
+ variables that indicate how it is configured. All of them have
+ default values. They can be set at server startup using
+ options on the command line or in option files. Most of them
+ can be changed dynamically while the server is running by
+ means of the <literal>SET</literal> statement, which enables
+ you to modify operation of the server without having to stop
+ and restart it. Also, you can refer to their values in
+ expressions.
+ </para>
<para>
Most system variables are described here. Variables with no
@@ -2236,15 +2234,37 @@
</para>
<para>
- Values for buffer sizes, lengths, and stack sizes are given in
- bytes unless otherwise specified.
+ For information about the syntax for setting and displaying
+ system variable values, see
+ <xref linkend="using-system-variables"/>.
+ <xref linkend="dynamic-system-variables"/>, lists the
+ variables that can be set at runtime.
+ <xref linkend="innodb-parameters"/>, lists
+ <literal>InnoDB</literal> system variables. Information on
+ tuning sytem variables can be found in
+ <xref linkend="server-parameters"/>.
</para>
<para>
- Information on tuning these variables can be found in
- <xref linkend="server-parameters"/>.
+ <emphasis>Note</emphasis>: Several system variables can be
+ enabled with the <literal>SET</literal> statement by setting
+ them to <literal>ON</literal> or <literal>1</literal>.
+ Similarly, they can be disabled with <literal>SET</literal> by
+ setting them to <literal>OFF</literal> or
+ <literal>0</literal>. To set such variables on the command
+ line or in option files, you must set them to
+ <literal>1</literal> or <literal>0</literal>; setting them to
+ <literal>ON</literal> or <literal>OFF</literal> will not work.
+ For example, on the command line,
+ <option>--delay_key_write=1</option> works but
+ <option>--delay_key_write=ON</option> does not.
</para>
+ <para>
+ Values for buffer sizes, lengths, and stack sizes are given in
+ bytes unless otherwise specified.
+ </para>
+
<itemizedlist>
<listitem>
@@ -5320,6 +5340,21 @@
</itemizedlist>
+ </refsection>
+
+ <refsection id="using-system-variables">
+
+ <title>&title-using-system-variables;</title>
+
+ <indexterm>
+ <primary>system variables</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>variables</primary>
+ <secondary>system</secondary>
+ </indexterm>
+
<refsection id="dynamic-system-variables">
<title>&title-dynamic-system-variables;</title>
@@ -5329,7 +5364,7 @@
dynamic and can be set at runtime using <literal>SET
GLOBAL</literal> or <literal>SET SESSION</literal>. You can
also select their values using <literal>SELECT</literal>.
- See <xref linkend="system-variables"/>.
+ See <xref linkend="using-system-variables"/>.
</para>
<para>
Modified: trunk/refman-4.1/language-structure.xml
===================================================================
--- trunk/refman-4.1/language-structure.xml 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-4.1/language-structure.xml 2006-02-02 20:08:11 UTC (rev 1188)
@@ -1571,14 +1571,14 @@
<para>
<literal>LOCAL</literal> is a synonym for
- <literal>SESSION</literal>.
+ <literal>SESSION</literal> and <literal>@@local.</literal> is a
+ synonym for <literal>@@session.</literal>.
</para>
<para>
- If you don't specify <literal>GLOBAL</literal>,
- <literal>SESSION</literal>, or <literal>LOCAL</literal> when
- setting a variable, <literal>SESSION</literal> is the default. See
- <xref linkend="set-option"/>.
+ If you specify no <literal>GLOBAL</literal> or
+ <literal>SESSION</literal> modifier when setting a variable, the
+ statement sets the session value.
</para>
<para>
@@ -1590,6 +1590,14 @@
</para>
<para>
+ To prevent incorrect usage, MySQL produces an error if you use
+ <literal>SET GLOBAL</literal> with a variable that can only be
+ used with <literal>SET SESSION</literal> or if you do not specify
+ <literal>GLOBAL</literal> (or <literal>@@global.</literal>) when
+ setting a global variable.
+ </para>
+
+ <para>
To retrieve the value of a <literal>GLOBAL</literal> variable, use
one of the following statements:
</para>
Modified: trunk/refman-5.0/database-administration.xml
===================================================================
--- trunk/refman-5.0/database-administration.xml 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-5.0/database-administration.xml 2006-02-02 20:08:11 UTC (rev 1188)
@@ -1985,15 +1985,19 @@
</indexterm>
<remark role="todo">
- not a great node name; there is also a System Variables node.
+ Make the following reference to RefMan-4.1 a link.
</remark>
<para>
- The server maintains many system variables that indicate how
- it is configured. All of them have default values. They can be
- set at server startup using options on the command line or in
- option files. Most of them can be set at runtime using the
- <literal>SET</literal> statement.
+ The <command>mysqld</command> server maintains many system
+ variables that indicate how it is configured. All of them have
+ default values. They can be set at server startup using
+ options on the command line or in option files. Most of them
+ can be changed dynamically while the server is running by
+ means of the <literal>SET</literal> statement, which enables
+ you to modify operation of the server without having to stop
+ and restart it. Also, you can refer to their values in
+ expressions.
</para>
<para>
@@ -2010,19 +2014,12 @@
<option>--delay_key_write=ON</option> does not.
</para>
- <remark role="note">
- next few paragraphs also appear in @node System Variables.
- </remark>
-
- <remark>
- If you make changes one place, change them both.
- </remark>
-
<para>
- The <command>mysqld</command> server maintains two kinds of
- variables. Global variables affect the overall operation of
- the server. Session variables affect its operation for
- individual client connections.
+ The server maintains two kinds of system variables. Global
+ variables affect the overall operation of the server. Session
+ variables affect its operation for individual client
+ connections. A given system variable can have both a global
+ and a session value.
</para>
<para>
@@ -2031,8 +2028,9 @@
specified in option files or on the command line. After the
server starts, those global variables that are dynamic can be
changed by connecting to the server and issuing a <literal>SET
- GLOBAL <replaceable>var_name</replaceable></literal>
- statement. To change a global variable, you must have the
+ GLOBAL <replaceable>var_name</replaceable> =
+ <replaceable>value</replaceable></literal> statement. To
+ change a global variable, you must have the
<literal>SUPER</literal> privilege.
</para>
@@ -2040,23 +2038,27 @@
The server also maintains a set of session variables for each
client that connects. The client's session variables are
initialized at connect time using the current values of the
- corresponding global variables. For those session variables
- that are dynamic, the client can change them by issuing a
- <literal>SET SESSION
- <replaceable>var_name</replaceable></literal> statement.
- Setting a session variable requires no special privilege, but
- a client can change only its own session variables, not those
- of any other client.
+ corresponding global variables. For example, the client's SQL
+ mode is controlled by the session <literal>sql_mode</literal>
+ value, which is initiated when the client connects to the
+ value of the global <literal>sql_mode</literal> value. For
+ those session variables that are dynamic, the client can
+ change them by issuing a <literal>SET SESSION
+ <replaceable>var_name</replaceable> =
+ <replaceable>value</replaceable></literal> statement. Setting
+ a session variable requires no special privilege, but a client
+ can change only its own session variables, not those of any
+ other client.
</para>
<para>
A change to a global variable is visible to any client that
- accesses that global variable. However, it affects the
- corresponding session variable that is initialized from the
- global variable only for clients that connect after the
- change. It does not affect the session variable for any client
- that is currently connected (not even that of the client that
- issues the <literal>SET GLOBAL</literal> statement).
+ accesses that global variable. However, the change affects the
+ corresponding session variable only for clients that connect
+ after the change. The global variable change does not affect
+ the session variable for any client that is currently
+ connected (not even that of the client that issues the
+ <literal>SET GLOBAL</literal> statement).
</para>
<para>
@@ -2069,12 +2071,12 @@
1024<superscript>3</superscript>. For example, when used to
set <literal>key_buffer_size</literal>, the suffixes indicate
units of kilobytes, megabytes, or gigabygtes. Thus, the
- following command starts the server with a key buffer size of
+ following command starts the server with a query cache size of
16 megabytes:
</para>
<programlisting>
-mysqld --key_buffer_size=16M
+mysqld --query_cache_size=16M
</programlisting>
<para>
@@ -2084,9 +2086,9 @@
</para>
<para>
- At runtime, use the <literal>SET</literal> statement to set
- system variables. In this context, suffix letters cannot be
- used, but the value can take the form of an expression:
+ When you assign a value to a system variable with
+ <literal>SET</literal>, you cannot use suffix letters in the
+ value. However, the value can take the form of an expression:
</para>
<programlisting>
@@ -2096,7 +2098,7 @@
<para>
To specify explicitly whether to set the global or session
variable, use the <literal>GLOBAL</literal> or
- <literal>SESSION</literal> options:
+ <literal>SESSION</literal> modifier:
</para>
<programlisting>
@@ -2105,19 +2107,10 @@
</programlisting>
<para>
- Without either option, the statement sets the session
- variable.
- </para>
-
- <para>
- <xref linkend="dynamic-system-variables"/>, lists the
- variables that can be set at runtime.
- </para>
-
- <para>
If you want to restrict the maximum value to which a system
- variable can be set with the <literal>SET</literal> statement,
- you can specify this maximum by using an option of the form
+ variable can be set at runtime with the <literal>SET</literal>
+ statement, you can specify this maximum by using an option of
+ the form
<option>--maximum-<replaceable>var_name</replaceable></option>
at server startup. For example, to prevent the value of
<literal>query_cache_size</literal> from being increased to
@@ -2126,9 +2119,8 @@
</para>
<para>
- You can view system variables and their values by using the
- <literal>SHOW VARIABLES</literal> statement. See
- <xref linkend="system-variables"/>, for more information.
+ To view system variables and their values, use the
+ <literal>SHOW VARIABLES</literal> statement.
</para>
<programlisting>
@@ -2179,35 +2171,58 @@
+--------+--------------------------------------------------------------+
</programlisting>
- <indexterm>
- <primary>variables</primary>
- <secondary>values</secondary>
- </indexterm>
+ <para>
+ The <command>mysql</command> server maintains many system
+ variables that indicate how it is configured. All of them have
+ default values. They can be set at server startup using
+ options on the command line or in option files. Most of them
+ can be changed dynamically while the server is running by
+ means of the <literal>SET</literal> statement, which enables
+ you to modify operation of the server without having to stop
+ and restart it. Also, you can refer to their values in
+ expressions.
+ </para>
- <remark role="todo">
- Make the following reference to RefMan-4.1 a link.
- </remark>
-
<para>
Most system variables are described here. Variables with no
version indicated are present in all MySQL ¤t-series;
releases. For historical information concerning their
implementation, please see
<citetitle>&title-refman-4-1;</citetitle>.
- <literal>InnoDB</literal> system variables are listed in
- <xref linkend="innodb-parameters"/>.
</para>
<para>
- Values for buffer sizes, lengths, and stack sizes are given in
- bytes unless otherwise specified.
+ For information about the syntax for setting and displaying
+ system variable values, see
+ <xref linkend="using-system-variables"/>.
+ <xref linkend="dynamic-system-variables"/>, lists the
+ variables that can be set at runtime.
+ <xref linkend="innodb-parameters"/>, lists
+ <literal>InnoDB</literal> system variables. Information on
+ tuning sytem variables can be found in
+ <xref linkend="server-parameters"/>.
</para>
<para>
- Information on tuning these variables can be found in
- <xref linkend="server-parameters"/>.
+ <emphasis>Note</emphasis>: Several system variables can be
+ enabled with the <literal>SET</literal> statement by setting
+ them to <literal>ON</literal> or <literal>1</literal>.
+ Similarly, they can be disabled with <literal>SET</literal> by
+ setting them to <literal>OFF</literal> or
+ <literal>0</literal>. To set such variables on the command
+ line or in option files, you must set them to
+ <literal>1</literal> or <literal>0</literal>; setting them to
+ <literal>ON</literal> or <literal>OFF</literal> will not work.
+ For example, on the command line,
+ <option>--delay_key_write=1</option> works but
+ <option>--delay_key_write=ON</option> does not.
</para>
+ <para>
+ Values for buffer sizes, lengths, and stack sizes are given in
+ bytes unless otherwise specified.
+ </para>
+
<itemizedlist>
<remark role="todo">
@@ -5598,6 +5613,21 @@
</itemizedlist>
+ </refsection>
+
+ <refsection id="using-system-variables">
+
+ <title>&title-using-system-variables;</title>
+
+ <indexterm>
+ <primary>system variables</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>variables</primary>
+ <secondary>system</secondary>
+ </indexterm>
+
<refsection id="dynamic-system-variables">
<title>&title-dynamic-system-variables;</title>
@@ -5607,7 +5637,7 @@
runtime using <literal>SET GLOBAL</literal> or <literal>SET
SESSION</literal>. You can also obtain their values using
<literal>SELECT</literal>. See
- <xref linkend="system-variables"/>.
+ <xref linkend="using-system-variables"/>.
</para>
<para>
Modified: trunk/refman-5.0/language-structure.xml
===================================================================
--- trunk/refman-5.0/language-structure.xml 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-5.0/language-structure.xml 2006-02-02 20:08:11 UTC (rev 1188)
@@ -1554,14 +1554,14 @@
<para>
<literal>LOCAL</literal> is a synonym for
- <literal>SESSION</literal>.
+ <literal>SESSION</literal> and <literal>@@local.</literal> is a
+ synonym for <literal>@@session.</literal>.
</para>
<para>
- If you don't specify <literal>GLOBAL</literal>,
- <literal>SESSION</literal>, or <literal>LOCAL</literal> when
- setting a variable, <literal>SESSION</literal> is the default. See
- <xref linkend="set-option"/>.
+ If you specify no <literal>GLOBAL</literal> or
+ <literal>SESSION</literal> modifier when setting a variable, the
+ statement sets the session value.
</para>
<para>
@@ -1573,6 +1573,14 @@
</para>
<para>
+ To prevent incorrect usage, MySQL produces an error if you use
+ <literal>SET GLOBAL</literal> with a variable that can only be
+ used with <literal>SET SESSION</literal> or if you do not specify
+ <literal>GLOBAL</literal> (or <literal>@@global.</literal>) when
+ setting a global variable.
+ </para>
+
+ <para>
To retrieve the value of a <literal>GLOBAL</literal> variable, use
one of the following statements:
</para>
Modified: trunk/refman-5.1/database-administration.xml
===================================================================
--- trunk/refman-5.1/database-administration.xml 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-5.1/database-administration.xml 2006-02-02 20:08:11 UTC (rev 1188)
@@ -2016,15 +2016,19 @@
</indexterm>
<remark role="todo">
- not a great node name; there is also a System Variables node.
+ Make the following reference to RefMan-4.1 a link.
</remark>
<para>
- The server maintains many system variables that indicate how
- it is configured. All of them have default values. They can be
- set at server startup using options on the command line or in
- option files. Most of them can be set at runtime using the
- <literal>SET</literal> statement.
+ The <command>mysqld</command> server maintains many system
+ variables that indicate how it is configured. All of them have
+ default values. They can be set at server startup using
+ options on the command line or in option files. Most of them
+ can be changed dynamically while the server is running by
+ means of the <literal>SET</literal> statement, which enables
+ you to modify operation of the server without having to stop
+ and restart it. Also, you can refer to their values in
+ expressions.
</para>
<para>
@@ -2041,19 +2045,12 @@
<option>--delay_key_write=ON</option> does not.
</para>
- <remark role="note">
- next few paragraphs also appear in @node System Variables.
- </remark>
-
- <remark>
- If you make changes one place, change them both.
- </remark>
-
<para>
- The <command>mysqld</command> server maintains two kinds of
- variables. Global variables affect the overall operation of
- the server. Session variables affect its operation for
- individual client connections.
+ The server maintains two kinds of system variables. Global
+ variables affect the overall operation of the server. Session
+ variables affect its operation for individual client
+ connections. A given system variable can have both a global
+ and a session value.
</para>
<para>
@@ -2062,8 +2059,9 @@
specified in option files or on the command line. After the
server starts, those global variables that are dynamic can be
changed by connecting to the server and issuing a <literal>SET
- GLOBAL <replaceable>var_name</replaceable></literal>
- statement. To change a global variable, you must have the
+ GLOBAL <replaceable>var_name</replaceable> =
+ <replaceable>value</replaceable></literal> statement. To
+ change a global variable, you must have the
<literal>SUPER</literal> privilege.
</para>
@@ -2071,23 +2069,27 @@
The server also maintains a set of session variables for each
client that connects. The client's session variables are
initialized at connect time using the current values of the
- corresponding global variables. For those session variables
- that are dynamic, the client can change them by issuing a
- <literal>SET SESSION
- <replaceable>var_name</replaceable></literal> statement.
- Setting a session variable requires no special privilege, but
- a client can change only its own session variables, not those
- of any other client.
+ corresponding global variables. For example, the client's SQL
+ mode is controlled by the session <literal>sql_mode</literal>
+ value, which is initiated when the client connects to the
+ value of the global <literal>sql_mode</literal> value. For
+ those session variables that are dynamic, the client can
+ change them by issuing a <literal>SET SESSION
+ <replaceable>var_name</replaceable> =
+ <replaceable>value</replaceable></literal> statement. Setting
+ a session variable requires no special privilege, but a client
+ can change only its own session variables, not those of any
+ other client.
</para>
<para>
A change to a global variable is visible to any client that
- accesses that global variable. However, it affects the
- corresponding session variable that is initialized from the
- global variable only for clients that connect after the
- change. It does not affect the session variable for any client
- that is currently connected (not even that of the client that
- issues the <literal>SET GLOBAL</literal> statement).
+ accesses that global variable. However, the change affects the
+ corresponding session variable only for clients that connect
+ after the change. The global variable change does not affect
+ the session variable for any client that is currently
+ connected (not even that of the client that issues the
+ <literal>SET GLOBAL</literal> statement).
</para>
<para>
@@ -2100,12 +2102,12 @@
1024<superscript>3</superscript>. For example, when used to
set <literal>key_buffer_size</literal>, the suffixes indicate
units of kilobytes, megabytes, or gigabygtes. Thus, the
- following command starts the server with a key buffer size of
+ following command starts the server with a query cache size of
16 megabytes:
</para>
<programlisting>
-mysqld --key_buffer_size=16M
+mysqld --query_cache_size=16M
</programlisting>
<para>
@@ -2115,9 +2117,9 @@
</para>
<para>
- At runtime, use the <literal>SET</literal> statement to set
- system variables. In this context, suffix letters cannot be
- used, but the value can take the form of an expression:
+ When you assign a value to a system variable with
+ <literal>SET</literal>, you cannot use suffix letters in the
+ value. However, the value can take the form of an expression:
</para>
<programlisting>
@@ -2127,7 +2129,7 @@
<para>
To specify explicitly whether to set the global or session
variable, use the <literal>GLOBAL</literal> or
- <literal>SESSION</literal> options:
+ <literal>SESSION</literal> modifier:
</para>
<programlisting>
@@ -2136,19 +2138,10 @@
</programlisting>
<para>
- Without either option, the statement sets the session
- variable.
- </para>
-
- <para>
- <xref linkend="dynamic-system-variables"/>, lists the
- variables that can be set at runtime.
- </para>
-
- <para>
If you want to restrict the maximum value to which a system
- variable can be set with the <literal>SET</literal> statement,
- you can specify this maximum by using an option of the form
+ variable can be set at runtime with the <literal>SET</literal>
+ statement, you can specify this maximum by using an option of
+ the form
<option>--maximum-<replaceable>var_name</replaceable></option>
at server startup. For example, to prevent the value of
<literal>query_cache_size</literal> from being increased to
@@ -2157,9 +2150,8 @@
</para>
<para>
- You can view system variables and their values by using the
- <literal>SHOW VARIABLES</literal> statement. See
- <xref linkend="system-variables"/>, for more information.
+ To view system variables and their values, use the
+ <literal>SHOW VARIABLES</literal> statement.
</para>
<programlisting>
@@ -2203,15 +2195,18 @@
+---------------------------------+--------------------------------------+
</programlisting>
- <indexterm>
- <primary>variables</primary>
- <secondary>values</secondary>
- </indexterm>
+ <para>
+ The <command>mysql</command> server maintains many system
+ variables that indicate how it is configured. All of them have
+ default values. They can be set at server startup using
+ options on the command line or in option files. Most of them
+ can be changed dynamically while the server is running by
+ means of the <literal>SET</literal> statement, which enables
+ you to modify operation of the server without having to stop
+ and restart it. Also, you can refer to their values in
+ expressions.
+ </para>
- <remark role="todo">
- Make the following reference to RefMan-4.1 a link.
- </remark>
-
<para>
Most system variables are described here. Variables with no
version indicated are present in all MySQL ¤t-series;
@@ -2219,20 +2214,40 @@
implementation, please see
<citetitle>&title-refman-previous;</citetitle> and
<citetitle>&title-refman-4-1;</citetitle>.
- <literal>InnoDB</literal> system variables are listed in
- <xref linkend="innodb-parameters"/>.
</para>
<para>
- Values for buffer sizes, lengths, and stack sizes are given in
- bytes unless otherwise specified.
+ For information about the syntax for setting and displaying
+ system variable values, see
+ <xref linkend="using-system-variables"/>.
+ <xref linkend="dynamic-system-variables"/>, lists the
+ variables that can be set at runtime.
+ <xref linkend="innodb-parameters"/>, lists
+ <literal>InnoDB</literal> system variables. Information on
+ tuning sytem variables can be found in
+ <xref linkend="server-parameters"/>.
</para>
<para>
- Information on tuning these variables can be found in
- <xref linkend="server-parameters"/>.
+ <emphasis>Note</emphasis>: Several system variables can be
+ enabled with the <literal>SET</literal> statement by setting
+ them to <literal>ON</literal> or <literal>1</literal>.
+ Similarly, they can be disabled with <literal>SET</literal> by
+ setting them to <literal>OFF</literal> or
+ <literal>0</literal>. To set such variables on the command
+ line or in option files, you must set them to
+ <literal>1</literal> or <literal>0</literal>; setting them to
+ <literal>ON</literal> or <literal>OFF</literal> will not work.
+ For example, on the command line,
+ <option>--delay_key_write=1</option> works but
+ <option>--delay_key_write=ON</option> does not.
</para>
+ <para>
+ Values for buffer sizes, lengths, and stack sizes are given in
+ bytes unless otherwise specified.
+ </para>
+
<itemizedlist>
<remark role="todo">
@@ -5711,6 +5726,21 @@
</itemizedlist>
+ </refsection>
+
+ <refsection id="using-system-variables">
+
+ <title>&title-using-system-variables;</title>
+
+ <indexterm>
+ <primary>system variables</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>variables</primary>
+ <secondary>system</secondary>
+ </indexterm>
+
<refsection id="dynamic-system-variables">
<title>&title-dynamic-system-variables;</title>
@@ -5720,7 +5750,7 @@
runtime using <literal>SET GLOBAL</literal> or <literal>SET
SESSION</literal>. You can also obtain their values using
<literal>SELECT</literal>. See
- <xref linkend="system-variables"/>.
+ <xref linkend="using-system-variables"/>.
</para>
<para>
Modified: trunk/refman-5.1/language-structure.xml
===================================================================
--- trunk/refman-5.1/language-structure.xml 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-5.1/language-structure.xml 2006-02-02 20:08:11 UTC (rev 1188)
@@ -1554,14 +1554,14 @@
<para>
<literal>LOCAL</literal> is a synonym for
- <literal>SESSION</literal>.
+ <literal>SESSION</literal> and <literal>@@local.</literal> is a
+ synonym for <literal>@@session.</literal>.
</para>
<para>
- If you don't specify <literal>GLOBAL</literal>,
- <literal>SESSION</literal>, or <literal>LOCAL</literal> when
- setting a variable, <literal>SESSION</literal> is the default. See
- <xref linkend="set-option"/>.
+ If you specify no <literal>GLOBAL</literal> or
+ <literal>SESSION</literal> modifier when setting a variable, the
+ statement sets the session value.
</para>
<para>
@@ -1573,6 +1573,14 @@
</para>
<para>
+ To prevent incorrect usage, MySQL produces an error if you use
+ <literal>SET GLOBAL</literal> with a variable that can only be
+ used with <literal>SET SESSION</literal> or if you do not specify
+ <literal>GLOBAL</literal> (or <literal>@@global.</literal>) when
+ setting a global variable.
+ </para>
+
+ <para>
To retrieve the value of a <literal>GLOBAL</literal> variable, use
one of the following statements:
</para>
Modified: trunk/refman-common/titles.en.ent
===================================================================
--- trunk/refman-common/titles.en.ent 2006-02-02 20:07:38 UTC (rev 1187)
+++ trunk/refman-common/titles.en.ent 2006-02-02 20:08:11 UTC (rev 1188)
@@ -1671,6 +1671,7 @@
<!ENTITY title-using-log-files "Using Log Files to Find Cause of Errors in <command>mysqld</command>">
<!ENTITY title-using-mysql-programs "Using MySQL Programs">
<!ENTITY title-using-stack-trace "Using a Stack Trace">
+<!ENTITY title-using-system-variables "Using System Variables">
<!ENTITY title-using-triggers "Using Triggers">
<!ENTITY title-variables-in-stored-procedures "Variables in Stored Routines">
<!ENTITY title-vb-types "How Do I Map Visual Basic Data Types to MySQL Types?">
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1188 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-common | paul | 2 Feb |