mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Adding Change History, adding test instructions for upcoming 1.1.0-beta, replacing 5.3.99 references with 5.4.0 references.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@317106 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
58652094db
commit
c0c6ee30a7
5 changed files with 277 additions and 20 deletions
|
@ -25,16 +25,17 @@
|
|||
MySQL Client Library (AKA libmysql/libmysqlclient). Using mysqlnd has
|
||||
several advantages: no extra downloads because it comes with PHP,
|
||||
PHP license, lower memory consumption in certain cases,
|
||||
new functionality such as asynchronous queries.
|
||||
new functionality such as asynchronous queries. As of PHP 5.4.0, mysqlnd is
|
||||
the compile time default library used by all PHP MySQL extensions
|
||||
(<link linkend="ref.mysqli">mysqli</link>,
|
||||
<link linkend="ref.mysql">mysql</link>,
|
||||
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>).
|
||||
</para>
|
||||
<para>
|
||||
Mysqlnd plugins such as the replication and load balancing plugin operate
|
||||
mostly transparent from an user perspective. The replication and load balancing
|
||||
plugin supports all PHP applications
|
||||
and all PHP MySQL extensions (
|
||||
<link linkend="ref.mysqli">mysqli</link>,
|
||||
<link linkend="ref.mysql">mysql</link>,
|
||||
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>).
|
||||
and all PHP MySQL extensions.
|
||||
It does not change existing APIs. Therefore, it can easily be used with
|
||||
existing PHP applications.
|
||||
</para>
|
||||
|
@ -69,6 +70,18 @@
|
|||
very little, if any, application changes required, dependent on the usage scenario required
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
lazy connections: connections to master and slave servers are not
|
||||
opened before a SQL statement is run
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
optional, automatic use of master after first write in a web request to
|
||||
lower the possible impact of replication lag
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -148,14 +161,14 @@
|
|||
will be based on the beginning of the statement string.
|
||||
</para>
|
||||
<para>
|
||||
The plugin does not support native prepared statements. Please
|
||||
note that <link linkend="ref.pdo-mysql">PDO_MySQL</link> is using a
|
||||
Prior to version 1.1 beta the plugin did not support native prepared statements.
|
||||
Please note that <link linkend="ref.pdo-mysql">PDO_MySQL</link> is using a
|
||||
client-side prepared statement emulation by default. Client-side emulated
|
||||
prepared statements are fully supported by the replication and load balancing
|
||||
plugin because the emulation is not using native prepared statements.
|
||||
If you are using PHP based database abstraction, please consult the
|
||||
vendor manual to learn if a client-side prepared statement emulation is
|
||||
used.
|
||||
prepared statements are fully supported by any version of
|
||||
the replication and load balancing plugin because the emulation is not
|
||||
using native prepared statements. If you are using PHP based database
|
||||
abstraction, please consult the vendor manual to learn if a client-side
|
||||
prepared statement emulation is used.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -185,7 +198,8 @@
|
|||
&reference.mysqlnd-ms.concepts;
|
||||
&reference.mysqlnd-ms.setup;
|
||||
&reference.mysqlnd-ms.constants;
|
||||
&reference.mysqlnd-ms.reference;
|
||||
&reference.mysqlnd-ms.reference;
|
||||
&reference.mysqlnd-ms.changes;
|
||||
|
||||
</book>
|
||||
|
||||
|
|
169
reference/mysqlnd_ms/changes.xml
Normal file
169
reference/mysqlnd_ms/changes.xml
Normal file
|
@ -0,0 +1,169 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 310337 $ -->
|
||||
|
||||
<chapter xml:id="mysqlnd-ms.changes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title xmlns="http://docbook.org/ns/docbook">Change History</title>
|
||||
<para>
|
||||
The Change History lists major changes users need to be aware if upgrading
|
||||
from one version to another. It is a high level summary of selected changes
|
||||
that may impact applications or might even break backwards compatibility.
|
||||
Please, consult the <filename>CHANGES</filename> file contained in the source
|
||||
distribution for a more complete list of changes. If you are eager to learn
|
||||
about all changes, even smaller ones that do not make it into the
|
||||
<filename>CHANGES</filename> file, you may want to monitor PECL commit messages.
|
||||
To do you, you could, for example, subsribe to the PECL commit message mailing
|
||||
list.
|
||||
</para>
|
||||
|
||||
<section xml:id="mysqlnd-ms.changes_one_one">
|
||||
<title xmlns="http://docbook.org/ns/docbook">PECL/mysqlnd_ms 1.1 series</title>
|
||||
<para>
|
||||
1.1.0-beta
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Release date: no released yet, planned for 09/2011
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Motto/theme: Cover replication basics with production quality
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
The 1.1 and 1.0 series expose a similar, although not identical, feature
|
||||
set to the user, as can be guessed from the release motto/theme. Interally,
|
||||
the 1.1 series has been refactored significantly to prepare for future
|
||||
feature additions. A new configuration file format has been introduced
|
||||
and, limitations have been lifted. Code quality and quality assurance
|
||||
have been improved.
|
||||
</para>
|
||||
<para>
|
||||
Freature changes
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Introduction of (chainable) filter concept
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
New powerful JSON based configuration syntax.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Lazy connections improved: security relevant, state changing commands covered
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Support for (native) prepared statements
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Bug fixes
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Fixed PECL #22724 - Server switching (mysqlnd_ms_query_is_select() case sensitive)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Fixed PECL #22784 - Using mysql_connect and mysql_select_db won't work
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="mysqlnd-ms.changes_one_o">
|
||||
<title xmlns="http://docbook.org/ns/docbook">PECL/mysqlnd_ms 1.0 series</title>
|
||||
<para>
|
||||
1.0.1-alpha
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Release date: 04/2011
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Motto/theme: bug fix release
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
1.0.0-alpha
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Release date: 04/2011
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Motto/theme: Cover replication basics to test user feeedback
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
First release of practical use. Features basic automatic read-write splitting,
|
||||
SQL hints to overrule automatic redirection, load balancing of
|
||||
slave requests, lazy connections and, optional, automatic use of the master
|
||||
after the first write.
|
||||
</para>
|
||||
<para>
|
||||
The public feature set is close to that of the 1.1 release.
|
||||
</para>
|
||||
<para>
|
||||
1.0.0-pre-alpha
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Release date: 09/2010
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Motto/theme: Proof of concept
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Initial check-in. At this stage the plugin is hardly of
|
||||
any practical use but a demo of the
|
||||
<link linkend="book.mysqlnd">mysqlnd</link> plugin API.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -181,7 +181,7 @@
|
|||
</para>
|
||||
<para>
|
||||
The latest version of the <literal>mysqlnd</literal> library, as found in
|
||||
PHP 5.3.99, allows the plugin to subclass the library C API call
|
||||
PHP 5.4.0, allows the plugin to subclass the library C API call
|
||||
<literal>trx_autocommit()</literal> to
|
||||
detect the status of the <literal>autocommit</literal> mode. The PHP MySQL
|
||||
extensions either issue a query such as <literal>SET AUTOCOMMIT=0|1</literal>
|
||||
|
@ -194,7 +194,7 @@
|
|||
<para>
|
||||
The experimental pluging configuration option
|
||||
<literal>trx_stickiness=master</literal> can be used to make the plugin
|
||||
transaction aware if using PHP 5.3.99. In this mode the plugin stops load
|
||||
transaction aware if using PHP 5.4.0 or newer. In this mode the plugin stops load
|
||||
balancing if autocommit gets disabled and directs all statements to the
|
||||
master until autocommit gets enabled.
|
||||
</para>
|
||||
|
|
|
@ -582,14 +582,14 @@ $mysqli->close();
|
|||
</example>
|
||||
</para>
|
||||
<para>
|
||||
Starting with PHP 5.3.99 the <literal>mysqlnd</literal> library allows the
|
||||
Starting with PHP 5.4.0 the <literal>mysqlnd</literal> library allows the
|
||||
plugin to monitor the status of the <literal>autocommit</literal> mode, if
|
||||
the mode is set by API calls instead of using SQL statements such as
|
||||
<literal>SET AUTOCOMMIT=0</literal>. This makes it possible for the plugin to
|
||||
become transaction aware.
|
||||
</para>
|
||||
<para>
|
||||
If using PHP 5.3.99, API calls to set the <literal>autocommit</literal> mode
|
||||
If using PHP 5.4.0 or newer, API calls to set the <literal>autocommit</literal> mode
|
||||
and setting the experimental plugin configuration option
|
||||
<link linkend="ini.mysqlnd-ms-plugin-config.trx_stickiness"><literal>trx_stickiness=master</literal></link>
|
||||
the plugin can automatically disable load balancing and connection switches
|
||||
|
@ -663,7 +663,7 @@ $mysqli->close();
|
|||
<para>
|
||||
The plugin configuration option
|
||||
<link linkend="ini.mysqlnd-ms-plugin-config.trx_stickiness"><literal>trx_stickiness=master</literal></link>
|
||||
is an experimental feature. It requires PHP 5.3.99.
|
||||
is an experimental feature. It requires PHP 5.4.0 or newer.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
|
|
|
@ -315,7 +315,7 @@ slave[] = mysql_slave_2
|
|||
Experimental feature.
|
||||
</para>
|
||||
<para>
|
||||
The setting requires 5.3.99 or newer. If used with PHP older than 5.3.99,
|
||||
The setting requires 5.4.0 or newer. If used with PHP older than 5.4.0,
|
||||
the plugin will emit a warning like
|
||||
<literal>(mysqlnd_ms) trx_stickiness strategy is not supported before PHP 5.3.99</literal>.
|
||||
</para>
|
||||
|
@ -328,7 +328,7 @@ slave[] = mysql_slave_2
|
|||
avoid connection switches during a transaction.
|
||||
</para>
|
||||
<para>
|
||||
As of PHP 5.3.99 the mysqlnd library allows the plugin to monitor
|
||||
As of PHP 5.4.ß the mysqlnd library allows the plugin to monitor
|
||||
the <literal>autocommit</literal> mode set by calls to the
|
||||
libraries <literal>trx_autocommit()</literal> function.
|
||||
If setting <literal>trx_stickiness=master</literal> and
|
||||
|
@ -355,6 +355,80 @@ slave[] = mysql_slave_2
|
|||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="mysqlnd-ms.testing">
|
||||
<title xmlns="http://docbook.org/ns/docbook">Testing</title>
|
||||
<note>
|
||||
<para>
|
||||
The section applies to the development tree (1.1.0-beta) but not the
|
||||
1.0 series.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The PECL/mysqlnd_ms test suite is in the <filename>tests/</filename>
|
||||
directory of the source distribution. The test suite consists of standard
|
||||
phpt tests, which are described on the PHP Quality Assurance Teams website.
|
||||
</para>
|
||||
<para>
|
||||
Before running the tests, edit <filename>tests/config.inc</filename> to
|
||||
configure the MySQL servers to be used for testing. You will need at least
|
||||
one MySQL server to run the tests. However, configuring two distinct MySQL
|
||||
servers is better. If two distinct servers are configured, the tests can use
|
||||
one of them as a logical master and the other one as a logical slave. Those
|
||||
two servers do not need to be part of a MySQL replication cluster. Tests
|
||||
are written in a way that they can be successfully executed without having
|
||||
to setup a MySQL replication cluster. If two servers are configured they
|
||||
must allow login to a test database using the same username and password on
|
||||
both servers.
|
||||
</para>
|
||||
<para>
|
||||
The most basic configuration is as follows.
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
putenv("MYSQL_TEST_HOST=localhost");
|
||||
putenv("MYSQL_TEST_PORT=3306");
|
||||
putenv("MYSQL_TEST_USER=root");
|
||||
putenv("MYSQL_TEST_PASSWD=");
|
||||
putenv("MYSQL_TEST_DB=test");
|
||||
putenv("MYSQL_TEST_ENGINE=MyISAM");
|
||||
putenv("MYSQL_TEST_SOCKET=");
|
||||
|
||||
putenv("MYSQL_TEST_SKIP_CONNECT_FAILURE=1");
|
||||
putenv("MYSQL_TEST_CONNECT_FLAGS=0");
|
||||
putenv("MYSQL_TEST_EXPERIMENTAL=0");
|
||||
|
||||
putenv("MYSQL_TEST_MASTER_HOST=". getenv("MYSQL_TEST_HOST"));
|
||||
putenv("MYSQL_TEST_SLAVE_HOST=". getenv("MYSQL_TEST_HOST"));
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
<literal>MYSQL_TEST_HOST</literal>, <literal>MYSQL_TEST_PORT</literal> and
|
||||
<literal>MYSQL_TEST_SOCKET</literal> define the hostname,
|
||||
TCP/IP port and Unix domain socket of the default database server.
|
||||
<literal>MYSQL_TEST_USER</literal> and <literal>MYSQL_TEST_PASSWD</literal>
|
||||
contain the user and password needed to connect to the database/schema
|
||||
configured with <literal>MYSQL_TEST_DB</literal>. If using two distinct
|
||||
servers, a logical master and a logical slave server, both of them must
|
||||
have the same database user configured to give access to the test database.
|
||||
</para>
|
||||
<para>
|
||||
Some tests require availability of two distinct MySQL test servers. Those
|
||||
tests will be skipped, if only one server is configured. To configure a logical
|
||||
slave server that runs on a different host and/or listens to a different port
|
||||
or socket than the default server, set <literal>MYSQL_TEST_SLAVE_HOST</literal>.
|
||||
Using <literal>host</literal>, <literal>host:port</literal> or <literal>host:/path/to/socket</literal>
|
||||
syntax for <literal>MYSQL_TEST_SLAVE_HOST</literal> you can set an alternate
|
||||
host, host and port or host and socket for the logical slave host.
|
||||
The same syntax can be used to set <literal>MYSQL_TEST_MASTER_HOST</literal>.
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
putenv("MYSQL_TEST_SLAVE_HOST=192.168.78.136:3307"));
|
||||
putenv("MYSQL_TEST_SLAVE_HOST=myserver_hostname:/path/to/socket"));
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
Loading…
Reference in a new issue