Oracle 5.0 Reference Manual page 2570

Table of Contents

Advertisement

*props = mnd_pecalloc(1, sizeof(MY_CONN_PROPERTIES), conn->persistent);
(*props)->query_counter = 0;
}
return props;
}
The plugin developer is responsible for the management of plugin data memory.
Use of the
memory allocator is recommended for plugin data. These functions are named
mysqlnd
using the convention: mnd_*loc(). The
ability to use a debug allocator in a non-debug build.
Table 20.68. When and how to subclass
Connection (MYSQLND) MINIT
Resultset
(MYSQLND_RES)
Resultset Meta
(MYSQLND_RES_METADATA)
Statement
(MYSQLND_STMT)
Network
(MYSQLND_NET)
Wire protocol
(MYSQLND_PROTOCOL)
You must not manipulate function tables at any time later than MINIT if it is not allowed according to the
above table.
Some classes contain a pointer to the method function table. All instances of such a class will share the
same function table. To avoid chaos, in particular in threaded environments, such function tables must
only be manipulated during MINIT.
Other classes use copies of a globally shared function table. The class function table copy is created
together with the object. Each object uses its own function table. This gives you two options: you can
manipulate the default function table of an object at MINIT, and you can additionally refine methods of
an object without impacting other instances of the same class.
The advantage of the shared function table approach is performance. There is no need to copy a
function table for each and every object.
Table 20.69. Constructor status
Connection (MYSQLND) mysqlnd_init()
Resultset(MYSQLND_RES) Allocation:
MySQL Native Driver (Mysqlnd)
allocator has some useful features, such as the
mysqlnd
When to subclass?
MINIT or later
MINIT
MINIT
MINIT or later
MINIT or later
Allocation, construction,
reset
2550
Each instance has its
own private function
table?
No
Yes
No
No
Yes
Yes
Can be modified?
No
Yes, but call parent!
How to subclass?
mysqlnd_conn_get_methods()
mysqlnd_result_get_methods()
or object method
function table
manipulation
mysqlnd_result_metadata_get_metho
mysqlnd_stmt_get_methods()
mysqlnd_net_get_methods()
or object method
function table
manipulation
mysqlnd_protocol_get_methods()
or object method
function table
manipulation
Caller
mysqlnd_connect()
• Connection::list_fields()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents