From ee3ee7bf4494373f62de973d7f312f77ef4c4065 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Tue, 27 Sep 2011 11:23:49 +0000 Subject: [PATCH] Whitespace, more example, coverage of a new error/warning just introduced by Andrey git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@317390 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqlnd_ms/setup.xml | 129 ++++++++++++++++++++++++++++----- 1 file changed, 111 insertions(+), 18 deletions(-) diff --git a/reference/mysqlnd_ms/setup.xml b/reference/mysqlnd_ms/setup.xml index 3e20f3bd3b..9e039ba9af 100755 --- a/reference/mysqlnd_ms/setup.xml +++ b/reference/mysqlnd_ms/setup.xml @@ -521,7 +521,7 @@ $mysqli = new mysqli("localhost", "username", "password", "database"); Note, that it is valid to use an empty slave server list. The error has been introduced to prevent accidently setting no slaves by forgetting about the slave setting. - A master-only setup is still possible using an empty slave server list. + A master-only setup is still possible using an empty slave server list. @@ -540,10 +540,10 @@ $mysqli = new mysqli("localhost", "username", "password", "database"); directive used in prior version to select a load balancing policy. The user filter replaces the - mysqlnd_ms_set_user_pick_server function + mysqlnd_ms_set_user_pick_server function. - Filters may accept parameters to refine their actions. + Filters may accept parameters to refine their actions. If no load balancing policy is set, the plugin will default to @@ -555,6 +555,60 @@ $mysqli = new mysqli("localhost", "username", "password", "database"); if neither the random nor the roundrobin are part of a configuration section. + + If a filter chain is configured so that a filter which output no + more than once server is used as input for a filter which should be given + more than one server as input, the plugin may emit a warning upon + opening a connection. The warning may read: (mysqlnd_ms) Error while creating + filter '%s' . Non-multi filter '%s' already created. + Stopping in %s on line %d. Futhermore an error of + the error code 2000, the sql state HY000 + and an error message similar to the warning may be set on the connection + handle. + + Invalid filter sequence + + + + +query("SELECT 1 FROM DUAL"); +?> +]]> + + &example.outputs; + + + + + @@ -564,24 +618,23 @@ $mysqli = new mysqli("localhost", "username", "password", "database"); - The random filter features the load balancing policies - random and random_once, previously set - through the + The random filter features the random and random once + load balancing policies, set through the pick[] directive in older versions. - The random policy will pick a random server whenever - a read-only statement is to be executed. The random_once + The random policy will pick a random server whenever + a read-only statement is to be executed. The random once strategy picks a random slave server once and continues using the slave for the - rest of the PHP web request. random_once is a default, + rest of the PHP web request. Random once is a default, if load balancing is not configured through a filter. If the random filter is not given any arguments, it - stands for random load balancing policy. + stands for random load balancing policy. - <literal>random</literal> load balancing policy + Random load balancing with <literal>random</literal> filter Optionally, the sticky argument can be passed to the filter. If the parameter sticky is set to the string - 1, the filter provides the random_once - load balancing policy. + 1, the filter follows the random once + load balancing strategy. - <literal>random_once</literal> load balancing policy + Random once load balancing with <literal>random</literal> filter Unknown arguments are ignored. No warning or error is given. + + Expects one or more servers as input. Outputs one server. + A filter sequence such as + random, roundrobin may + cause a warning and an error message to be set on the connection + handle when executing a statement. + @@ -639,10 +699,43 @@ $mysqli = new mysqli("localhost", "username", "password", "database"); - If using roundrobin the plugin iterates over the list of - configured slave servers to pick a server for statement execution. - If the plugin reaches the end of the list, it wraps around to the beginning - of the list and picks the first configured slave server. + If using the roundrobin filter, the plugin + iterates over the list of configured slave servers to pick a server + for statement execution. If the plugin reaches the end of the list, + it wraps around to the beginning of the list and picks the first + configured slave server. + + <literal>roundrobin</literal> filter + + + + + + + Expects one or more servers as input. Outputs one server. + A filter sequence such as + roundrobin, random may + cause a warning and an error message to be set on the connection + handle when executing a statement.