24.3. Adding New Procedures to MySQL

MySQL 5.0

24.3. Adding New Procedures to MySQL

In MySQL, you can define a procedure in C++ that can access and modify the data in a query before it is sent to the client. The modification can be done on a row-by-row or level.

We have created an example procedure to show you what can be done.

Additionally, we recommend that you take a look at . With this you can use the LUA language to load a procedure at runtime into mysqld.

24.3.1. Procedure Analyse

,[]])

This procedure is defined in the . This examines the result from your query and returns an analysis of the results:

  • (default 256) is the maximum number of distinct values does notice per column. This is used by to check whether the optimal data type should be of type .

  • (default 8192) is the maximum amount of memory that should allocate per column while trying to find all distinct values.

SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([,[]])

24.3.2. Writing a Procedure

For the moment, the only documentation for this is the source.

You can find all information about procedures by examining the following files: