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
c16b2429
Commit
c16b2429
authored
Mar 23, 2023
by
Nikita Malyavin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wake up from sleep
parent
d8c908bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
mysql-test/suite/perfschema/r/variables_by_thread.result
mysql-test/suite/perfschema/r/variables_by_thread.result
+15
-0
mysql-test/suite/perfschema/t/variables_by_thread.test
mysql-test/suite/perfschema/t/variables_by_thread.test
+13
-0
sql/item_func.cc
sql/item_func.cc
+2
-1
No files found.
mysql-test/suite/perfschema/r/variables_by_thread.result
View file @
c16b2429
...
...
@@ -147,6 +147,21 @@ WHERE variable_name = "time_zone";
current variable_value
1 +02:00
0 SYSTEM
# Test sleep
connect con_sleep, localhost, root,,;
set debug_sync= "func_sleep_locked SIGNAL lock WAIT_FOR goon";
select sleep(3);
connection default;
set debug_sync= "now WAIT_FOR lock";
set debug_sync= "apc_after_notify SIGNAL goon";
SELECT thread_id = @def_thread_id as current, variable_value
FROM performance_schema.variables_by_thread
WHERE variable_name = "time_zone";
current variable_value
1 +02:00
0 SYSTEM
0 SYSTEM
disconnect con_sleep;
# Cleanup
connection default;
set debug_sync= "reset";
...
...
mysql-test/suite/perfschema/t/variables_by_thread.test
View file @
c16b2429
...
...
@@ -149,6 +149,19 @@ SELECT thread_id = @def_thread_id as current, variable_value
FROM
performance_schema
.
variables_by_thread
WHERE
variable_name
=
"time_zone"
;
--
echo
# Test sleep
--
connect
(
con_sleep
,
localhost
,
root
,,)
set
debug_sync
=
"func_sleep_locked SIGNAL lock WAIT_FOR goon"
;
send
select
sleep
(
3
);
--
connection
default
set
debug_sync
=
"now WAIT_FOR lock"
;
set
debug_sync
=
"apc_after_notify SIGNAL goon"
;
SELECT
thread_id
=
@
def_thread_id
as
current
,
variable_value
FROM
performance_schema
.
variables_by_thread
WHERE
variable_name
=
"time_zone"
;
--
disconnect
con_sleep
--
echo
# Cleanup
--
connection
default
...
...
sql/item_func.cc
View file @
c16b2429
...
...
@@ -4584,13 +4584,14 @@ longlong Item_func_sleep::val_int()
mysql_cond_init
(
key_item_func_sleep_cond
,
&
cond
,
NULL
);
mysql_mutex_lock
(
&
LOCK_item_func_sleep
);
DEBUG_SYNC
(
thd
,
"func_sleep_locked"
);
THD_STAGE_INFO
(
thd
,
stage_user_sleep
);
thd
->
mysys_var
->
current_mutex
=
&
LOCK_item_func_sleep
;
thd
->
mysys_var
->
current_cond
=
&
cond
;
error
=
0
;
thd_wait_begin
(
thd
,
THD_WAIT_SLEEP
);
while
(
!
thd
->
killed
)
while
(
!
thd
->
check_killed
(
true
)
)
{
error
=
timed_cond
.
wait
(
&
cond
,
&
LOCK_item_func_sleep
);
if
(
error
==
ETIMEDOUT
||
error
==
ETIME
)
...
...
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