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
0ae810ae
Commit
0ae810ae
authored
Jul 09, 2002
by
serg@sergbook.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mi_fix_rec_buff_for_blob() generalized a bit
parent
ffe18e48
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
19 deletions
+16
-19
myisam/mi_dynrec.c
myisam/mi_dynrec.c
+12
-5
myisam/mi_extra.c
myisam/mi_extra.c
+1
-1
myisam/mi_open.c
myisam/mi_open.c
+3
-13
No files found.
myisam/mi_dynrec.c
View file @
0ae810ae
...
...
@@ -1094,16 +1094,23 @@ err:
byte
*
mi_fix_rec_buff_for_blob
(
MI_INFO
*
info
,
ulong
length
)
{
uint
extra
;
/* to simplify initial init of info->rec_buf in mi_open and mi_extra */
if
(
!
length
)
length
=
max
(
info
->
s
->
base
.
pack_reclength
,
info
->
s
->
base
.
max_key_length
);
if
(
!
info
->
rec_buff
||
length
>
info
->
alloced_rec_buff_length
)
{
byte
*
newptr
;
extra
=
ALIGN_SIZE
(
MI_MAX_DYN_BLOCK_HEADER
)
+
MI_SPLIT_LENGTH
+
MI_DYN_DELETE_BLOCK_HEADER
;
if
(
!
(
newptr
=
(
byte
*
)
my_realloc
((
gptr
)
info
->
rec_alloc
,
length
+
extra
,
extra
=
((
info
->
s
->
options
&
HA_OPTION_PACK_RECORD
)
?
ALIGN_SIZE
(
MI_MAX_DYN_BLOCK_HEADER
)
+
MI_SPLIT_LENGTH
+
MI_DYN_DELETE_BLOCK_HEADER
:
0
);
if
(
!
(
newptr
=
(
byte
*
)
my_realloc
((
gptr
)
info
->
rec_alloc
,
length
+
extra
+
8
,
MYF
(
MY_ALLOW_ZERO_PTR
))))
return
newptr
;
return
(
byte
*
)
0
;
info
->
rec_alloc
=
newptr
;
info
->
rec_buff
=
newptr
+
ALIGN_SIZE
(
MI_DYN_DELETE_BLOCK_HEADER
);
info
->
rec_buff
=
newptr
+
(
extra
?
ALIGN_SIZE
(
MI_DYN_DELETE_BLOCK_HEADER
)
:
0
);
info
->
alloced_rec_buff_length
=
length
;
}
return
info
->
rec_buff
;
...
...
myisam/mi_extra.c
View file @
0ae810ae
...
...
@@ -331,7 +331,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
{
my_free
(
info
->
rec_alloc
,
MYF
(
MY_ALLOW_ZERO_PTR
));
info
->
rec_alloc
=
info
->
rec_buff
=
0
;
mi_fix_rec_buff_for_blob
(
info
,
info
->
s
->
base
.
pack_reclength
);
mi_fix_rec_buff_for_blob
(
info
,
0
);
}
break
;
case
HA_EXTRA_NORMAL
:
/* Theese isn't in use */
...
...
myisam/mi_open.c
View file @
0ae810ae
...
...
@@ -506,20 +506,10 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
/* Allocate buffer for one record */
extra
=
0
;
if
(
share
->
options
&
HA_OPTION_PACK_RECORD
)
extra
=
ALIGN_SIZE
(
MI_MAX_DYN_BLOCK_HEADER
)
+
MI_SPLIT_LENGTH
+
MI_DYN_DELETE_BLOCK_HEADER
;
tmp_length
=
max
(
share
->
base
.
pack_reclength
,
share
->
base
.
max_key_length
);
info
.
alloced_rec_buff_length
=
tmp_length
;
if
(
!
(
info
.
rec_alloc
=
(
byte
*
)
my_malloc
(
tmp_length
+
extra
+
8
,
MYF
(
MY_WME
|
MY_ZEROFILL
))))
/* prerequisites: bzero(info) && info->s=share; are met. */
if
(
!
mi_fix_rec_buff_for_blob
(
&
info
,
0
))
goto
err
;
if
(
extra
)
info
.
rec_buff
=
info
.
rec_alloc
+
ALIGN_SIZE
(
MI_MAX_DYN_BLOCK_HEADER
);
else
info
.
rec_buff
=
info
.
rec_alloc
;
bzero
(
info
.
rec_alloc
,
info
.
alloced_rec_buff_length
);
*
m_info
=
info
;
#ifdef THREAD
...
...
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