lp://qastaging/~vlad-lesin/percona-server/5.6-binary-answer
- Get this branch:
- bzr branch lp://qastaging/~vlad-lesin/percona-server/5.6-binary-answer
Branch merges
- Laurynas Biveinis (community): Needs Fixing
-
Diff: 1108 lines (+668/-36)17 files modifiedclient/mysqltest.cc (+19/-6)
include/mysql.h (+4/-0)
include/mysql.h.pp (+5/-0)
include/mysql_com.h (+1/-0)
include/sql_common.h (+1/-0)
libmysql/CMakeLists.txt (+2/-0)
libmysql/client_settings.h (+1/-0)
libmysql/libmysql.c (+266/-30)
libmysql/libmysql.def (+2/-0)
libmysqld/lib_sql.cc (+8/-0)
mysql-test/mysql-test-run.pl (+15/-0)
mysql-test/r/stmt_execute_immediate.result (+64/-0)
mysql-test/t/stmt_execute_immediate.test (+7/-0)
sql-common/client.c (+1/-0)
sql/sql_parse.cc (+9/-0)
tests/CMakeLists.txt (+4/-0)
tests/stmt_execute_immediate.cc (+259/-0)
Related bugs
Related blueprints
Branch information
- Owner:
- Vlad Lesin
- Status:
- Development
Recent revisions
- 619. By Vlad Lesin
-
Implement this
https://blueprints. launchpad. net/percona- server/ +spec/binary- answer- 5.6
blueprint.The task can be splitted on server and client parts.
Server-side.
If we look into mysqld_
stmt_prepare( ) function we can see the code like this: Protocol *save_protocol= thd->protocol;
thd->protocol= &thd->protocol_binary;
stmt->prepare(...);
thd->protocol= save_protocol;The THD class contains this members:
Protocol *protocol; // Current protocol
Protocol_text protocol_text; // Normal protocol
Protocol_binary protocol_binary; // Binary protocolSo for server-side is enough to add new command COM_STMT_
EXECUTE_ IMMEDIATE which
would do absolutely the same things as COM_QUERY does but with replacing
thd->protocol with &thd->protocol_binary before processing and restore protocol
pointer after processing.Client side.
Standard C API has already have all necessary infrastructure to parse binary
protocol. So the task is to use this infrastructure. The idea is to add new
function mysql_stmt_execute_ immediate( ) which would send
COM_STMT_EXECUTE_ IMMEDIATE to server, initialize MYSQL_STMT object to use it
for parsing result with standard functions for parsing the result of
"execute prepared statement". As well mysql_stmt_bind_immediate( ) is necessary
to initialize certain MYSQL_STMT fields which are usually initialized inside of
mysql_stmt_prepare( ) and to invoke standard mysql_stmt_ bind_result( ) function
to describe the result data.There are two functions to execute prepared and non-prepared queries
correspondingly: mysql_stmt_execute( ) and mysql_real_query(). Both functions
use the same function cli_read_query_result( ) to get information about fields
count, their names. So this part of result parsing is the same. But rows parsing
is absolutely different.For non-prepared query mysql_fetch_
row()-> read_one_ row() calls just set pointers
in array of rows to the certain values in read packet. As all values are in the
text format we have the array of pointers to null-terminated strings as the
output of the function.But when binary data are parsed in mysql_stmt_
fetch() ->stmt_ fetch_row( ) the
functions use information about field types from MYSQL_STMT::bind array.
For each element of this array
mysql_stmt_bind_result( )->setup_ one_fetch_ function( ) sets the pointer to the
function which parses binary data of corresponding type to the buffer. For
example fetch_result_int32() is set up for MYSQL_TYPE_LONG data type. So we have to develop new function mysql_stmt_
execute_ immediate( ) which would
mix mysql_real_query() and mysql_stmt_execute( ). Use tests/stmt_
execute_ immediate. cc as the source of information about the
sequence of C API calls to send query and receive and parse binary answer.stmt_execute_
immediate. cc could be the part of mysql_client_test.c but the
customer disabled this test in his tree.The new parameter --binary-protocol is added to mysqltest to allow communication
between client and server with binary protocol without "prepare" using
mysql_stmt_execute_ immedate( ) function to send query. - 618. By Jenkins Master <email address hidden>
-
Merge lp:~hrvojem/percona-server/rn-5.5.38-35.2-5.6
http://jenkins. percona. com/job/ merge-PS- 5.6-docs- kickoff/ 52/ - 616. By Jenkins Master <email address hidden>
-
Merge lp:~hrvojem/percona-server/rn-5.6.19-67.0-5.6
http://jenkins. percona. com/job/ merge-PS- 5.6-docs- kickoff/ 51/
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp://qastaging/percona-server/5.6