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
aaa6f132
Commit
aaa6f132
authored
Dec 19, 2019
by
Will DeVries
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for HA_READ_KEY_EXACT.
parent
36780445
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
storage/clustrixdb/ha_clustrixdb.cc
storage/clustrixdb/ha_clustrixdb.cc
+31
-13
No files found.
storage/clustrixdb/ha_clustrixdb.cc
View file @
aaa6f132
...
...
@@ -741,20 +741,18 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
if
(
!
trx
)
DBUG_RETURN
(
error_code
);
is_scan
=
true
;
key_restore
(
buf
,
key
,
&
table
->
key_info
[
active_index
],
key_len
);
// The estimate should consider only key fields widths.
size_t
packed_key_len
;
uchar
*
packed_key
=
(
uchar
*
)
my_alloca
(
estimate_row_size
(
table
));
build_key_packed_row
(
active_index
,
buf
,
packed_key
,
&
packed_key_len
);
//
bool exact = false;
bool
exact
=
false
;
clustrix_connection
::
scan_type
st
;
switch
(
find_flag
)
{
case
HA_READ_KEY_EXACT
:
//exact = true;
/* fall through */
//DBUG_RETURN(ER_NOT_SUPPORTED_YET);
exact
=
true
;
break
;
case
HA_READ_KEY_OR_NEXT
:
st
=
clustrix_connection
::
READ_KEY_OR_NEXT
;
break
;
...
...
@@ -778,20 +776,40 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
DBUG_RETURN
(
ER_NOT_SUPPORTED_YET
);
}
error_code
=
trx
->
scan_from_key
(
clustrix_table_oid
,
active_index
,
st
,
sorted_scan
,
&
scan_fields
,
packed_key
,
packed_key_len
,
THDVAR
(
thd
,
row_buffer
),
&
scan_cur
);
uchar
*
rowdata
=
NULL
;
if
(
exact
)
{
is_scan
=
false
;
ulong
rowdata_length
;
if
((
error_code
=
trx
->
key_read
(
clustrix_table_oid
,
0
,
clustrix_connection
::
CLUSTRIX_SHARED
,
table
->
read_set
,
packed_key
,
packed_key_len
,
&
rowdata
,
&
rowdata_length
)))
goto
err
;
error_code
=
unpack_row_to_buf
(
rgi
,
table
,
buf
,
rowdata
,
table
->
read_set
,
rowdata
+
rowdata_length
);
}
else
{
is_scan
=
true
;
if
((
error_code
=
trx
->
scan_from_key
(
clustrix_table_oid
,
active_index
,
st
,
sorted_scan
,
&
scan_fields
,
packed_key
,
packed_key_len
,
THDVAR
(
thd
,
row_buffer
),
&
scan_cur
)))
goto
err
;
error_code
=
rnd_next
(
buf
);
}
err:
if
(
rowdata
)
my_free
(
rowdata
);
if
(
packed_key
)
my_afree
(
packed_key
);
if
(
error_code
==
HA_ERR_TABLE_DEF_CHANGED
)
clustrixdb_mark_table_for_discovery
(
table
);
if
(
error_code
)
DBUG_RETURN
(
error_code
);
DBUG_RETURN
(
rnd_next
(
buf
));
DBUG_RETURN
(
error_code
);
}
int
ha_clustrixdb
::
index_first
(
uchar
*
buf
)
...
...
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