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
225cf486
Commit
225cf486
authored
Nov 21, 2019
by
Roman Nozdrin
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return early from init_SH for EXPLAIN to avoid needless scan.
Fix for a potential null deref in DH for EXPLAIN.
parent
b9673a64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
storage/clustrixdb/ha_clustrixdb_pushdown.cc
storage/clustrixdb/ha_clustrixdb_pushdown.cc
+13
-4
No files found.
storage/clustrixdb/ha_clustrixdb_pushdown.cc
View file @
225cf486
...
...
@@ -107,6 +107,15 @@ create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
return
sh
;
}
// TODO Return early for EXPLAIN before we run the actual scan.
// We can send compile request when we separate compilation
// and execution.
clustrix_connection_cursor
*
scan
=
NULL
;
if
(
thd
->
lex
->
describe
)
{
sh
=
new
ha_clustrixdb_select_handler
(
thd
,
select_lex
,
scan
);
return
sh
;
}
// Multi-update runs an implicit query to collect constraints.
// SH couldn't be used for this.
if
(
thd
->
lex
->
sql_command
==
SQLCOM_UPDATE_MULTI
)
{
...
...
@@ -118,7 +127,6 @@ create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
select_lex
->
print
(
thd
,
&
query
,
QT_ORDINARY
);
int
error_code
=
0
;
int
field_metadata_size
=
0
;
clustrix_connection_cursor
*
scan
=
NULL
;
clustrix_connection
*
trx
=
NULL
;
// We presume this number is equal to types.elements in get_field_types
...
...
@@ -365,8 +373,6 @@ ha_clustrixdb_derived_handler::~ha_clustrixdb_derived_handler()
* ********************************************************/
int
ha_clustrixdb_derived_handler
::
init_scan
()
{
// Save this into the base handler class attribute
table__
=
table
;
String
query
;
// Print the query into a string provided
select
->
print
(
thd__
,
&
query
,
QT_ORDINARY
);
...
...
@@ -390,7 +396,7 @@ int ha_clustrixdb_derived_handler::init_scan()
}
if
((
field_metadata_size
=
get_field_types
(
thd__
,
table
__
,
select
,
fieldtype
,
field_metadata
,
null_bits
,
num_null_bytes
,
items_number
))
<
0
)
{
get_field_types
(
thd__
,
table
,
select
,
fieldtype
,
field_metadata
,
null_bits
,
num_null_bytes
,
items_number
))
<
0
)
{
goto
err
;
}
...
...
@@ -405,6 +411,9 @@ int ha_clustrixdb_derived_handler::init_scan()
goto
err
;
}
// Save this into the base handler class attribute
table__
=
table
;
// need this bitmap future in next_row()
if
(
my_bitmap_init
(
&
scan_fields
,
NULL
,
table
->
read_set
->
n_bits
,
false
))
return
ER_OUTOFMEMORY
;
...
...
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