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
5d46eeef
Commit
5d46eeef
authored
May 29, 2018
by
Eugene Kosov
Committed by
Sergey Vojtovich
May 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified away READ_RECORD::cache_records
parent
3950a98a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
sql/records.cc
sql/records.cc
+11
-11
sql/records.h
sql/records.h
+0
-1
No files found.
sql/records.cc
View file @
5d46eeef
...
...
@@ -584,7 +584,7 @@ static int rr_unpack_from_buffer(READ_RECORD *info)
static
int
init_rr_cache
(
THD
*
thd
,
READ_RECORD
*
info
)
{
uint
rec_cache_size
;
uint
rec_cache_size
,
cache_records
;
DBUG_ENTER
(
"init_rr_cache"
);
info
->
struct_length
=
3
+
MAX_REFLENGTH
;
...
...
@@ -593,22 +593,22 @@ static int init_rr_cache(THD *thd, READ_RECORD *info)
info
->
reclength
=
ALIGN_SIZE
(
info
->
struct_length
);
info
->
error_offset
=
info
->
table
->
s
->
reclength
;
info
->
cache_records
=
(
thd
->
variables
.
read_rnd_buff_size
/
(
info
->
reclength
+
info
->
struct_length
)
);
rec_cache_size
=
info
->
cache_records
*
info
->
reclength
;
info
->
rec_cache_size
=
info
->
cache_records
*
info
->
ref_length
;
cache_records
=
thd
->
variables
.
read_rnd_buff_size
/
(
info
->
reclength
+
info
->
struct_length
);
rec_cache_size
=
cache_records
*
info
->
reclength
;
info
->
rec_cache_size
=
cache_records
*
info
->
ref_length
;
// We have to allocate one more byte to use uint3korr (see comments for it)
if
(
info
->
cache_records
<=
2
||
!
(
info
->
cache
=
(
uchar
*
)
my_malloc_lock
(
rec_cache_size
+
info
->
cache_records
*
info
->
struct_length
+
1
,
MYF
(
MY_THREAD_SPECIFIC
))))
if
(
cache_records
<=
2
||
!
(
info
->
cache
=
(
uchar
*
)
my_malloc_lock
(
rec_cache_size
+
cache_records
*
info
->
struct_length
+
1
,
MYF
(
MY_THREAD_SPECIFIC
))))
DBUG_RETURN
(
1
);
#ifdef HAVE_valgrind
// Avoid warnings in qsort
bzero
(
info
->
cache
,
rec_cache_size
+
info
->
cache_records
*
info
->
struct_length
+
1
);
bzero
(
info
->
cache
,
rec_cache_size
+
cache_records
*
info
->
struct_length
+
1
);
#endif
DBUG_PRINT
(
"info"
,
(
"Allocated buffert for %d records"
,
info
->
cache_records
));
DBUG_PRINT
(
"info"
,
(
"Allocated buffer for %d records"
,
cache_records
));
info
->
read_positions
=
info
->
cache
+
rec_cache_size
;
info
->
cache_pos
=
info
->
cache_end
=
info
->
cache
;
DBUG_RETURN
(
0
);
...
...
sql/records.h
View file @
5d46eeef
...
...
@@ -56,7 +56,6 @@ struct READ_RECORD
Read_func
read_record_func
;
THD
*
thd
;
SQL_SELECT
*
select
;
uint
cache_records
;
uint
ref_length
,
struct_length
,
reclength
,
rec_cache_size
,
error_offset
;
uchar
*
ref_pos
;
/* pointer to form->refpos */
uchar
*
record
;
...
...
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