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
f00236ac
Commit
f00236ac
authored
Jan 01, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: FederatedX
parent
820aa11e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
27 deletions
+16
-27
storage/federatedx/ha_federatedx.cc
storage/federatedx/ha_federatedx.cc
+15
-25
storage/federatedx/ha_federatedx.h
storage/federatedx/ha_federatedx.h
+1
-2
No files found.
storage/federatedx/ha_federatedx.cc
View file @
f00236ac
...
...
@@ -1218,7 +1218,6 @@ bool ha_federatedx::create_where_from_key(String *to,
KEY
*
key_info
,
const
key_range
*
start_key
,
const
key_range
*
end_key
,
bool
from_records_in_range
,
bool
eq_range
)
{
bool
both_not_null
=
...
...
@@ -1239,7 +1238,6 @@ bool ha_federatedx::create_where_from_key(String *to,
MY_BITMAP
*
old_map
=
dbug_tmp_use_all_columns
(
table
,
&
table
->
write_set
);
for
(
uint
i
=
0
;
i
<=
1
;
i
++
)
{
bool
needs_quotes
;
KEY_PART_INFO
*
key_part
;
if
(
ranges
[
i
]
==
NULL
)
continue
;
...
...
@@ -1262,7 +1260,11 @@ bool ha_federatedx::create_where_from_key(String *to,
Field
*
field
=
key_part
->
field
;
uint
store_length
=
key_part
->
store_length
;
uint
part_length
=
MY_MIN
(
store_length
,
length
);
needs_quotes
=
field
->
str_needs_quotes
();
bool
needs_quotes
=
field
->
str_needs_quotes
();
static
const
LEX_CSTRING
lt
=
{
STRING_WITH_LEN
(
" < "
)
};
static
const
LEX_CSTRING
gt
=
{
STRING_WITH_LEN
(
" > "
)
};
static
const
LEX_CSTRING
le
=
{
STRING_WITH_LEN
(
" <= "
)
};
static
const
LEX_CSTRING
ge
=
{
STRING_WITH_LEN
(
" >= "
)
};
DBUG_DUMP
(
"key, start of loop"
,
ptr
,
length
);
if
(
key_part
->
null_bit
)
...
...
@@ -1304,16 +1306,8 @@ bool ha_federatedx::create_where_from_key(String *to,
if
(
emit_key_part_name
(
&
tmp
,
key_part
))
goto
err
;
if
(
from_records_in_range
)
{
if
(
tmp
.
append
(
STRING_WITH_LEN
(
" >= "
)))
goto
err
;
}
else
{
if
(
tmp
.
append
(
STRING_WITH_LEN
(
" = "
)))
goto
err
;
}
if
(
emit_key_part_element
(
&
tmp
,
key_part
,
needs_quotes
,
0
,
ptr
,
part_length
))
...
...
@@ -1344,12 +1338,12 @@ bool ha_federatedx::create_where_from_key(String *to,
if
(
i
>
0
)
/* end key */
{
if
(
tmp
.
append
(
STRING_WITH_LEN
(
" <= "
)
))
if
(
tmp
.
append
(
le
))
goto
err
;
}
else
/* start key */
{
if
(
tmp
.
append
(
STRING_WITH_LEN
(
" > "
)
))
if
(
tmp
.
append
(
gt
))
goto
err
;
}
...
...
@@ -1364,7 +1358,7 @@ bool ha_federatedx::create_where_from_key(String *to,
case
HA_READ_KEY_OR_NEXT
:
DBUG_PRINT
(
"info"
,
(
"federatedx HA_READ_KEY_OR_NEXT %d"
,
i
));
if
(
emit_key_part_name
(
&
tmp
,
key_part
)
||
tmp
.
append
(
STRING_WITH_LEN
(
" >= "
)
)
||
tmp
.
append
(
ge
)
||
emit_key_part_element
(
&
tmp
,
key_part
,
needs_quotes
,
0
,
ptr
,
part_length
))
goto
err
;
...
...
@@ -1374,7 +1368,7 @@ bool ha_federatedx::create_where_from_key(String *to,
if
(
store_length
>=
length
)
{
if
(
emit_key_part_name
(
&
tmp
,
key_part
)
||
tmp
.
append
(
STRING_WITH_LEN
(
" < "
)
)
||
tmp
.
append
(
lt
)
||
emit_key_part_element
(
&
tmp
,
key_part
,
needs_quotes
,
0
,
ptr
,
part_length
))
goto
err
;
...
...
@@ -1384,7 +1378,7 @@ bool ha_federatedx::create_where_from_key(String *to,
case
HA_READ_KEY_OR_PREV
:
DBUG_PRINT
(
"info"
,
(
"federatedx HA_READ_KEY_OR_PREV %d"
,
i
));
if
(
emit_key_part_name
(
&
tmp
,
key_part
)
||
tmp
.
append
(
STRING_WITH_LEN
(
" <= "
)
)
||
tmp
.
append
(
le
)
||
emit_key_part_element
(
&
tmp
,
key_part
,
needs_quotes
,
0
,
ptr
,
part_length
))
goto
err
;
...
...
@@ -2639,10 +2633,7 @@ int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index,
range
.
key
=
key
;
range
.
length
=
key_len
;
range
.
flag
=
find_flag
;
create_where_from_key
(
&
index_string
,
&
table
->
key_info
[
index
],
&
range
,
NULL
,
0
,
0
);
create_where_from_key
(
&
index_string
,
&
table
->
key_info
[
index
],
&
range
,
0
,
0
);
sql_query
.
append
(
index_string
);
if
((
retval
=
txn
->
acquire
(
share
,
ha_thd
(),
TRUE
,
&
io
)))
...
...
@@ -2721,9 +2712,8 @@ int ha_federatedx::read_range_first(const key_range *start_key,
sql_query
.
length
(
0
);
sql_query
.
append
(
share
->
select_query
);
create_where_from_key
(
&
sql_query
,
&
table
->
key_info
[
active_index
],
start_key
,
end_key
,
0
,
eq_range_arg
);
create_where_from_key
(
&
sql_query
,
&
table
->
key_info
[
active_index
],
start_key
,
end_key
,
eq_range_arg
);
if
((
retval
=
txn
->
acquire
(
share
,
ha_thd
(),
TRUE
,
&
io
)))
DBUG_RETURN
(
retval
);
...
...
storage/federatedx/ha_federatedx.h
View file @
f00236ac
...
...
@@ -291,8 +291,7 @@ class ha_federatedx final : public handler
FEDERATEDX_IO_RESULT
*
result
);
bool
create_where_from_key
(
String
*
to
,
KEY
*
key_info
,
const
key_range
*
start_key
,
const
key_range
*
end_key
,
bool
records_in_range
,
bool
eq_range
);
const
key_range
*
end_key
,
bool
eq_range
);
int
stash_remote_error
();
static
federatedx_txn
*
get_txn
(
THD
*
thd
,
bool
no_create
=
FALSE
);
...
...
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