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
1dc0873b
Commit
1dc0873b
authored
Jan 11, 2011
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 5.2 (To get in fixes for Aria)
parents
5788294f
0e11b060
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
8 deletions
+28
-8
storage/maria/ma_check.c
storage/maria/ma_check.c
+2
-0
storage/maria/ma_ft_boolean_search.c
storage/maria/ma_ft_boolean_search.c
+2
-0
storage/maria/ma_rsame.c
storage/maria/ma_rsame.c
+4
-3
storage/maria/ma_rt_index.c
storage/maria/ma_rt_index.c
+0
-1
storage/maria/ma_search.c
storage/maria/ma_search.c
+7
-1
storage/maria/ma_unique.c
storage/maria/ma_unique.c
+13
-3
No files found.
storage/maria/ma_check.c
View file @
1dc0873b
...
...
@@ -881,6 +881,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
}
info
->
last_key
.
keyinfo
=
tmp_key
.
keyinfo
=
keyinfo
;
info
->
lastinx
=
~
0
;
/* Safety */
tmp_key
.
data
=
tmp_key_buff
;
for
(
;;
)
{
...
...
@@ -1134,6 +1135,7 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
{
(
*
keyinfo
->
make_key
)(
info
,
&
key
,
keynr
,
info
->
lastkey_buff
,
record
,
start_recpos
,
0
);
info
->
last_key
.
keyinfo
=
key
.
keyinfo
;
if
(
extend
)
{
/* We don't need to lock the key tree here as we don't allow
...
...
storage/maria/ma_ft_boolean_search.c
View file @
1dc0873b
...
...
@@ -357,6 +357,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
ftbw
->
key_root
=
info
->
s
->
state
.
key_root
[
ftb
->
keynr
];
ftbw
->
keyinfo
=
info
->
s
->
keyinfo
+
ftb
->
keynr
;
info
->
last_key
.
keyinfo
=
key
.
keyinfo
=
ftbw
->
keyinfo
;
info
->
lastinx
=
~
0
;
/* Safety */
key
.
data
=
ftbw
->
word
;
key
.
data_length
=
ftbw
->
len
;
key
.
ref_length
=
0
;
...
...
@@ -381,6 +382,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
}
info
->
last_key
.
keyinfo
=
key
.
keyinfo
=
ftbw
->
keyinfo
;
info
->
lastinx
=
~
0
;
/* Safety */
key
.
data
=
lastkey_buf
;
key
.
data_length
=
USE_WHOLE_KEY
;
key
.
ref_length
=
0
;
...
...
storage/maria/ma_rsame.c
View file @
1dc0873b
...
...
@@ -19,7 +19,7 @@
Find current row with read on position or read on key
@notes
If inx >= 0 find record using key
If inx >= 0 find record using key
else re-read row on last position
@warning
This function is not row version safe.
...
...
@@ -29,6 +29,7 @@
@retval 0 Ok
@retval HA_ERR_KEY_NOT_FOUND Row is deleted
@retval HA_ERR_END_OF_FILE End of file
@retval HA_ERR_WRONG_INDEX Wrong inx argument
*/
...
...
@@ -36,10 +37,10 @@ int maria_rsame(MARIA_HA *info, uchar *record, int inx)
{
DBUG_ENTER
(
"maria_rsame"
);
if
(
inx
>=
0
&&
!
_ma_check_index
(
info
,
inx
)
)
if
(
inx
>=
0
&&
_ma_check_index
(
info
,
inx
)
<
0
)
{
DBUG_PRINT
(
"error"
,
(
"wrong index usage"
));
DBUG_RETURN
(
my_errno
=
HA_ERR_WRONG_INDEX
);
DBUG_RETURN
(
my_errno
);
}
if
(
info
->
cur_row
.
lastpos
==
HA_OFFSET_ERROR
||
info
->
update
&
HA_STATE_DELETED
)
...
...
storage/maria/ma_rt_index.c
View file @
1dc0873b
...
...
@@ -134,7 +134,6 @@ static int maria_rtree_find_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
tmp_key
.
data_length
=
key_data_length
;
info
->
cur_row
.
lastpos
=
_ma_row_pos_from_key
(
&
tmp_key
);
info
->
last_key
.
keyinfo
=
keyinfo
;
info
->
last_key
.
data_length
=
key_data_length
;
info
->
last_key
.
ref_length
=
share
->
base
.
rec_reflength
;
info
->
last_key
.
flag
=
0
;
...
...
storage/maria/ma_search.c
View file @
1dc0873b
...
...
@@ -44,8 +44,12 @@ int _ma_check_index(MARIA_HA *info, int inx)
info
->
update
=
((
info
->
update
&
(
HA_STATE_CHANGED
|
HA_STATE_ROW_CHANGED
))
|
HA_STATE_NEXT_FOUND
|
HA_STATE_PREV_FOUND
);
}
if
(
info
->
opt_flag
&
WRITE_CACHE_USED
&&
flush_io_cache
(
&
info
->
rec_cache
))
if
((
info
->
opt_flag
&
WRITE_CACHE_USED
)
&&
flush_io_cache
(
&
info
->
rec_cache
))
{
if
(
unlikely
(
!
my_errno
))
my_errno
=
HA_ERR_INTERNAL_ERROR
;
/* Impossible */
return
(
-
1
);
}
return
(
inx
);
}
/* _ma_check_index */
...
...
@@ -97,6 +101,7 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
@note
Position to row is stored in info->lastpos
Last used key is stored in info->last_key
@return
@retval 0 ok (key found)
...
...
@@ -122,6 +127,7 @@ static int _ma_search_no_save(register MARIA_HA *info, MARIA_KEY *key,
(
ulong
)
(
pos
/
info
->
s
->
block_size
),
nextflag
,
(
ulong
)
info
->
cur_row
.
lastpos
));
DBUG_EXECUTE
(
"key"
,
_ma_print_key
(
DBUG_FILE
,
key
););
DBUG_ASSERT
(
info
->
last_key
.
keyinfo
==
key
->
keyinfo
);
if
(
pos
==
HA_OFFSET_ERROR
)
{
...
...
storage/maria/ma_unique.c
View file @
1dc0873b
...
...
@@ -34,6 +34,7 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
MARIA_KEYDEF
*
keyinfo
=
&
info
->
s
->
keyinfo
[
def
->
key
];
uchar
*
key_buff
=
info
->
lastkey_buff2
;
MARIA_KEY
key
;
int
error
=
0
;
DBUG_ENTER
(
"_ma_check_unique"
);
DBUG_PRINT
(
"enter"
,(
"unique_hash: %lu"
,
(
ulong
)
unique_hash
));
...
...
@@ -43,14 +44,19 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
/* The above changed info->lastkey_buff2. Inform maria_rnext_same(). */
info
->
update
&=
~
HA_STATE_RNEXT_SAME
;
/* Setup that unique key is active key */
info
->
last_key
.
keyinfo
=
keyinfo
;
/* any key pointer in data is destroyed */
info
->
lastinx
=
~
0
;
DBUG_ASSERT
(
key
.
data_length
==
MARIA_UNIQUE_HASH_LENGTH
);
if
(
_ma_search
(
info
,
&
key
,
SEARCH_FIND
,
info
->
s
->
state
.
key_root
[
def
->
key
]))
{
info
->
page_changed
=
1
;
/* Can't optimize read next */
info
->
cur_row
.
lastpos
=
lastpos
;
DBUG_RETURN
(
0
);
/* No matching rows */
goto
end
;
}
for
(;;)
...
...
@@ -64,7 +70,8 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
info
->
page_changed
=
1
;
/* Can't optimize read next */
info
->
cur_row
.
lastpos
=
lastpos
;
DBUG_PRINT
(
"info"
,(
"Found duplicate"
));
DBUG_RETURN
(
1
);
/* Found identical */
error
=
1
;
/* Found identical */
goto
end
;
}
DBUG_ASSERT
(
info
->
last_key
.
data_length
==
MARIA_UNIQUE_HASH_LENGTH
);
if
(
_ma_search_next
(
info
,
&
info
->
last_key
,
SEARCH_BIGGER
,
...
...
@@ -73,9 +80,12 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
{
info
->
page_changed
=
1
;
/* Can't optimize read next */
info
->
cur_row
.
lastpos
=
lastpos
;
DBUG_RETURN
(
0
);
/* end of tree */
break
;
/* end of tree */
}
}
end:
DBUG_RETURN
(
error
);
}
...
...
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