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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
fcc55899
Commit
fcc55899
authored
Sep 10, 2009
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge MySQL 5.1 -> MariaDB
- Don't follow mainline on use of UNINIT_VAR yet, we haven't merged it in.
parent
8282ed39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
sql/opt_range.cc
sql/opt_range.cc
+16
-6
No files found.
sql/opt_range.cc
View file @
fcc55899
...
...
@@ -2243,7 +2243,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
KEY
*
key_info
;
PARAM
param
;
if
(
check_stack_overrun
(
thd
,
2
*
STACK_MIN_SIZE
+
sizeof
(
PARAM
)
,
buff
))
if
(
check_stack_overrun
(
thd
,
2
*
STACK_MIN_SIZE
,
buff
))
DBUG_RETURN
(
0
);
// Fatal error flag is set
/* set up parameter that is passed to all functions */
...
...
@@ -3760,8 +3760,9 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
DBUG_PRINT
(
"info"
,
(
"index_merge scans cost %g"
,
imerge_cost
));
if
(
imerge_too_expensive
||
(
imerge_cost
>
read_time
)
||
((
non_cpk_scan_records
+
cpk_scan_records
>=
param
->
table
->
file
->
stats
.
records
)
&&
read_time
!=
DBL_MAX
))
((
non_cpk_scan_records
+
cpk_scan_records
>=
param
->
table
->
file
->
stats
.
records
)
&&
read_time
!=
DBL_MAX
))
{
/*
Bail out if it is obvious that both index_merge and ROR-union will be
...
...
@@ -4838,11 +4839,11 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
{
int
idx
;
SEL_ARG
**
key
,
**
end
,
**
key_to_read
=
NULL
;
ha_rows
UNINIT_VAR
(
best_records
);
/* protected by key_to_read */
ha_rows
best_records
;
TRP_RANGE
*
read_plan
=
NULL
;
bool
pk_is_clustered
=
param
->
table
->
file
->
primary_key_is_clustered
();
DBUG_ENTER
(
"get_key_scans_params"
);
LINT_INIT
(
best_records
);
/* protected by key_to_read */
/*
Note that there may be trees that have type SEL_TREE::KEY but contain no
key reads at all, e.g. tree for expression "key1 is not null" where key1
...
...
@@ -6439,6 +6440,13 @@ key_and(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag)
return
0
;
// Can't optimize this
}
if
((
key1
->
min_flag
|
key2
->
min_flag
)
&
GEOM_FLAG
)
{
key1
->
free_tree
();
key2
->
free_tree
();
return
0
;
// Can't optimize this
}
key1
->
use_count
--
;
key2
->
use_count
--
;
SEL_ARG
*
e1
=
key1
->
first
(),
*
e2
=
key2
->
first
(),
*
new_tree
=
0
;
...
...
@@ -6789,7 +6797,9 @@ static bool eq_tree(SEL_ARG* a,SEL_ARG *b)
SEL_ARG
*
SEL_ARG
::
insert
(
SEL_ARG
*
key
)
{
SEL_ARG
*
element
,
**
UNINIT_VAR
(
par
),
*
UNINIT_VAR
(
last_element
);
SEL_ARG
*
element
,
**
par
,
*
last_element
;
LINT_INIT
(
par
);
LINT_INIT
(
last_element
);
for
(
element
=
this
;
element
!=
&
null_element
;
)
{
...
...
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