Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
806ec1b0
Commit
806ec1b0
authored
Mar 20, 2009
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Merge with trunk
parents
4dc093ce
ce956c8f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
161 additions
and
3 deletions
+161
-3
client/mysqltest.cc
client/mysqltest.cc
+8
-1
mysql-test/lib/My/ConfigFactory.pm
mysql-test/lib/My/ConfigFactory.pm
+2
-1
mysql-test/r/connect.result
mysql-test/r/connect.result
+7
-0
mysql-test/r/pool_of_threads.result
mysql-test/r/pool_of_threads.result
+20
-0
mysql-test/t/connect.cnf
mysql-test/t/connect.cnf
+8
-0
mysql-test/t/connect.test
mysql-test/t/connect.test
+27
-0
mysql-test/t/pool_of_threads-master.opt
mysql-test/t/pool_of_threads-master.opt
+0
-1
mysql-test/t/pool_of_threads.cnf
mysql-test/t/pool_of_threads.cnf
+14
-0
mysql-test/t/pool_of_threads.test
mysql-test/t/pool_of_threads.test
+75
-0
No files found.
client/mysqltest.cc
View file @
806ec1b0
...
...
@@ -76,7 +76,7 @@ enum {
OPT_SKIP_SAFEMALLOC
=
OPT_MAX_CLIENT_OPTION
,
OPT_PS_PROTOCOL
,
OPT_SP_PROTOCOL
,
OPT_CURSOR_PROTOCOL
,
OPT_VIEW_PROTOCOL
,
OPT_MAX_CONNECT_RETRIES
,
OPT_MARK_PROGRESS
,
OPT_LOG_DIR
,
OPT_TAIL_LINES
,
OPT_GLOBAL_SUBST
OPT_GLOBAL_SUBST
,
OPT_MY_CONNECT_TIMEOUT
};
static
int
record
=
0
,
opt_sleep
=
-
1
;
...
...
@@ -87,6 +87,7 @@ const char *opt_include= 0, *opt_charsets_dir;
static
int
opt_port
=
0
;
static
int
opt_max_connect_retries
;
static
my_bool
opt_compress
=
0
,
silent
=
0
,
verbose
=
0
;
static
int
opt_connect_timeout
=
-
1
;
static
my_bool
debug_info_flag
=
0
,
debug_check_flag
=
0
;
static
my_bool
tty_password
=
0
;
static
my_bool
opt_mark_progress
=
0
;
...
...
@@ -4952,6 +4953,9 @@ void do_connect(struct st_command *command)
if
(
opt_charsets_dir
)
mysql_options
(
&
con_slot
->
mysql
,
MYSQL_SET_CHARSET_DIR
,
opt_charsets_dir
);
if
(
opt_connect_timeout
>=
0
)
mysql_options
(
&
con_slot
->
mysql
,
MYSQL_OPT_CONNECT_TIMEOUT
,
&
opt_connect_timeout
);
#ifdef HAVE_OPENSSL
if
(
opt_use_ssl
||
con_ssl
)
...
...
@@ -5692,6 +5696,9 @@ static struct my_option my_long_options[] =
#include "sslopt-longopts.h"
{
"test-file"
,
'x'
,
"Read test from/in this file (default stdin)."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"connect-timeout"
,
OPT_MY_CONNECT_TIMEOUT
,
"Client connection timeout"
,
(
uchar
**
)
&
opt_connect_timeout
,
(
uchar
**
)
&
opt_connect_timeout
,
0
,
GET_INT
,
REQUIRED_ARG
,
-
1
,
-
1
,
0
,
0
,
0
,
0
},
{
"timer-file"
,
'm'
,
"File where the timing in micro seconds is stored."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"tmpdir"
,
't'
,
"Temporary directory where sockets are put."
,
...
...
mysql-test/lib/My/ConfigFactory.pm
View file @
806ec1b0
...
...
@@ -202,6 +202,7 @@ my @mysqld_rules=
{
'
pid-file
'
=>
\&
fix_pidfile
},
{
'
#host
'
=>
\&
fix_host
},
{
'
port
'
=>
\&
fix_port
},
{
'
#extra-port
'
=>
\&
fix_port
},
{
'
socket
'
=>
\&
fix_socket
},
{
'
log-error
'
=>
\&
fix_log_error
},
{
'
general-log
'
=>
sub
{
return
1
;
}
},
...
...
@@ -353,7 +354,7 @@ sub post_check_client_group {
sub
post_check_client_groups
{
my
(
$self
,
$config
)
=
@_
;
my
$first_mysqld
=
$config
->
first_like
('
mysqld.
');
my
$first_mysqld
=
$config
->
first_like
('
mysqld
\
.
');
return
unless
$first_mysqld
;
...
...
mysql-test/r/connect.result
View file @
806ec1b0
...
...
@@ -215,6 +215,13 @@ SET GLOBAL event_scheduler = OFF;
# -- End of Bug#35074.
SELECT 'Connection on extra port ok';
Connection on extra port ok
Connection on extra port ok
SELECT 'Connection on extra port 2 ok';
Connection on extra port 2 ok
Connection on extra port 2 ok
# -- Success: more than --extra-max-connections + 1 normal connections not possible
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
mysql-test/r/pool_of_threads.result
View file @
806ec1b0
...
...
@@ -2151,3 +2151,23 @@ Privat (Private Nutzung) Mobilfunk
Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
SELECT sleep(5);
SELECT sleep(5);
# -- Success: more than --thread-pool-size normal connections not possible
sleep(5)
0
sleep(5)
0
SELECT sleep(5);
SELECT sleep(5);
SELECT 'Connection on extra port ok';
Connection on extra port ok
Connection on extra port ok
SELECT 'Connection on extra port 2 ok';
Connection on extra port 2 ok
Connection on extra port 2 ok
# -- Success: more than --extra-max-connections + 1 normal connections not possible
sleep(5)
0
sleep(5)
0
mysql-test/t/connect.cnf
0 → 100644
View file @
806ec1b0
!include include/default_my.cnf
[mysqld.1]
extra-port= @mysqld.1.#extra-port
extra-max-connections=1
[ENV]
MASTER_EXTRA_PORT= @mysqld.1.extra-port
mysql-test/t/connect.test
View file @
806ec1b0
...
...
@@ -288,6 +288,33 @@ let $wait_condition =
--
echo
# -- End of Bug#35074.
--
echo
# Test connections to the extra port.
connect
(
extracon
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_EXTRA_PORT
,);
connection
extracon
;
SELECT
'Connection on extra port ok'
;
connect
(
extracon2
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_EXTRA_PORT
,);
connection
extracon2
;
SELECT
'Connection on extra port 2 ok'
;
--
disable_abort_on_error
--
disable_result_log
--
disable_query_log
connect
(
extracon3
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_EXTRA_PORT
,);
--
enable_query_log
--
enable_result_log
--
enable_abort_on_error
let
$error
=
$mysql_errno
;
if
(
!
$error
)
{
--
echo
# -- Error: managed to establish more than --extra-max-connections + 1 connections
}
if
(
$error
)
{
--
echo
# -- Success: more than --extra-max-connections + 1 normal connections not possible
}
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.1 tests
--
echo
# ------------------------------------------------------------------
mysql-test/t/pool_of_threads-master.opt
deleted
100644 → 0
View file @
4dc093ce
--test-ignore-wrong-options --thread-handling=pool-of-threads
mysql-test/t/pool_of_threads.cnf
0 → 100644
View file @
806ec1b0
!include include/default_my.cnf
[mysqld.1]
test-ignore-wrong-options
thread-handling= pool-of-threads
thread_pool_size= 2
extra-port= @mysqld.1.#extra-port
extra-max-connections=1
[client]
connect-timeout= 2
[ENV]
MASTER_EXTRA_PORT= @mysqld.1.extra-port
mysql-test/t/pool_of_threads.test
View file @
806ec1b0
...
...
@@ -5,3 +5,78 @@
--
source
include
/
common
-
tests
.
inc
# Test that we cannot have more simultaneous connections than
# --thread-pool-size on the standard port, but _can_ have additional
# connections on the extra port.
# First set two connections running, and check that extra connection
# on normal port fails due to--thread-pool-size=2
connection
default
;
send
SELECT
sleep
(
5
);
connect
(
con2
,
localhost
,
root
,,);
connection
con2
;
send
SELECT
sleep
(
5
);
--
sleep
1
--
disable_abort_on_error
--
disable_result_log
--
disable_query_log
connect
(
con3
,
localhost
,
root
,,);
--
enable_query_log
--
enable_result_log
--
enable_abort_on_error
let
$error
=
$mysql_errno
;
if
(
!
$error
)
{
--
echo
# -- Error: managed to establish more than --thread-pool-size connections
}
if
(
$error
)
{
--
echo
# -- Success: more than --thread-pool-size normal connections not possible
}
connection
default
;
--
reap
connection
con2
;
--
reap
# Now try again, but this time use the extra port to successfully connect.
connection
default
;
send
SELECT
sleep
(
5
);
connection
con2
;
send
SELECT
sleep
(
5
);
--
sleep
1
connect
(
extracon
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_EXTRA_PORT
,);
connection
extracon
;
SELECT
'Connection on extra port ok'
;
connect
(
extracon2
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_EXTRA_PORT
,);
connection
extracon2
;
SELECT
'Connection on extra port 2 ok'
;
--
disable_abort_on_error
--
disable_result_log
--
disable_query_log
connect
(
extracon3
,
127.0
.
0.1
,
root
,,
test
,
$MASTER_EXTRA_PORT
,);
--
enable_query_log
--
enable_result_log
--
enable_abort_on_error
let
$error
=
$mysql_errno
;
if
(
!
$error
)
{
--
echo
# -- Error: managed to establish more than --extra-max-connections + 1 connections
}
if
(
$error
)
{
--
echo
# -- Success: more than --extra-max-connections + 1 normal connections not possible
}
connection
default
;
--
reap
connection
con2
;
--
reap
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment