mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge of patch lp:~ahiguti100/maria/handlersocket-fix-78 by Akira Higuchi
A bugfix of HandlerSocket is not applied to mariadb yet
This commit is contained in:
@ -66,7 +66,7 @@ Here is a list of other language bindings:
|
||||
https://github.com/koichik/node-handlersocket
|
||||
|
||||
The home of HandlerSocket is here:
|
||||
https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL
|
||||
https://github.com/DeNADev/HandlerSocket-Plugin-for-MySQL
|
||||
|
||||
More documents are available in docs-en/ and docs-ja/ directories.
|
||||
|
||||
|
@ -17,10 +17,11 @@ crash, etc).
|
||||
$ ./autogen.sh
|
||||
$ ./configure --with-mysql-source=/work/mysql-5.1.50 --with-mysql-bindir=/work/mysql-5.1.50-linux-x86_64-glibc23/bin --with-mysql-plugindir=/work/mysql-5.1.50-linux-x86_64-glibc23/lib/plugin
|
||||
|
||||
--with-mysql-source refers to the top of MySQL source directory,
|
||||
--with-mysql-bindir refers to where MySQL binary executables (i.e.
|
||||
mysql_config) are located, and --with-mysql-plugindir refers to a plugin
|
||||
directory where plugin libraries (*.so) are installed.
|
||||
--with-mysql-source refers to the top of MySQL source directory (which
|
||||
contains the VERSION file or the configure.in file), --with-mysql-bindir
|
||||
refers to where MySQL binary executables (i.e. mysql_config) are located,
|
||||
and --with-mysql-plugindir refers to a plugin directory where plugin
|
||||
libraries (*.so) are installed.
|
||||
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
@ -93,7 +93,6 @@ The execute_single method can be used for inserting records also.
|
||||
|
||||
my $res = $hs->execute_single(3, '+', [ 'foo', 'bar', 'baz' ]);
|
||||
die $hs->get_error() if $res->[0] != 0;
|
||||
my $num_inserted_rows = $res->[1];
|
||||
|
||||
The 3rd argument must be an arrayref whose elements correspond to
|
||||
the 5th argument for the corresponding open_index call. If there
|
||||
@ -116,6 +115,15 @@ executing them separatedly.
|
||||
# ...
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------
|
||||
If handlersocket is configured to authenticate client connections
|
||||
(ie., handlersocket_plain_secret or handlersocket_plain_secret_wr
|
||||
is set), a client must call 'auth' method before any other
|
||||
methods.
|
||||
|
||||
my $res = $hs->auth('password');
|
||||
die $hs->get_error() if $res->[0] != 0;
|
||||
|
||||
-----------------------------------------------------------------
|
||||
When an error is occured, the first element of the returned
|
||||
arrayref becomes a non-zero value. A negative value indicates
|
||||
|
@ -29,7 +29,7 @@ Request and Response
|
||||
lines) at one time, and receive responses for them at one time.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
'open_index' request
|
||||
Opening index
|
||||
|
||||
The 'open_index' request has the following syntax.
|
||||
|
||||
@ -74,23 +74,21 @@ FILETER is a sequence of the following parameters.
|
||||
HandlerSocket supports '=', '>', '>=', '<', and '<='.
|
||||
- <vlen> indicates the length of the trailing parameters <v1> ... <vn>. This
|
||||
must be smaller than or equal to the number of index columns specified by
|
||||
the <columns> parameter of the corresponding 'open_index' request.
|
||||
the <indexname> parameter of the corresponding 'open_index' request.
|
||||
- <v1> ... <vn> specify the index column values to fetch.
|
||||
- LIM is optional. <limit> and <offset> are numbers. When omitted, it works
|
||||
as if 1 and 0 are specified. These parameter works like LIMIT of SQL.
|
||||
These values don't include the number of records skipped by a filter.
|
||||
- IN is optional. It works like WHERE ... IN syntax of SQL. <icol> must be
|
||||
smaller than or equal to the number of index columns specified by the
|
||||
<columns> parameter of the corresponding 'open_index' request. If IN is
|
||||
specified in a find request, the <icol>-th parameter value of <v1> ...
|
||||
<vn> is ignored.
|
||||
smaller than or equal to the number of index columns specified by the
|
||||
smaller than the number of index columns specified by the <indexname>
|
||||
parameter of the corresponding 'open_index' request. If IN is specified in
|
||||
a find request, the <icol>-th parameter value of <v1> ... <vn> is ignored.
|
||||
- FILTERs are optional. A FILTER specifies a filter. <ftyp> is either 'F'
|
||||
(filter) or 'W' (while). <fop> specifies the comparison operation to use.
|
||||
<fcol> must be smaller than or equal to the number of columns specified by
|
||||
the <fcolumns> parameter of the corresponding 'open_index' request.
|
||||
Multiple filters can be specified, and work as the logical AND of them.
|
||||
The difference of 'F' and 'W' is that, when a record does not meet the
|
||||
<fcol> must be smaller than the number of columns specified by the
|
||||
<fcolumns> parameter of the corresponding 'open_index' request. Multiple
|
||||
filters can be specified, and work as the logical AND of them. The
|
||||
difference of 'F' and 'W' is that, when a record does not meet the
|
||||
specified condition, 'F' simply skips the record, and 'W' stops the loop.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
@ -112,8 +110,8 @@ MOD is a sequence of the following parameters.
|
||||
<mk> must be smaller than or equal to the length of <columns> specified by
|
||||
the corresponding 'open_index' request. If <mop> is 'D', these parameters
|
||||
are ignored. If <mop> is '+' or '-', values must be numeric. If <mop> is
|
||||
'-' and it attempts to change column values from negative to positive or
|
||||
positive to negative, it is not modified.
|
||||
'-' and it attempts to change a column value from negative to positive or
|
||||
positive to negative, the column value is not modified.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Inserting data
|
||||
@ -187,6 +185,8 @@ syntax.
|
||||
0 1 <nummod>
|
||||
|
||||
- <nummod> is the number of modified rows.
|
||||
- As an exception, if the '?' suffix is specified in <mop>, a response has
|
||||
the syntax of a response for 'find' instead.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Response for 'insert'
|
||||
@ -196,3 +196,10 @@ syntax.
|
||||
|
||||
0 1
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Response for 'auth'
|
||||
|
||||
If 'auth' is succeeded, HanderSocket returns a line of the following syntax.
|
||||
|
||||
0 1
|
||||
|
||||
|
Reference in New Issue
Block a user