The
EXAMPLE
Storage Engine
1313
14.6. The
EXAMPLE
Storage Engine
The
EXAMPLE
storage engine is a stub engine that does nothing. Its purpose is to serve as an example
in the MySQL source code that illustrates how to begin writing new storage engines. As such, it is
primarily of interest to developers.
The
EXAMPLE
storage engine is included in MySQL binary distributions. To enable this storage engine
if you build MySQL from source, invoke
configure
with the
--with-example-storage-engine
option.
To examine the source for the
EXAMPLE
engine, look in the
sql/examples
directory of a MySQL
source distribution.
When you create an
EXAMPLE
table, the server creates a table format file in the database directory.
The file begins with the table name and has an
.frm
extension. No other files are created. No data can
be stored into the table. Retrievals return an empty result.
mysql>
CREATE TABLE test (i INT) ENGINE = EXAMPLE;
Query OK, 0 rows affected (0.78 sec)
mysql>
INSERT INTO test VALUES(1),(2),(3);
ERROR 1031 (HY000): Table storage engine for 'test' doesn't have this option
mysql>
SELECT * FROM test;
Empty set (0.31 sec)
The
EXAMPLE
storage engine does not support indexing.
14.7. The
FEDERATED
Storage Engine
The
FEDERATED
storage engine is available beginning with MySQL 5.0.3. It is a storage engine that
accesses data in tables of remote databases rather than in local tables.
The
FEDERATED
storage engine is available beginning with MySQL 5.0.3. This storage engine enables
data to be accessed from a remote MySQL database on a local server without using replication or
cluster technology. When using a
FEDERATED
table, queries on the local server are automatically
executed on the remote (federated) tables. No data is stored on the local tables.
To include the
FEDERATED
storage engine if you build MySQL from source, invoke
configure
with
the
--with-federated-storage-engine
option.
Beginning with MySQL 5.0.64, the
FEDERATED
storage engine is not enabled by default in the running
server; to enable
FEDERATED
, you must start the MySQL server binary using the
--federated
option.
To examine the source for the
FEDERATED
engine, look in the
sql
directory of a source distribution for
MySQL 5.0.3 or newer.
Additional Resources
• A forum dedicated to the
FEDERATED
storage engine is available at
http://forums.mysql.com/list.php?
105
.
14.7.1. Description of the
FEDERATED
Storage Engine
When you create a
FEDERATED
table, the server creates a table format file in the database directory.
The file begins with the table name and has an
.frm
extension. No other files are created, because the
actual data is in a remote table. This differs from the way that storage engines for local tables work.
For local database tables, data files are local. For example, if you create a
MyISAM
table named
users
, the
MyISAM
handler creates a data file named
users.MYD
. A handler for local tables reads,
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...