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
c75eec8e
Commit
c75eec8e
authored
Jan 19, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename st_my_thread_var::opt_info -> st_my_thread_var::keycache_link
parent
e2a27682
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
27 deletions
+26
-27
include/my_pthread.h
include/my_pthread.h
+1
-1
mysys/mf_keycache.c
mysys/mf_keycache.c
+12
-12
sql/sql_show.cc
sql/sql_show.cc
+3
-4
storage/maria/ma_pagecache.c
storage/maria/ma_pagecache.c
+10
-10
No files found.
include/my_pthread.h
View file @
c75eec8e
...
...
@@ -724,7 +724,7 @@ struct st_my_thread_var
int
volatile
abort
;
my_bool
init
;
struct
st_my_thread_var
*
next
,
**
prev
;
void
*
opt_info
;
void
*
keycache_link
;
uint
lock_type
;
/* used by conditional release the queue */
void
*
stack_ends_here
;
safe_mutex_t
*
mutex_in_use
;
...
...
mysys/mf_keycache.c
View file @
c75eec8e
...
...
@@ -1370,7 +1370,7 @@ static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block,
keycache
->
waiting_for_block
.
last_thread
;
struct
st_my_thread_var
*
first_thread
=
last_thread
->
next
;
struct
st_my_thread_var
*
next_thread
=
first_thread
;
HASH_LINK
*
hash_link
=
(
HASH_LINK
*
)
first_thread
->
opt_info
;
HASH_LINK
*
hash_link
=
(
HASH_LINK
*
)
first_thread
->
keycache_link
;
struct
st_my_thread_var
*
thread
;
do
{
...
...
@@ -1380,7 +1380,7 @@ static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block,
We notify about the event all threads that ask
for the same page as the first thread in the queue
*/
if
((
HASH_LINK
*
)
thread
->
opt_info
==
hash_link
)
if
((
HASH_LINK
*
)
thread
->
keycache_link
==
hash_link
)
{
KEYCACHE_DBUG_PRINT
(
"link_block: signal"
,
(
"thread %ld"
,
thread
->
id
));
keycache_pthread_cond_signal
(
&
thread
->
suspend
);
...
...
@@ -1714,7 +1714,7 @@ static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
keycache
->
waiting_for_hash_link
.
last_thread
;
struct
st_my_thread_var
*
first_thread
=
last_thread
->
next
;
struct
st_my_thread_var
*
next_thread
=
first_thread
;
KEYCACHE_PAGE
*
first_page
=
(
KEYCACHE_PAGE
*
)
(
first_thread
->
opt_info
);
KEYCACHE_PAGE
*
first_page
=
(
KEYCACHE_PAGE
*
)
(
first_thread
->
keycache_link
);
struct
st_my_thread_var
*
thread
;
hash_link
->
file
=
first_page
->
file
;
...
...
@@ -1723,7 +1723,7 @@ static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
{
KEYCACHE_PAGE
*
page
;
thread
=
next_thread
;
page
=
(
KEYCACHE_PAGE
*
)
thread
->
opt_info
;
page
=
(
KEYCACHE_PAGE
*
)
thread
->
keycache_link
;
next_thread
=
thread
->
next
;
/*
We notify about the event all threads that ask
...
...
@@ -1812,13 +1812,13 @@ static HASH_LINK *get_hash_link(SIMPLE_KEY_CACHE_CB *keycache,
KEYCACHE_DBUG_PRINT
(
"get_hash_link"
,
(
"waiting"
));
page
.
file
=
file
;
page
.
filepos
=
filepos
;
thread
->
opt_info
=
(
void
*
)
&
page
;
thread
->
keycache_link
=
(
void
*
)
&
page
;
link_into_queue
(
&
keycache
->
waiting_for_hash_link
,
thread
);
KEYCACHE_DBUG_PRINT
(
"get_hash_link: wait"
,
(
"suspend thread %ld"
,
thread
->
id
));
keycache_pthread_cond_wait
(
&
thread
->
suspend
,
&
keycache
->
cache_lock
);
thread
->
opt_info
=
NULL
;
thread
->
keycache_link
=
NULL
;
goto
restart
;
}
hash_link
->
file
=
file
;
...
...
@@ -1976,7 +1976,7 @@ static BLOCK_LINK *find_key_block(SIMPLE_KEY_CACHE_CB *keycache,
for another file/pos.
*/
thread
=
my_thread_var
;
thread
->
opt_info
=
(
void
*
)
hash_link
;
thread
->
keycache_link
=
(
void
*
)
hash_link
;
link_into_queue
(
&
keycache
->
waiting_for_block
,
thread
);
do
{
...
...
@@ -1985,7 +1985,7 @@ static BLOCK_LINK *find_key_block(SIMPLE_KEY_CACHE_CB *keycache,
keycache_pthread_cond_wait
(
&
thread
->
suspend
,
&
keycache
->
cache_lock
);
}
while
(
thread
->
next
);
thread
->
opt_info
=
NULL
;
thread
->
keycache_link
=
NULL
;
/*
A block should now be assigned to the hash_link. But it may
still need to be evicted. Anyway, we should re-check the
...
...
@@ -2323,7 +2323,7 @@ static BLOCK_LINK *find_key_block(SIMPLE_KEY_CACHE_CB *keycache,
*/
struct
st_my_thread_var
*
thread
=
my_thread_var
;
thread
->
opt_info
=
(
void
*
)
hash_link
;
thread
->
keycache_link
=
(
void
*
)
hash_link
;
link_into_queue
(
&
keycache
->
waiting_for_block
,
thread
);
do
{
...
...
@@ -2333,7 +2333,7 @@ static BLOCK_LINK *find_key_block(SIMPLE_KEY_CACHE_CB *keycache,
&
keycache
->
cache_lock
);
}
while
(
thread
->
next
);
thread
->
opt_info
=
NULL
;
thread
->
keycache_link
=
NULL
;
/* Assert that block has a request registered. */
DBUG_ASSERT
(
hash_link
->
block
->
requests
);
/* Assert that block is not in LRU ring. */
...
...
@@ -4588,7 +4588,7 @@ static void keycache_dump(SIMPLE_KEY_CACHE_CB *keycache)
do
{
thread
=
thread
->
next
;
page
=
(
KEYCACHE_PAGE
*
)
thread
->
opt_info
;
page
=
(
KEYCACHE_PAGE
*
)
thread
->
keycache_link
;
fprintf
(
keycache_dump_file
,
"thread:%u, (file,filepos)=(%u,%lu)
\n
"
,
thread
->
id
,(
uint
)
page
->
file
,(
ulong
)
page
->
filepos
);
...
...
@@ -4604,7 +4604,7 @@ static void keycache_dump(SIMPLE_KEY_CACHE_CB *keycache)
do
{
thread
=
thread
->
next
;
hash_link
=
(
HASH_LINK
*
)
thread
->
opt_info
;
hash_link
=
(
HASH_LINK
*
)
thread
->
keycache_link
;
fprintf
(
keycache_dump_file
,
"thread:%u hash_link:%u (file,filepos)=(%u,%lu)
\n
"
,
thread
->
id
,
(
uint
)
HASH_LINK_NUMBER
(
hash_link
),
...
...
sql/sql_show.cc
View file @
c75eec8e
...
...
@@ -4275,7 +4275,7 @@ fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys,
Again we don't do this for SHOW COLUMNS/KEYS because
of backward compatibility.
*/
if
(
!
is_show_fields_or_keys
&&
result
&&
thd
->
is_error
()
&&
if
(
!
is_show_fields_or_keys
&&
result
&&
(
thd
->
get_stmt_da
()
->
sql_errno
()
==
ER_NO_SUCH_TABLE
||
thd
->
get_stmt_da
()
->
sql_errno
()
==
ER_WRONG_OBJECT
))
{
...
...
@@ -5282,12 +5282,11 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
column with the error text, and clear the error so that the operation
can continue.
*/
const
char
*
error
=
thd
->
is_error
()
?
thd
->
get_stmt_da
()
->
message
()
:
""
;
const
char
*
error
=
thd
->
get_stmt_da
()
->
message
()
;
table
->
field
[
20
]
->
store
(
error
,
strlen
(
error
),
cs
);
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
thd
->
get_stmt_da
()
->
sql_errno
(),
thd
->
get_stmt_da
()
->
message
());
thd
->
get_stmt_da
()
->
sql_errno
(),
error
);
thd
->
clear_error
();
}
...
...
storage/maria/ma_pagecache.c
View file @
c75eec8e
...
...
@@ -1314,7 +1314,7 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block,
struct
st_my_thread_var
*
first_thread
=
last_thread
->
next
;
struct
st_my_thread_var
*
next_thread
=
first_thread
;
PAGECACHE_HASH_LINK
*
hash_link
=
(
PAGECACHE_HASH_LINK
*
)
first_thread
->
opt_info
;
(
PAGECACHE_HASH_LINK
*
)
first_thread
->
keycache_link
;
struct
st_my_thread_var
*
thread
;
DBUG_ASSERT
(
block
->
requests
+
block
->
wlocks
+
block
->
rlocks
+
...
...
@@ -1329,7 +1329,7 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block,
We notify about the event all threads that ask
for the same page as the first thread in the queue
*/
if
((
PAGECACHE_HASH_LINK
*
)
thread
->
opt_info
==
hash_link
)
if
((
PAGECACHE_HASH_LINK
*
)
thread
->
keycache_link
==
hash_link
)
{
DBUG_PRINT
(
"signal"
,
(
"thread: %s %ld"
,
thread
->
name
,
thread
->
id
));
pagecache_pthread_cond_signal
(
&
thread
->
suspend
);
...
...
@@ -1642,7 +1642,7 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link)
pagecache
->
waiting_for_hash_link
.
last_thread
;
struct
st_my_thread_var
*
first_thread
=
last_thread
->
next
;
struct
st_my_thread_var
*
next_thread
=
first_thread
;
PAGECACHE_PAGE
*
first_page
=
(
PAGECACHE_PAGE
*
)
(
first_thread
->
opt_info
);
PAGECACHE_PAGE
*
first_page
=
(
PAGECACHE_PAGE
*
)
(
first_thread
->
keycache_link
);
struct
st_my_thread_var
*
thread
;
hash_link
->
file
=
first_page
->
file
;
...
...
@@ -1652,7 +1652,7 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link)
{
PAGECACHE_PAGE
*
page
;
thread
=
next_thread
;
page
=
(
PAGECACHE_PAGE
*
)
thread
->
opt_info
;
page
=
(
PAGECACHE_PAGE
*
)
thread
->
keycache_link
;
next_thread
=
thread
->
next
;
/*
We notify about the event all threads that ask
...
...
@@ -1798,13 +1798,13 @@ static PAGECACHE_HASH_LINK *get_hash_link(PAGECACHE *pagecache,
PAGECACHE_PAGE
page
;
page
.
file
=
*
file
;
page
.
pageno
=
pageno
;
thread
->
opt_info
=
(
void
*
)
&
page
;
thread
->
keycache_link
=
(
void
*
)
&
page
;
wqueue_link_into_queue
(
&
pagecache
->
waiting_for_hash_link
,
thread
);
DBUG_PRINT
(
"wait"
,
(
"suspend thread %s %ld"
,
thread
->
name
,
thread
->
id
));
pagecache_pthread_cond_wait
(
&
thread
->
suspend
,
&
pagecache
->
cache_lock
);
thread
->
opt_info
=
NULL
;
thread
->
keycache_link
=
NULL
;
DBUG_PRINT
(
"thread"
,
(
"restarting..."
));
goto
restart
;
}
...
...
@@ -2067,7 +2067,7 @@ static PAGECACHE_BLOCK_LINK *find_block(PAGECACHE *pagecache,
*/
struct
st_my_thread_var
*
thread
=
my_thread_var
;
thread
->
opt_info
=
(
void
*
)
hash_link
;
thread
->
keycache_link
=
(
void
*
)
hash_link
;
wqueue_link_into_queue
(
&
pagecache
->
waiting_for_block
,
thread
);
do
{
...
...
@@ -2077,7 +2077,7 @@ static PAGECACHE_BLOCK_LINK *find_block(PAGECACHE *pagecache,
&
pagecache
->
cache_lock
);
}
while
(
thread
->
next
);
thread
->
opt_info
=
NULL
;
thread
->
keycache_link
=
NULL
;
block
=
hash_link
->
block
;
/* Ensure that the block is registered */
DBUG_ASSERT
(
block
->
requests
>=
1
);
...
...
@@ -5057,7 +5057,7 @@ static void pagecache_dump(PAGECACHE *pagecache)
do
{
thread
=
thread
->
next
;
page
=
(
PAGECACHE_PAGE
*
)
thread
->
opt_info
;
page
=
(
PAGECACHE_PAGE
*
)
thread
->
keycache_link
;
fprintf
(
pagecache_dump_file
,
"thread: %s %ld, (file,pageno)=(%u,%lu)
\n
"
,
thread
->
name
,
thread
->
id
,
...
...
@@ -5074,7 +5074,7 @@ static void pagecache_dump(PAGECACHE *pagecache)
do
{
thread
=
thread
->
next
;
hash_link
=
(
PAGECACHE_HASH_LINK
*
)
thread
->
opt_info
;
hash_link
=
(
PAGECACHE_HASH_LINK
*
)
thread
->
keycache_link
;
fprintf
(
pagecache_dump_file
,
"thread: %s %u hash_link:%u (file,pageno)=(%u,%lu)
\n
"
,
thread
->
name
,
thread
->
id
,
...
...
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