From: shinz Date: November 3 2005 5:04pm Subject: svn commit - mysqldoc@docsrva: r234 - branches/MikePluggable/trunk/refman-5.1 List-Archive: http://lists.mysql.com/internals/31895 Message-Id: <200511031704.jA3H4OJJ003827@docsrva.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: shinz Date: 2005-11-03 18:04:24 +0100 (Thu, 03 Nov 2005) New Revision: 234 Log: Proofreading up to line 380 Modified: branches/MikePluggable/trunk/refman-5.1/custom-engine.xml Modified: branches/MikePluggable/trunk/refman-5.1/custom-engine.xml =================================================================== --- branches/MikePluggable/trunk/refman-5.1/custom-engine.xml 2005-11-03 16:05:34 UTC (rev 233) +++ branches/MikePluggable/trunk/refman-5.1/custom-engine.xml 2005-11-03 17:04:24 UTC (rev 234) @@ -46,7 +46,7 @@ Overview - The MySQL server is build in a modular fashion: + The MySQL server is built in a modular fashion:
@@ -80,7 +80,7 @@ - One a handler instance is created, the MySQL server issues + Once a handler instance is created, the MySQL server issues commands to the handler to perform data storage and retrieval tasks such as opening a table, manipulating rows, and managing indexes. @@ -88,10 +88,10 @@ Custom storage engines can be built in a progressive manner: - developers can start with read-only storage engine and later add + Developers can start with a read-only storage engine and later add support for INSERT, UPDATE, - and DELETE operations and later add support for - indexing, transactions, and other advanced operations. + and DELETE operations, and even later add + support for indexing, transactions, and other advanced operations. @@ -115,11 +115,14 @@ ha_example.h files can be found in the sql/examples/ directory of the MySQL 5.1 source tree. + For instructions how to obtain the 5.1 source tree, see + . - When copying the files, change the names from ha_example to - something appropriate to your storage engine such as + When copying the files, change the names from + ha_example.cc and ha_example.h + to something appropriate to your storage engine, such as ha_foo.cc and ha_foo.h. @@ -136,21 +139,16 @@ sed s/EXAMPLE/FOO/g ha_example.cc | sed s/example/foo/g ha_foo.cc - - For information on accessing the MySQL 5.1 bitkeeper tree, see - . - -
- Creating the handlerton + Creating the <literal>handlerton</literal> - The handlerton (short for 'handler singleton') + The handlerton (short for handler singleton) defines the storage engine and contains function pointers to those - functions that apply to the storage engine as a whole as opposed + functions that apply to the storage engine as a whole, as opposed to functions that work inside a single handler instance. Some examples of such functions include transaction functions to handle commits and rollbacks. @@ -197,7 +195,7 @@ - This is the definition of the handlerton from + This is the definition of the handlerton from handler.h: @@ -239,20 +237,23 @@ - The first element in the handlerton is the name of the storage + The first element in the handlerton is the + name of the storage engine. This is the name that will be used when creating tables (CREATE TABLE ... ENGINE = FOO;). - The second element in the handlerton determines whether the + The second element in the handlerton + determines whether or not the storage engine will be listed when using the SHOW STORAGE ENGINES command. - The third element in the handlerton is the storage engine comment, + The third element in the handlerton is + the storage engine comment, a description of the storage engine displayed when using the SHOW STORAGE ENGINES command. @@ -264,29 +265,35 @@ - The fourth element in the handlerton is an integer that uniquely + The fourth element in the handlerton is + an integer that uniquely identifies the storage engine within the MySQL server. The - constants used by the build-in storage engines are defined in the + constants used by the built-in storage engines are defined in the handler.h file. As an alternative to creating a constant you can use an integer that is greater than 25. + [SH] Why 25? - The remaining sections of the handlerton are only implemented if + The remaining sections of the handlerton + are only implemented if the functionality referred to is supported by a given storage engine. - The fifth element in the handlerton is a function pointer to the + The fifth element in the handlerton is + a function pointer to the storage engine initializer. This function is only called once when the server starts to allow the storage engine class to perform any housekeeping that is necessary before handlers are instanced. - The sixth element in the handlerton is the slot. Each storage - engine has it's own memory area (actually a pointer) in the thd, + The sixth element in the handlerton is + the slot. Each storage + engine has its own memory area (actually a pointer) in the + thd[SH] Short explanation of thd would be nice-to-have here, for storing per-connection information. It is accessed as thd->ha_data[foo_hton.slot]. The slot number is initialized by MySQL after @@ -295,9 +302,11 @@ - The seventh element in the handlerton is the savepoint offset. To + The seventh element in the handlerton is + the savepoint offset. To store per-savepoint data the storage engine is provided with an - area of a requested size (0 is ok here). + area of a requested size (0 is okay here). + [SH] Loose language. Rather than "okay here" I'd prefer "In most cases, 0 can be used, which means 'no offset'." @@ -305,12 +314,14 @@ the needed memory to store per-savepoint information. After foo_init it is changed to be an offset to the savepoint storage area and need not - be used by storage engine. + be used by the storage engine. - The eighth element in the handlerton is a function pointer to the - handler's close connection function. This is used by the NDB + The eighth element in the handlerton is a + function pointer to the + handler's close connection[SH] close_connection() ? function. + This is used by the NDB storage engine to manage connections between the SQL nodes and the storage nodes and should not be needed for most storage engines. This function is only called if the slot is set to a non-zero @@ -318,36 +329,49 @@ - The ninth element in the handlerton points to an uninitialized + The ninth element in the handlerton points + to an uninitialized storage area of requested size (see the savepoint offset - description) + description, seventh element). - The tenth element in the handlerton is a function pointer to the - handler's rollback to savepoint function. This is used to return - to a savepoint during a transaction. This is only populated for + The tenth element in the handlerton is a + function pointer to the + handler's + rollback to savepoint + [SH] rollback_to_savepoint() ? + function. This is used to return + to a savepoint during a transaction. It's only populated for storage engines that support savepoints. - The eleventh element in the handlerton is a function pointer to - the handler's release savepoint function. This is used to release - the resources of a savepoint during a transaction. This is only + The eleventh element in the handlerton is + a function pointer to + the handler's + release savepoint + [SH] release_savepoint() ? + function. This is used to release + the resources of a savepoint during a transaction. It's only populated for storage engines that support savepoints. - The twelfth element in the handlerton is a function pointer to the - handler's commit function. This is used to commit a transaction. - This is only populated for storage engines that support + The twelfth element in the handlerton is + a function pointer to the + handler's commit function. + This is used to commit a transaction. + It's only populated for storage engines that support transactions. - The thirteenth element in the handlerton is a function pointer to - the handler's rollback function. This is used to roll back a - transaction. This is only populated for storage engines that + The thirteenth element in the handlerton is + a function pointer to + the handler's rollback function. + This is used to roll back a + transaction. It's only populated for storage engines that support transactions. @@ -570,6 +594,11 @@
Opening a Table + + + [SH] Add description about opening a table. + +
@@ -607,18 +636,26 @@
- Adding Support for DELETE to a Storage Engine + Adding Support for UPDATE to a Storage Engine - - + + + [SH] Add description about updating a table. + + +
Adding Support for DELETE to a Storage Engine - - + + + [SH] Add description about deleting from a table. + + +