mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge MWL#192: Non-blocking client library, into MariaDB 5.5.
This commit is contained in:
@ -212,6 +212,7 @@ my $opt_ps_protocol;
|
||||
my $opt_sp_protocol;
|
||||
my $opt_cursor_protocol;
|
||||
my $opt_view_protocol;
|
||||
my $opt_non_blocking_api;
|
||||
|
||||
our $opt_debug;
|
||||
my $debug_d= "d,*";
|
||||
@ -1123,6 +1124,7 @@ sub command_line_setup {
|
||||
'sp-protocol' => \$opt_sp_protocol,
|
||||
'view-protocol' => \$opt_view_protocol,
|
||||
'cursor-protocol' => \$opt_cursor_protocol,
|
||||
'non-blocking-api' => \$opt_non_blocking_api,
|
||||
'ssl|with-openssl' => \$opt_ssl,
|
||||
'skip-ssl' => \$opt_skip_ssl,
|
||||
'compress' => \$opt_compress,
|
||||
@ -5843,6 +5845,11 @@ sub start_mysqltest ($) {
|
||||
mtr_add_arg($args, "--cursor-protocol");
|
||||
}
|
||||
|
||||
if ( $opt_non_blocking_api )
|
||||
{
|
||||
mtr_add_arg($args, "--non-blocking-api");
|
||||
}
|
||||
|
||||
if ( $opt_strace_client )
|
||||
{
|
||||
$exe= $opt_strace_client || "strace";
|
||||
@ -6303,6 +6310,7 @@ Options to control what engine/variation to run
|
||||
(implies --ps-protocol)
|
||||
view-protocol Create a view to execute all non updating queries
|
||||
sp-protocol Create a stored procedure to execute all queries
|
||||
non-blocking-api Use the non-blocking client API
|
||||
compress Use the compressed protocol between client and server
|
||||
ssl Use ssl protocol between client and server
|
||||
skip-ssl Dont start server with support for ssl connections
|
||||
|
5
mysql-test/r/mysql_client_test_nonblock.result
Normal file
5
mysql-test/r/mysql_client_test_nonblock.result
Normal file
@ -0,0 +1,5 @@
|
||||
SET @old_general_log= @@global.general_log;
|
||||
SET @old_slow_query_log= @@global.slow_query_log;
|
||||
ok
|
||||
SET @@global.general_log= @old_general_log;
|
||||
SET @@global.slow_query_log= @old_slow_query_log;
|
10
mysql-test/r/non_blocking_api.result
Normal file
10
mysql-test/r/non_blocking_api.result
Normal file
@ -0,0 +1,10 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
DROP TABLE t1;
|
1
mysql-test/t/mysql_client_test_nonblock-master.opt
Normal file
1
mysql-test/t/mysql_client_test_nonblock-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--log=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE
|
23
mysql-test/t/mysql_client_test_nonblock.test
Normal file
23
mysql-test/t/mysql_client_test_nonblock.test
Normal file
@ -0,0 +1,23 @@
|
||||
# This runs the mysql_client_test using the non-blocking API.
|
||||
|
||||
# The non-blocking API is not supported in the embedded server.
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
SET @old_general_log= @@global.general_log;
|
||||
SET @old_slow_query_log= @@global.slow_query_log;
|
||||
|
||||
# We run with different binaries for normal and --embedded-server
|
||||
#
|
||||
# If this test fails with "command "$MYSQL_CLIENT_TEST" failed",
|
||||
# you should either run mysql_client_test separartely against a running
|
||||
# server or run mysql-test-run --debug mysql_client_test and check
|
||||
# var/log/mysql_client_test.trace
|
||||
|
||||
--exec echo "$MYSQL_CLIENT_TEST --non-blocking-api" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
|
||||
--exec $MYSQL_CLIENT_TEST --non-blocking-api --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
|
||||
|
||||
# End of 4.1 tests
|
||||
echo ok;
|
||||
|
||||
SET @@global.general_log= @old_general_log;
|
||||
SET @@global.slow_query_log= @old_slow_query_log;
|
@ -2,6 +2,8 @@
|
||||
# in order to optimize things we skip this test on all
|
||||
# other platforms
|
||||
--source include/windows.inc
|
||||
# Named pipe does not support the non-blocking API.
|
||||
--disable_non_blocking_api
|
||||
|
||||
# thread pool causes different results
|
||||
-- source include/not_threadpool.inc
|
||||
|
22
mysql-test/t/non_blocking_api.test
Normal file
22
mysql-test/t/non_blocking_api.test
Normal file
@ -0,0 +1,22 @@
|
||||
# Test mixing the use of blocking and non-blocking API in a single connection.
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
--enable_non_blocking_api
|
||||
connect (con_nonblock,localhost,root,,test);
|
||||
--disable_non_blocking_api
|
||||
connect (con_normal,localhost,root,,test);
|
||||
|
||||
connection con_nonblock;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
--enable_non_blocking_api
|
||||
INSERT INTO t1 VALUES (1);
|
||||
--disable_non_blocking_api
|
||||
SELECT * FROM t1;
|
||||
--enable_non_blocking_api
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection con_normal;
|
||||
DROP TABLE t1;
|
Reference in New Issue
Block a user