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
2e7a5d3e
Commit
2e7a5d3e
authored
Jan 07, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRUM
WL#1246 (Query cache in embedded library) Some fixes after testing
parent
d6545ace
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
libmysqld/emb_qcache.cc
libmysqld/emb_qcache.cc
+24
-8
sql/sql_cache.cc
sql/sql_cache.cc
+4
-4
No files found.
libmysqld/emb_qcache.cc
View file @
2e7a5d3e
...
@@ -284,11 +284,18 @@ uint emb_count_querycache_size(THD *thd)
...
@@ -284,11 +284,18 @@ uint emb_count_querycache_size(THD *thd)
MYSQL
*
mysql
=
thd
->
mysql
;
MYSQL
*
mysql
=
thd
->
mysql
;
MYSQL_FIELD
*
field
=
mysql
->
fields
;
MYSQL_FIELD
*
field
=
mysql
->
fields
;
MYSQL_FIELD
*
field_end
=
field
+
mysql
->
field_count
;
MYSQL_FIELD
*
field_end
=
field
+
mysql
->
field_count
;
MYSQL_ROWS
*
cur_row
=
NULL
;
my_ulonglong
n_rows
=
0
;
*
thd
->
data
->
prev_ptr
=
NULL
;
// this marks the last record
if
(
!
field
)
MYSQL_ROWS
*
cur_row
=
thd
->
data
->
data
;
return
0
;
if
(
thd
->
data
)
result
=
4
+
8
+
(
42
+
4
*
thd
->
data
->
rows
)
*
mysql
->
field_count
;
{
*
thd
->
data
->
prev_ptr
=
NULL
;
// this marks the last record
cur_row
=
thd
->
data
->
data
;
n_rows
=
thd
->
data
->
rows
;
}
result
=
4
+
8
+
(
42
+
4
*
n_rows
)
*
mysql
->
field_count
;
for
(;
field
<
field_end
;
field
++
)
for
(;
field
<
field_end
;
field
++
)
{
{
...
@@ -315,12 +322,21 @@ void emb_store_querycache_result(Querycache_stream *dst, THD *thd)
...
@@ -315,12 +322,21 @@ void emb_store_querycache_result(Querycache_stream *dst, THD *thd)
MYSQL
*
mysql
=
thd
->
mysql
;
MYSQL
*
mysql
=
thd
->
mysql
;
MYSQL_FIELD
*
field
=
mysql
->
fields
;
MYSQL_FIELD
*
field
=
mysql
->
fields
;
MYSQL_FIELD
*
field_end
=
field
+
mysql
->
field_count
;
MYSQL_FIELD
*
field_end
=
field
+
mysql
->
field_count
;
MYSQL_ROWS
*
cur_row
=
NULL
;
*
thd
->
data
->
prev_ptr
=
NULL
;
// this marks the last record
my_ulonglong
n_rows
=
0
;
MYSQL_ROWS
*
cur_row
=
thd
->
data
->
data
;
if
(
!
field
)
return
;
if
(
thd
->
data
)
{
*
thd
->
data
->
prev_ptr
=
NULL
;
// this marks the last record
cur_row
=
thd
->
data
->
data
;
n_rows
=
thd
->
data
->
rows
;
}
dst
->
store_int
((
uint
)
mysql
->
field_count
);
dst
->
store_int
((
uint
)
mysql
->
field_count
);
dst
->
store_ll
((
uint
)
thd
->
data
->
rows
);
dst
->
store_ll
((
uint
)
n_
rows
);
for
(;
field
<
field_end
;
field
++
)
for
(;
field
<
field_end
;
field
++
)
{
{
...
...
sql/sql_cache.cc
View file @
2e7a5d3e
...
@@ -653,10 +653,6 @@ void query_cache_abort(NET *net)
...
@@ -653,10 +653,6 @@ void query_cache_abort(NET *net)
void
query_cache_end_of_result
(
THD
*
thd
)
void
query_cache_end_of_result
(
THD
*
thd
)
{
{
DBUG_ENTER
(
"query_cache_end_of_result"
);
DBUG_ENTER
(
"query_cache_end_of_result"
);
#ifdef EMBEDDED_LIBRARY
query_cache_insert
(
&
thd
->
net
,
(
byte
*
)
thd
,
emb_count_querycache_size
(
thd
));
#endif
#ifndef DBUG_OFF
#ifndef DBUG_OFF
// Check if we have called query_cache.wreck() (which disables the cache)
// Check if we have called query_cache.wreck() (which disables the cache)
...
@@ -665,6 +661,10 @@ void query_cache_end_of_result(THD *thd)
...
@@ -665,6 +661,10 @@ void query_cache_end_of_result(THD *thd)
if
(
thd
->
net
.
query_cache_query
!=
0
)
// Quick check on unlocked structure
if
(
thd
->
net
.
query_cache_query
!=
0
)
// Quick check on unlocked structure
{
{
#ifdef EMBEDDED_LIBRARY
query_cache_insert
(
&
thd
->
net
,
(
byte
*
)
thd
,
emb_count_querycache_size
(
thd
));
#endif
STRUCT_LOCK
(
&
query_cache
.
structure_guard_mutex
);
STRUCT_LOCK
(
&
query_cache
.
structure_guard_mutex
);
Query_cache_block
*
query_block
=
((
Query_cache_block
*
)
Query_cache_block
*
query_block
=
((
Query_cache_block
*
)
thd
->
net
.
query_cache_query
);
thd
->
net
.
query_cache_query
);
...
...
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