Running MySQL in ANSI Mode
20
For more information on setting the SQL mode, see
Section 5.1.7, “Server SQL Modes”
.
1.8.3. Running MySQL in ANSI Mode
You can tell
mysqld
to run in ANSI mode with the
--ansi
[401]
startup option. Running the server in
ANSI mode is the same as starting it with the following options:
--transaction-isolation=SERIALIZABLE --sql-mode=ANSI
You can achieve the same effect at runtime by executing these two statements:
SET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET GLOBAL sql_mode = 'ANSI';
You can see that setting the
sql_mode
[495]
system variable to
'ANSI'
enables all SQL mode
options that are relevant for ANSI mode as follows:
mysql>
SET GLOBAL sql_mode='ANSI';
mysql>
SELECT @@global.sql_mode;
-> 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI'
Running the server in ANSI mode with
--ansi
[401]
is not quite the same as setting the SQL mode
to
'ANSI'
. The
--ansi
[401]
option affects the SQL mode and also sets the transaction isolation
level. Setting the SQL mode to
'ANSI'
has no effect on the isolation level.
See
Section 5.1.3, “Server Command Options”
, and
Section 1.8.2, “Selecting SQL Modes”
.
1.8.4. MySQL Extensions to Standard SQL
MySQL Server supports some extensions that you probably won't find in other SQL DBMSs. Be
warned that if you use them, your code won't be portable to other SQL servers. In some cases, you can
write code that includes MySQL extensions, but is still portable, by using comments of the following
form:
/*!
MySQL-specific code
*/
In this case, MySQL Server parses and executes the code within the comment as it would any other
SQL statement, but other SQL servers will ignore the extensions. For example, MySQL Server
recognizes the
STRAIGHT_JOIN
keyword in the following statement, but other servers will not:
SELECT /*! STRAIGHT_JOIN */ col1 FROM table1,table2 WHERE ...
If you add a version number after the “
!
” character, the syntax within the comment is executed only if
the MySQL version is greater than or equal to the specified version number. The
TEMPORARY
keyword
in the following comment is executed only by servers from MySQL 3.23.02 or higher:
CREATE /*!32302 TEMPORARY */ TABLE t (a INT);
The following descriptions list MySQL extensions, organized by category.
• Organization of data on disk
MySQL Server maps each database to a directory under the MySQL data directory, and maps tables
within a database to file names in the database directory. This has a few implications:
• Database and table names are case sensitive in MySQL Server on operating systems that
have case-sensitive file names (such as most Unix systems). See
Section 9.2.2, “Identifier Case
Sensitivity”
.
• You can use standard system commands to back up, rename, move, delete, and copy tables that
are managed by the
MyISAM
storage engine. For example, it is possible to rename a
MyISAM
table
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...