10
10
whereas :ref:`configuration_options` configure Drizzle at startup and cannot
11
11
be changed without restarting Drizzle.
13
Each variable has three aspects:
15
1. Corresponding option
19
Most variables have a corresponding option which
20
initialize the variable. For example, :option:`--datadir` corresponds to
21
and initializes the variable ``datadir``. The variable name is derived
22
from the option name by stripping the option's leading ``--`` and changing
23
all ``-`` (hyphens) and ``.`` (periods) to ``_`` (underscores).
25
Dynamic variables can be changed at runtime and the change takes affect
26
immediately. Most variables, however, are static which means that they
27
only reflect the value of their corresponding option. To change a static
13
To see which variables are avaiable, execute the following:
17
drizzle> SELECT * FROM DATA_DICTIONARY.GLOBAL_VARIABLES;
18
+--------------------------------------------+--------------------+
19
| Variable_name | Value |
20
+--------------------------------------------+--------------------+
21
| auto_increment_increment | 1 |
22
| auto_increment_offset | 1 |
25
| basedir | /opt/drizzle |
26
| bulk_insert_buffer_size | 8388608 |
27
| collation_server | utf8_general_ci |
28
| completion_type | 0 |
29
| datadir | /opt/drizzle/data |
30
| div_precision_increment | 4 |
31
| drizzle_protocol_bind_address | localhost |
32
| drizzle_protocol_buffer_length | 16384 |
33
| drizzle_protocol_connect_timeout | 10 |
34
| drizzle_protocol_max_connections | 1000 |
35
| drizzle_protocol_port | 290132299 |
36
| drizzle_protocol_read_timeout | 30 |
37
| drizzle_protocol_retry_count | 10 |
38
| drizzle_protocol_write_timeout | 60 |
40
| foreign_key_checks | ON |
43
The ``DATA_DICTIONARY.GLOBAL_VARIABLES`` and
44
``DATA_DICTIONARY.SESION_VARIABLES`` views only list the available variables
45
and their current values, but internally each variable has four attributes
46
which affect how, if, and when it can be set:
53
Variable are created either by the Drizzle kernel or by a plugin.
54
Varaibles created by a plugin are prefixed with the plugin's name.
55
For example, ``drizzle_protocol_port`` is created by the
56
:doc:`/plugins/drizzle_protocol/index` plugin. Else, the variable
57
is created by the Drizzle kernel.
59
Most variables have a corresponding
60
:ref:`command line option <command_line_options>` which
61
initializes the variable. For example, :option:`--drizzle-protocol.port`
62
initializes ``drizzle_protocol_port``. Command line options are
63
converted to variable names by stripping
64
the option's leading ``--`` and changing all ``-`` (hyphens) and ``.``
65
(periods) to ``_`` (underscores). Variables without corresponding
66
command line options are are usually switches (to enable or disable
67
some feature) or counters (like ``error_count``), and these variables can
68
only be accessed or changed once Drizzle is running.
70
Dynamic variables can be changed at runtime, and the new value takes
71
affect immediately. Documentation for each variables indicates if it is
72
dynamic or not. Most variables, however, are static which means that
73
they only reflect the value of their corresponding option. To change a static
28
74
variable, you must change its corresponding option, then restart Drizzle.
29
75
Certain variables are static and do not have a corresponding option because
30
76
they are purely informational, like ``version`` and ``version_comment``.
32
All variables are global, but each connection receives a copy of all global
33
variables called session variables. A connection can change dynamic session
34
variables without affecting the rest of the server or other sessions, or it
35
can potentially change dynamic global variables which affects all connections.
36
Changes to dynamic session variables are lost when the connection is closed,
37
and changes to dynamic global variables remain in affect until changed again.
78
A variable's scope is either global, session, or both (global and session).
79
Global variables apply to all connections (each connection is a session).
80
Session variables apply to each connection and changes to a session in one
81
connection do not change or affect the same variable in another connection.
82
Changes to session variables are lost when the connection closes, but
83
changes to global variables remain in affect until changed again.
39
85
.. note:: Configuration variables and :ref:`user_defined_variables` are different. :ref:`user_defined_variables` do not affect the configuration of Drizzle, and they are always dynamic, session variables.
74
120
------------------
76
122
The ``DATA_DICTIONARY.GLOBAL_VARIABLES`` and
77
``DATA_DICTIONARY.SESSION_VARIABLES`` are views for querying the
78
global and session variables respectively. For example:
123
``DATA_DICTIONARY.SESSION_VARIABLES`` are views for querying
124
global and session variables respectively. For example, to see all
125
variables for the :doc:`/plugins/syslog/index` plugin:
80
127
.. code-block:: mysql
82
drizzle> SELECT * FROM DATA_DICTIONARY.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'max%';
83
+--------------------------+----------------+
84
| VARIABLE_NAME | VARIABLE_VALUE |
85
+--------------------------+----------------+
86
| max_allowed_packet | 67108864 |
87
| max_error_count | 64 |
88
| max_heap_table_size | 16777216 |
89
| max_join_size | 2147483647 |
90
| max_length_for_sort_data | 1024 |
91
| max_seeks_for_key | 4294967295 |
92
| max_sort_length | 1024 |
93
| max_write_lock_count | -1 |
94
+--------------------------+----------------+
129
drizzle> SELECT * FROM DATA_DICTIONARY.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'syslog_%';
130
+----------------------------------------+----------------+
131
| VARIABLE_NAME | VARIABLE_VALUE |
132
+----------------------------------------+----------------+
133
| syslog_errmsg_enable | OFF |
134
| syslog_errmsg_priority | warning |
135
| syslog_facility | local0 |
136
| syslog_logging_enable | OFF |
137
| syslog_logging_priority | warning |
138
| syslog_logging_threshold_big_examined | 0 |
139
| syslog_logging_threshold_big_resultset | 0 |
140
| syslog_logging_threshold_slow | 0 |
141
+----------------------------------------+----------------+