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
194593b8
Commit
194593b8
authored
Apr 27, 2005
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bugs found in previous optimizations.
Make rec_get_deleted_flag() return zero/nonzero instead of FALSE/TRUE.
parent
b3d6f517
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
36 deletions
+37
-36
innobase/btr/btr0btr.c
innobase/btr/btr0btr.c
+6
-3
innobase/btr/btr0cur.c
innobase/btr/btr0cur.c
+13
-9
innobase/include/page0page.ic
innobase/include/page0page.ic
+1
-1
innobase/include/rem0rec.h
innobase/include/rem0rec.h
+3
-3
innobase/include/rem0rec.ic
innobase/include/rem0rec.ic
+9
-10
innobase/rem/rem0rec.c
innobase/rem/rem0rec.c
+2
-7
innobase/row/row0sel.c
innobase/row/row0sel.c
+1
-1
innobase/row/row0vers.c
innobase/row/row0vers.c
+2
-2
No files found.
innobase/btr/btr0btr.c
View file @
194593b8
...
@@ -1273,17 +1273,20 @@ btr_page_get_sure_split_rec(
...
@@ -1273,17 +1273,20 @@ btr_page_get_sure_split_rec(
supremum record of page */
supremum record of page */
if
(
rec
==
ins_rec
)
{
if
(
rec
==
ins_rec
)
{
next_rec
=
NULL
;
rec
=
NULL
;
goto
func_exit
;
}
else
if
(
rec
==
NULL
)
{
}
else
if
(
rec
==
NULL
)
{
next_rec
=
page_rec_get_next
(
ins_rec
);
next_rec
=
page_rec_get_next
(
ins_rec
);
}
else
{
}
else
{
next_rec
=
page_rec_get_next
(
rec
);
next_rec
=
page_rec_get_next
(
rec
);
}
}
if
(
!
page_rec_is_supremum
(
next_rec
)))
{
ut_ad
(
next_rec
);
if
(
!
page_rec_is_supremum
(
next_rec
))
{
rec
=
next_rec
;
rec
=
next_rec
;
}
}
}
}
func_exit:
if
(
UNIV_LIKELY_NULL
(
heap
))
{
if
(
UNIV_LIKELY_NULL
(
heap
))
{
mem_heap_free
(
heap
);
mem_heap_free
(
heap
);
}
}
...
@@ -1323,7 +1326,7 @@ btr_page_insert_fits(
...
@@ -1323,7 +1326,7 @@ btr_page_insert_fits(
ut_ad
(
!
split_rec
==
!
offsets
);
ut_ad
(
!
split_rec
==
!
offsets
);
ut_ad
(
!
offsets
ut_ad
(
!
offsets
||
page_is_comp
(
page
)
==
!
!
rec_offs_comp
(
offsets
));
||
!
page_is_comp
(
page
)
==
!
rec_offs_comp
(
offsets
));
ut_ad
(
!
offsets
ut_ad
(
!
offsets
||
rec_offs_validate
(
split_rec
,
cursor
->
index
,
offsets
));
||
rec_offs_validate
(
split_rec
,
cursor
->
index
,
offsets
));
...
...
innobase/btr/btr0cur.c
View file @
194593b8
...
@@ -1426,7 +1426,7 @@ btr_cur_update_in_place(
...
@@ -1426,7 +1426,7 @@ btr_cur_update_in_place(
rec_t
*
rec
;
rec_t
*
rec
;
dulint
roll_ptr
=
ut_dulint_zero
;
dulint
roll_ptr
=
ut_dulint_zero
;
trx_t
*
trx
;
trx_t
*
trx
;
ibool
was_delete_marked
;
ulint
was_delete_marked
;
mem_heap_t
*
heap
=
NULL
;
mem_heap_t
*
heap
=
NULL
;
ulint
offsets_
[
REC_OFFS_NORMAL_SIZE
];
ulint
offsets_
[
REC_OFFS_NORMAL_SIZE
];
ulint
*
offsets
=
offsets_
;
ulint
*
offsets
=
offsets_
;
...
@@ -1434,6 +1434,7 @@ btr_cur_update_in_place(
...
@@ -1434,6 +1434,7 @@ btr_cur_update_in_place(
rec
=
btr_cur_get_rec
(
cursor
);
rec
=
btr_cur_get_rec
(
cursor
);
index
=
cursor
->
index
;
index
=
cursor
->
index
;
ut_ad
(
!!
page_rec_is_comp
(
rec
)
==
index
->
table
->
comp
);
trx
=
thr_get_trx
(
thr
);
trx
=
thr_get_trx
(
thr
);
offsets
=
rec_get_offsets
(
rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
offsets
=
rec_get_offsets
(
rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
...
@@ -1547,6 +1548,7 @@ btr_cur_optimistic_update(
...
@@ -1547,6 +1548,7 @@ btr_cur_optimistic_update(
page
=
btr_cur_get_page
(
cursor
);
page
=
btr_cur_get_page
(
cursor
);
rec
=
btr_cur_get_rec
(
cursor
);
rec
=
btr_cur_get_rec
(
cursor
);
index
=
cursor
->
index
;
index
=
cursor
->
index
;
ut_ad
(
!!
page_rec_is_comp
(
rec
)
==
index
->
table
->
comp
);
heap
=
mem_heap_create
(
1024
);
heap
=
mem_heap_create
(
1024
);
offsets
=
rec_get_offsets
(
rec
,
index
,
NULL
,
ULINT_UNDEFINED
,
&
heap
);
offsets
=
rec_get_offsets
(
rec
,
index
,
NULL
,
ULINT_UNDEFINED
,
&
heap
);
...
@@ -1596,8 +1598,8 @@ btr_cur_optimistic_update(
...
@@ -1596,8 +1598,8 @@ btr_cur_optimistic_update(
old_rec_size
=
rec_offs_size
(
offsets
);
old_rec_size
=
rec_offs_size
(
offsets
);
new_rec_size
=
rec_get_converted_size
(
index
,
new_entry
);
new_rec_size
=
rec_get_converted_size
(
index
,
new_entry
);
if
(
new_rec_size
>=
if
(
UNIV_UNLIKELY
(
new_rec_size
>=
page_get_free_space_of_empty
(
page_get_free_space_of_empty
(
page_is_comp
(
page
))
/
2
)
{
page_is_comp
(
page
))
/
2
)
)
{
mem_heap_free
(
heap
);
mem_heap_free
(
heap
);
...
@@ -1607,8 +1609,9 @@ btr_cur_optimistic_update(
...
@@ -1607,8 +1609,9 @@ btr_cur_optimistic_update(
max_size
=
old_rec_size
max_size
=
old_rec_size
+
page_get_max_insert_size_after_reorganize
(
page
,
1
);
+
page_get_max_insert_size_after_reorganize
(
page
,
1
);
if
(
page_get_data_size
(
page
)
-
old_rec_size
+
new_rec_size
if
(
UNIV_UNLIKELY
(
page_get_data_size
(
page
)
<
BTR_CUR_PAGE_COMPRESS_LIMIT
)
{
-
old_rec_size
+
new_rec_size
<
BTR_CUR_PAGE_COMPRESS_LIMIT
))
{
/* The page would become too empty */
/* The page would become too empty */
...
@@ -2034,14 +2037,14 @@ btr_cur_parse_del_mark_set_clust_rec(
...
@@ -2034,14 +2037,14 @@ btr_cur_parse_del_mark_set_clust_rec(
page_t
*
page
)
/* in: page or NULL */
page_t
*
page
)
/* in: page or NULL */
{
{
ulint
flags
;
ulint
flags
;
ibool
val
;
ulint
val
;
ulint
pos
;
ulint
pos
;
dulint
trx_id
;
dulint
trx_id
;
dulint
roll_ptr
;
dulint
roll_ptr
;
ulint
offset
;
ulint
offset
;
rec_t
*
rec
;
rec_t
*
rec
;
ut_ad
(
!!
page_is_comp
(
page
)
==
index
->
table
->
comp
);
ut_ad
(
!
page
||
!
!
page_is_comp
(
page
)
==
index
->
table
->
comp
);
if
(
end_ptr
<
ptr
+
2
)
{
if
(
end_ptr
<
ptr
+
2
)
{
...
@@ -2127,6 +2130,7 @@ btr_cur_del_mark_set_clust_rec(
...
@@ -2127,6 +2130,7 @@ btr_cur_del_mark_set_clust_rec(
rec
=
btr_cur_get_rec
(
cursor
);
rec
=
btr_cur_get_rec
(
cursor
);
index
=
cursor
->
index
;
index
=
cursor
->
index
;
ut_ad
(
!!
page_rec_is_comp
(
rec
)
==
index
->
table
->
comp
);
offsets
=
rec_get_offsets
(
rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
offsets
=
rec_get_offsets
(
rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
if
(
btr_cur_print_record_ops
&&
thr
)
{
if
(
btr_cur_print_record_ops
&&
thr
)
{
...
@@ -2135,7 +2139,7 @@ btr_cur_del_mark_set_clust_rec(
...
@@ -2135,7 +2139,7 @@ btr_cur_del_mark_set_clust_rec(
}
}
ut_ad
(
index
->
type
&
DICT_CLUSTERED
);
ut_ad
(
index
->
type
&
DICT_CLUSTERED
);
ut_ad
(
rec_get_deleted_flag
(
rec
,
index
->
table
->
comp
)
==
FALSE
);
ut_ad
(
!
rec_get_deleted_flag
(
rec
,
rec_offs_comp
(
offsets
))
);
err
=
lock_clust_rec_modify_check_and_lock
(
flags
,
err
=
lock_clust_rec_modify_check_and_lock
(
flags
,
rec
,
index
,
offsets
,
thr
);
rec
,
index
,
offsets
,
thr
);
...
@@ -2230,7 +2234,7 @@ btr_cur_parse_del_mark_set_sec_rec(
...
@@ -2230,7 +2234,7 @@ btr_cur_parse_del_mark_set_sec_rec(
byte
*
end_ptr
,
/* in: buffer end */
byte
*
end_ptr
,
/* in: buffer end */
page_t
*
page
)
/* in: page or NULL */
page_t
*
page
)
/* in: page or NULL */
{
{
ibool
val
;
ulint
val
;
ulint
offset
;
ulint
offset
;
rec_t
*
rec
;
rec_t
*
rec
;
...
...
innobase/include/page0page.ic
View file @
194593b8
...
@@ -593,10 +593,10 @@ page_rec_set_next(
...
@@ -593,10 +593,10 @@ page_rec_set_next(
ut_ad(page_rec_check(rec));
ut_ad(page_rec_check(rec));
ut_ad(!page_rec_is_supremum(rec));
ut_ad(!page_rec_is_supremum(rec));
ut_ad(!page_rec_is_infimum(next));
page = ut_align_down(rec, UNIV_PAGE_SIZE);
page = ut_align_down(rec, UNIV_PAGE_SIZE);
if (next) {
if (next) {
ut_ad(!page_rec_is_infimum(next));
ut_a(page == ut_align_down(next, UNIV_PAGE_SIZE));
ut_a(page == ut_align_down(next, UNIV_PAGE_SIZE));
offs = (ulint) (next - page);
offs = (ulint) (next - page);
} else {
} else {
...
...
innobase/include/rem0rec.h
View file @
194593b8
...
@@ -162,10 +162,10 @@ rec_set_info_and_status_bits(
...
@@ -162,10 +162,10 @@ rec_set_info_and_status_bits(
/**********************************************************
/**********************************************************
The following function tells if record is delete marked. */
The following function tells if record is delete marked. */
UNIV_INLINE
UNIV_INLINE
ibool
ulint
rec_get_deleted_flag
(
rec_get_deleted_flag
(
/*=================*/
/*=================*/
/* out:
TRUE
if delete marked */
/* out:
nonzero
if delete marked */
rec_t
*
rec
,
/* in: physical record */
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
/**********************************************************
...
@@ -176,7 +176,7 @@ rec_set_deleted_flag(
...
@@ -176,7 +176,7 @@ rec_set_deleted_flag(
/*=================*/
/*=================*/
rec_t
*
rec
,
/* in: physical record */
rec_t
*
rec
,
/* in: physical record */
ulint
comp
,
/* in: nonzero=compact page format */
ulint
comp
,
/* in: nonzero=compact page format */
ibool
flag
);
/* in: TRUE
if delete marked */
ulint
flag
);
/* in: nonzero
if delete marked */
/**********************************************************
/**********************************************************
The following function tells if a new-style record is a node pointer. */
The following function tells if a new-style record is a node pointer. */
UNIV_INLINE
UNIV_INLINE
...
...
innobase/include/rem0rec.ic
View file @
194593b8
...
@@ -578,19 +578,21 @@ rec_set_info_and_status_bits(
...
@@ -578,19 +578,21 @@ rec_set_info_and_status_bits(
/**********************************************************
/**********************************************************
The following function tells if record is delete marked. */
The following function tells if record is delete marked. */
UNIV_INLINE
UNIV_INLINE
ibool
ulint
rec_get_deleted_flag(
rec_get_deleted_flag(
/*=================*/
/*=================*/
/* out:
TRUE
if delete marked */
/* out:
nonzero
if delete marked */
rec_t* rec, /* in: physical record */
rec_t* rec, /* in: physical record */
ulint comp) /* in: nonzero=compact page format */
ulint comp) /* in: nonzero=compact page format */
{
{
if (UNIV_EXPECT(comp, REC_OFFS_COMPACT)) {
if (UNIV_EXPECT(comp, REC_OFFS_COMPACT)) {
return(0 != rec_get_bit_field_1(rec, REC_NEW_INFO_BITS,
return(UNIV_UNLIKELY(rec_get_bit_field_1(rec,
REC_INFO_DELETED_FLAG, REC_INFO_BITS_SHIFT));
REC_NEW_INFO_BITS, REC_INFO_DELETED_FLAG,
REC_INFO_BITS_SHIFT)));
} else {
} else {
return(0 != rec_get_bit_field_1(rec, REC_OLD_INFO_BITS,
return(UNIV_UNLIKELY(rec_get_bit_field_1(rec,
REC_INFO_DELETED_FLAG, REC_INFO_BITS_SHIFT));
REC_OLD_INFO_BITS, REC_INFO_DELETED_FLAG,
REC_INFO_BITS_SHIFT)));
}
}
}
}
...
@@ -602,13 +604,10 @@ rec_set_deleted_flag(
...
@@ -602,13 +604,10 @@ rec_set_deleted_flag(
/*=================*/
/*=================*/
rec_t* rec, /* in: physical record */
rec_t* rec, /* in: physical record */
ulint comp, /* in: nonzero=compact page format */
ulint comp, /* in: nonzero=compact page format */
ibool flag) /* in: TRUE
if delete marked */
ulint flag) /* in: nonzero
if delete marked */
{
{
ulint val;
ulint val;
ut_ad(TRUE == 1);
ut_ad(flag <= TRUE);
val = rec_get_info_bits(rec, comp);
val = rec_get_info_bits(rec, comp);
if (flag) {
if (flag) {
...
...
innobase/rem/rem0rec.c
View file @
194593b8
...
@@ -218,20 +218,15 @@ rec_init_offsets(
...
@@ -218,20 +218,15 @@ rec_init_offsets(
We do not advance offs, and we set
We do not advance offs, and we set
the length to zero and enable the
the length to zero and enable the
SQL NULL flag in offsets[]. */
SQL NULL flag in offsets[]. */
len
=
REC_OFFS_SQL_NULL
;
len
=
offs
|
REC_OFFS_SQL_NULL
;
goto
resolved
;
goto
resolved
;
}
}
null_mask
<<=
1
;
null_mask
<<=
1
;
ut_ad
(
!
field
->
fixed_len
);
goto
variable_length
;
}
}
if
(
UNIV_UNLIKELY
(
!
field
->
fixed_len
))
{
if
(
UNIV_UNLIKELY
(
!
field
->
fixed_len
))
{
dtype_t
*
type
;
variable_length:
/* Variable-length field: read the length */
/* Variable-length field: read the length */
type
=
dict_col_get_type
(
dtype_t
*
type
=
dict_col_get_type
(
dict_field_get_col
(
field
));
dict_field_get_col
(
field
));
len
=
*
lens
--
;
len
=
*
lens
--
;
if
(
UNIV_UNLIKELY
(
dtype_get_len
(
type
)
>
255
)
if
(
UNIV_UNLIKELY
(
dtype_get_len
(
type
)
>
255
)
...
...
innobase/row/row0sel.c
View file @
194593b8
...
@@ -3459,7 +3459,7 @@ row_search_for_mysql(
...
@@ -3459,7 +3459,7 @@ row_search_for_mysql(
/* PHASE 4: Look for matching records in a loop */
/* PHASE 4: Look for matching records in a loop */
rec
=
btr_pcur_get_rec
(
pcur
);
rec
=
btr_pcur_get_rec
(
pcur
);
ut_ad
(
!
page_rec_is_comp
(
rec
)
==
!
index
->
table
->
comp
);
ut_ad
(
!
!
page_rec_is_comp
(
rec
)
==
index
->
table
->
comp
);
#ifdef UNIV_SEARCH_DEBUG
#ifdef UNIV_SEARCH_DEBUG
/*
/*
fputs("Using ", stderr);
fputs("Using ", stderr);
...
...
innobase/row/row0vers.c
View file @
194593b8
...
@@ -57,8 +57,8 @@ row_vers_impl_x_locked_off_kernel(
...
@@ -57,8 +57,8 @@ row_vers_impl_x_locked_off_kernel(
dtuple_t
*
entry
=
NULL
;
/* assignment to eliminate compiler
dtuple_t
*
entry
=
NULL
;
/* assignment to eliminate compiler
warning */
warning */
trx_t
*
trx
;
trx_t
*
trx
;
ibool
vers_del
;
ulint
vers_del
;
ibool
rec_del
;
ulint
rec_del
;
ulint
err
;
ulint
err
;
mtr_t
mtr
;
mtr_t
mtr
;
ulint
comp
;
ulint
comp
;
...
...
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