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
2f99a53e
Commit
2f99a53e
authored
Oct 15, 2008
by
Horst Hunger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final patch for bug#36733 containing all changes.
parent
6597382c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
134 deletions
+57
-134
mysql-test/r/thread_cache_size_func.result
mysql-test/r/thread_cache_size_func.result
+3
-39
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+0
-1
mysql-test/t/thread_cache_size_func.test
mysql-test/t/thread_cache_size_func.test
+54
-94
No files found.
mysql-test/r/thread_cache_size_func.result
View file @
2f99a53e
...
...
@@ -2,67 +2,31 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
FLUSH STATUS;
'# Test1#'
SET @@GLOBAL.thread_cache_size=3;
Saving threads cached, threads created values
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
'#Old value for thread_cache'#
** Connecting conn1 using username 'root' **
** Connecting conn2 using username 'root' **
** Connecting conn3 using username 'root' **
** Connecting conn4 using username 'root' **
Saving threads cached, threads created values
Threads Created Difference
4
4 Expected
** Connection default **
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
** Connection default **
** Disconnecting conn1,conn2,conn3,conn4 **
'#new values for thread cache after disconnecting'#
Saving threads cached, threads created values
Threads Created Difference
0
0 Expected
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 3
3 Expected
SET @@GLOBAL.thread_cache_size=1;
Saving threads cached, threads created values
Threads Created Difference
0
0 Expected
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 3
1 Expected
Bug: The number of threads cached should have decreased with cache size decrease.
SET @@GLOBAL.thread_cache_size= 1;
** Connecting conn1 using username 'root' **
** Connecting conn2 using username 'root' **
Saving threads cached, threads created values
Threads Created Difference
0
1 Expected
Bug: The number of threads created should have increased because the cache should have 1 thread only
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 1
0 Expected
Bug: The number of threads created should have decreased because atleast 1 new connection came in
** Connection default **
connection default;
** Disconnecting conn1,conn2 **
'#new status values for thread cache'#
Saving threads cached, threads created values
Threads Created Difference
0
0 Expected
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 1
1 Expected
Saving threads cached, threads created values
SET @@GLOBAL.thread_cache_size = @global_thread_cache_size;
mysql-test/t/disabled.def
View file @
2f99a53e
...
...
@@ -11,7 +11,6 @@
##############################################################################
federated_transactions : Bug#29523 Transactions do not work
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
thread_cache_size_func : Bug#36733 main.thread_cache_size_func fails randomly
log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
events-bugs.test : Bug #39848, Bug #39863, Bug #39569, Bug #37774
mysql-test/t/thread_cache_size_func.test
View file @
2f99a53e
############# mysql-test\t\thread_cache_size_func.test #######################################
# #
# Variable Name: thread_cache_size #
# Scope: SESSION #
# Access Type: Dynamic #
# Data Type: Enumeration #
# Default Value: 0 #
# Values: 0-16384 #
# #
# #
# Creation Date: 2008-03-02 #
# Author: Sharique Abdullah #
# #
# Description: Test Cases of Dynamic System Variable "thread_cache_size" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# option_mysqld_thread_cache_size #
# #
#########################################################################################
############# mysql-test\t\thread_cache_size_func.test ##########################
# #
# Variable Name: thread_cache_size #
# Scope: SESSION #
# Access Type: Dynamic #
# Data Type: Enumeration #
# Default Value: 0 #
# Values: 0-16384 #
# #
# #
# Creation Date: 2008-03-02 #
# Author: Sharique Abdullah #
# #
# Modified: HHunger 2008-08-27 Reduced test to needed function and inserted #
# wait-loops #
# #
# Description: Test Cases of Dynamic System Variable "thread_cache_size" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
# Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
#################################################################################
#
# Setup
...
...
@@ -32,41 +33,31 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
FLUSH
STATUS
;
#
# Greater than cache threads, setting cache size to 3
#
--
ECHO
'# Test1#'
SET
@@
GLOBAL
.
thread_cache_size
=
3
;
let
$threadsCreated1
=
query_get_value
(
SHOW
STATUS
LIKE
'Threads_created'
,
Value
,
1
);
--
echo
Saving
threads
cached
,
threads
created
values
SHOW
STATUS
LIKE
'Threads_cached'
;
--
echo
0
Expected
--
ECHO
'#Old value for thread_cache'
#
##################################
# Make 4 connections #
##################################
--
echo
**
Connecting
conn1
using
username
'root'
**
connect
(
conn1
,
localhost
,
root
,,);
CONNECT
(
conn1
,
localhost
,
root
,,);
--
echo
**
Connecting
conn2
using
username
'root'
**
connect
(
conn2
,
localhost
,
root
,,);
CONNECT
(
conn2
,
localhost
,
root
,,);
--
echo
**
Connecting
conn3
using
username
'root'
**
connect
(
conn3
,
localhost
,
root
,,);
CONNECT
(
conn3
,
localhost
,
root
,,);
--
echo
**
Connecting
conn4
using
username
'root'
**
connect
(
conn4
,
localhost
,
root
,,);
CONNECT
(
conn4
,
localhost
,
root
,,);
let
$threadsCreated2
=
query_get_value
(
SHOW
STATUS
LIKE
'Threads_created'
,
Value
,
1
);
--
echo
Saving
threads
cached
,
threads
created
values
--
echo
**
Connection
default
**
CONNECTION
default
;
--
disable_query_log
eval
SELECT
(
$threadsCreated2
-
$threadsCreated1
)
AS
'Threads Created Difference'
;
--
enable_query_log
# Wait until all connections done
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
5
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
;
--
source
include
/
wait_condition
.
inc
--
echo
4
Expected
SHOW
STATUS
LIKE
'Threads_cached'
;
--
echo
0
Expected
...
...
@@ -74,85 +65,54 @@ SHOW STATUS LIKE 'Threads_cached';
#Disconnecting all the connections #
####################################
--
echo
**
Connection
default
**
connection
default
;
--
echo
**
Disconnecting
conn1
,
conn2
,
conn3
,
conn4
**
disconnect
conn1
;
disconnect
conn2
;
disconnect
conn3
;
disconnect
conn4
;
DISCONNECT
conn1
;
DISCONNECT
conn2
;
DISCONNECT
conn3
;
DISCONNECT
conn4
;
#
# Checking the status
#
--
echo
'#new values for thread cache after disconnecting'
#
let
$threadsCreated3
=
query_get_value
(
SHOW
STATUS
LIKE
'Threads_created'
,
Value
,
1
);
# Wait until all disconnects ready
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
;
--
source
include
/
wait_condition
.
inc
--
echo
Saving
threads
cached
,
threads
created
values
--
disable_query_log
eval
SELECT
(
$threadsCreated3
-
$threadsCreated2
)
AS
'Threads Created Difference'
;
--
enable_query_log
--
echo
0
Expected
SHOW
STATUS
LIKE
'Threads_cached'
;
--
echo
3
Expected
#
# Decreasing cache size to 1
#
SET
@@
GLOBAL
.
thread_cache_size
=
1
;
connection
default
;
let
$threadsCreated6
=
query_get_value
(
SHOW
STATUS
LIKE
'Threads_created'
,
Value
,
1
);
--
echo
Saving
threads
cached
,
threads
created
values
--
disable_query_log
eval
SELECT
$threadsCreated6
-
$threadsCreated3
AS
'Threads Created Difference'
;
--
enable_query_log
--
echo
0
Expected
SHOW
STATUS
LIKE
'Threads_cached'
;
--
echo
1
Expected
--
echo
Bug
:
The
number
of
threads
cached
should
have
decreased
with
cache
size
decrease
.
SET
@@
GLOBAL
.
thread_cache_size
=
1
;
--
echo
**
Connecting
conn1
using
username
'root'
**
CONNECT
(
conn1
,
localhost
,
root
,,);
--
echo
**
Connecting
conn2
using
username
'root'
**
CONNECT
(
conn2
,
localhost
,
root
,,);
let
$threadsCreated4
=
query_get_value
(
SHOW
STATUS
LIKE
'Threads_created'
,
Value
,
1
);
--
echo
Saving
threads
cached
,
threads
created
values
--
disable_query_log
eval
SELECT
$threadsCreated4
-
$threadsCreated3
AS
'Threads Created Difference'
;
--
enable_query_log
--
echo
1
Expected
--
echo
Bug
:
The
number
of
threads
created
should
have
increased
because
the
cache
should
have
1
thread
only
SHOW
STATUS
LIKE
'Threads_cached'
;
--
echo
0
Expected
--
echo
Bug
:
The
number
of
threads
created
should
have
decreased
because
atleast
1
new
connection
came
in
--
echo
connection
default
;
CONNECTION
default
;
--
echo
**
Connection
default
**
connection
default
;
# Wait until all connects ready
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
3
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
;
--
source
include
/
wait_condition
.
inc
--
echo
**
Disconnecting
conn1
,
conn2
**
disconnect
conn1
;
disconnect
conn2
;
--
ECHO
'#new status values for thread cache'
#
let
$threadsCreated5
=
query_get_value
(
SHOW
STATUS
LIKE
'Threads_created'
,
Value
,
1
);
--
echo
Saving
threads
cached
,
threads
created
values
--
disable_query_log
eval
SELECT
(
$threadsCreated5
-
$threadsCreated4
)
AS
'Threads Created Difference'
;
--
enable_query_log
--
echo
0
Expected
DISCONNECT
conn1
;
DISCONNECT
conn2
;
# Wait until all disconnects ready
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
;
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'Threads_cached'
;
--
echo
1
Expected
--
echo
Saving
threads
cached
,
threads
created
values
#
# Cleanup
#
SET
@@
GLOBAL
.
thread_cache_size
=
@
global_thread_cache_size
;
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