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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1f3c062b
Commit
1f3c062b
authored
Mar 13, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge quad.:/mnt/raid/alik/MySQL/devel/5.1-rt
into quad.:/mnt/raid/alik/MySQL/devel/bug-35074/5.1-rt-bug35074
parents
054341a6
c167501b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
3 deletions
+112
-3
mysql-test/r/connect.result
mysql-test/r/connect.result
+34
-0
mysql-test/t/connect.test
mysql-test/t/connect.test
+75
-0
sql/mysqld.cc
sql/mysqld.cc
+3
-3
No files found.
mysql-test/r/connect.result
View file @
1f3c062b
...
...
@@ -162,14 +162,48 @@ root
# -- Resetting variables...
SET GLOBAL max_connections = 151;
# -- Stopping Event Scheduler...
SET GLOBAL event_scheduler = OFF;
# -- Waiting for Event Scheduler to stop...
# -- That's it. Closing connections...
# -- Restoring default connection...
# -- Waiting for connections to close...
DROP USER mysqltest_u1@localhost;
# -- End of Bug#33507.
# -- Bug#35074: max_used_connections is not correct.
FLUSH STATUS;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 1
# -- Starting Event Scheduler...
SET GLOBAL event_scheduler = ON;
# -- Waiting for Event Scheduler to start...
# -- Opening a new connection to check max_used_connections...
# -- Check that max_used_connections hasn't changed.
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 2
# -- Closing new connection...
# -- Stopping Event Scheduler...
SET GLOBAL event_scheduler = OFF;
# -- Waiting for Event Scheduler to stop...
# -- End of Bug#35074.
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
mysql-test/t/connect.test
View file @
1f3c062b
...
...
@@ -209,22 +209,97 @@ SELECT user FROM information_schema.processlist ORDER BY id;
--
echo
# -- Resetting variables...
--
eval
SET
GLOBAL
max_connections
=
$saved_max_connections
--
echo
--
echo
# -- Stopping Event Scheduler...
SET
GLOBAL
event_scheduler
=
OFF
;
--
echo
# -- Waiting for Event Scheduler to stop...
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
0
FROM
information_schema
.
processlist
WHERE
user
=
'event_scheduler'
;
--
source
include
/
wait_condition
.
inc
--
echo
--
echo
# -- That's it. Closing connections...
--
disconnect
con_1
--
disconnect
con_2
--
disconnect
con_3
--
disconnect
con_super_1
--
echo
--
echo
# -- Restoring default connection...
--
connect
(
default
,
localhost
,
root
,,
test
)
--
echo
--
echo
# -- Waiting for connections to close...
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
information_schema
.
processlist
WHERE
db
=
'test'
;
--
source
include
/
wait_condition
.
inc
--
echo
DROP
USER
mysqltest_u1
@
localhost
;
--
echo
--
echo
# -- End of Bug#33507.
--
echo
###########################################################################
--
echo
# -- Bug#35074: max_used_connections is not correct.
--
echo
FLUSH
STATUS
;
--
echo
SHOW
STATUS
LIKE
'max_used_connections'
;
--
echo
--
echo
# -- Starting Event Scheduler...
SET
GLOBAL
event_scheduler
=
ON
;
--
echo
# -- Waiting for Event Scheduler to start...
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
information_schema
.
processlist
WHERE
user
=
'event_scheduler'
;
--
source
include
/
wait_condition
.
inc
# NOTE: We should use a new connection here instead of reconnect in order to
# avoid races (we can not for sure when the connection being disconnected is
# actually disconnected on the server).
--
echo
--
echo
# -- Opening a new connection to check max_used_connections...
--
connect
(
con_1
,
localhost
,
root
)
--
echo
--
echo
# -- Check that max_used_connections hasn't changed.
SHOW
STATUS
LIKE
'max_used_connections'
;
--
echo
--
echo
# -- Closing new connection...
--
disconnect
con_1
--
connection
default
--
echo
--
echo
# -- Stopping Event Scheduler...
SET
GLOBAL
event_scheduler
=
OFF
;
--
echo
# -- Waiting for Event Scheduler to stop...
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
0
FROM
information_schema
.
processlist
WHERE
user
=
'event_scheduler'
;
--
source
include
/
wait_condition
.
inc
--
echo
--
echo
# -- End of Bug#35074.
--
echo
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.1 tests
--
echo
# ------------------------------------------------------------------
sql/mysqld.cc
View file @
1f3c062b
...
...
@@ -4776,6 +4776,9 @@ static void create_new_thread(THD *thd)
++
connection_count
;
if
(
connection_count
>
max_used_connections
)
max_used_connections
=
connection_count
;
pthread_mutex_unlock
(
&
LOCK_connection_count
);
/* Start a new thread to handle connection. */
...
...
@@ -4791,9 +4794,6 @@ static void create_new_thread(THD *thd)
thread_count
++
;
if
(
thread_count
-
delayed_insert_threads
>
max_used_connections
)
max_used_connections
=
thread_count
-
delayed_insert_threads
;
thread_scheduler
.
add_connection
(
thd
);
DBUG_VOID_RETURN
;
...
...
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