MySQL Extensions to Standard SQL

Nasza ocena:

5
Wyświetleń: 665
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
MySQL Extensions to Standard SQL - strona 1 MySQL Extensions to Standard SQL - strona 2 MySQL Extensions to Standard SQL - strona 3

Fragment notatki:

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
by renaming the .MYD, .MYI, and .frm files to which the table corresponds. (Nevertheless, it is
preferable to use RENAME TABLE or ALTER TABLE ... RENAME and let the server rename the
files.)
• General language syntax
• By default, strings can be enclosed by either “"” or “'”, not just by “'”. (If the
ANSI_QUOTES [618] SQL mode is enabled, strings can be enclosed only by “'” and the server
interprets strings enclosed by “"” as identifiers.)
• “\” is the escape character in strings.
• In SQL statements, you can access tables from different databases with the db_name.tbl_name
syntax. Some SQL servers provide the same functionality but call this User space. MySQL
Server doesn't support tablespaces such as used in statements like this: CREATE TABLE
ralph.my_table ... IN my_tablespace.
... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz