Oracle 5.0 Reference Manual page 2571

Table of Contents

Advertisement

Resultset Meta
(MYSQLND_RES_METADATA)
Statement
(MYSQLND_STMT)
Network
(MYSQLND_NET)
Wire protocol
(MYSQLND_PROTOCOL)
It is strongly recommended that you do not entirely replace a constructor. The constructors perform
memory allocations. The memory allocations are vital for the
of mysqlnd. If you do not care about warnings and insist on hooking the constructors, you should at
least call the parent constructor before doing anything in your constructor.
Regardless of all warnings, it can be useful to subclass constructors. Constructors are the perfect place
for modifying the function tables of objects with non-shared object tables, such as Resultset, Network,
Wire Protocol.
Table 20.70. Destruction status
Connection
Resultset
Resultset Meta
Statement
Network
Wire protocol
The destructors are the appropriate place to free properties,
mysqlnd_plugin_get_plugin_<object>_data().
The listed destructors may not be equivalent to the actual
However, they are the best possible place for you to hook in and free your plugin data. As with
constructors you may replace the methods entirely but this is not recommended. If multiple methods
are listed in the above table you will need to hook all of the listed methods and free your plugin data in
whichever method is called first by mysqlnd.
The recommended method for plugins is to simply hook the methods, free your memory and call the
parent implementation immediately following this.
Caution
Due to a bug in PHP versions 5.3.0 to 5.3.3, plugins do not associate plugin
data with a persistent connection. This is because
mysqli
calls and the plugin may therefore leak memory. This has been fixed in PHP
5.3.4.
MySQL Native Driver (Mysqlnd)
• Connection::result_init()
Reset and re-initialized
during:
• Result::use_result()
• Result::store_result
Connection::result_meta_init()
Connection::stmt_init()
mysqlnd_net_init()
mysqlnd_protocol_init()
Derived method must call
parent?
yes, after method execution
yes, after method execution
yes, after method execution
yes, after method execution
yes, after method execution
yes, after method execution
do not trigger all the necessary
2551
Yes, but call parent!
Yes, but call parent!
No
No
plugin API and the object logic
mysqlnd
Destructor
free_contents(), end_psession()
free_result()
free()
dtor(), free_stmt_content()
free()
free()
method freeing the object itself.
mysqlnd
ext/mysql
mysqlnd end_psession()
• Statement::get_result()
• Statement::prepare()
(Metadata only)
• Statement::resultMetaData()
Result::read_result_metadata()
Connection::stmt_init()
Connection::init()
Connection::init()
and
ext/
method

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents