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
9939b3b7
Commit
9939b3b7
authored
Mar 29, 2007
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#26624: high mem usage (crash) in range optimizer
- Post-review fixes
parent
264697e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
sql/opt_range.cc
sql/opt_range.cc
+15
-14
No files found.
sql/opt_range.cc
View file @
9939b3b7
...
@@ -175,7 +175,7 @@ static char is_null_string[2]= {1,0};
...
@@ -175,7 +175,7 @@ static char is_null_string[2]= {1,0};
Example:
Example:
By induction: Let's take any interval on some keypart in the middle:
By induction: Let's take any interval on some keypart in the middle:
kp15=
1
kp15=
c0
Then let's AND it with this interval 'structure' from preceding and
Then let's AND it with this interval 'structure' from preceding and
following keyparts:
following keyparts:
...
@@ -184,18 +184,18 @@ static char is_null_string[2]= {1,0};
...
@@ -184,18 +184,18 @@ static char is_null_string[2]= {1,0};
We will obtain this SEL_ARG graph:
We will obtain this SEL_ARG graph:
kp14 $ kp15 $ kp16
kp14 $ kp15
$ kp16
$ $
$
$
+---------+ $ +--------+ $ +---------+
+---------+ $ +--------
-
+ $ +---------+
| kp14=c1 |--$-->| kp15=
1
|--$-->| kp16=c3 |
| kp14=c1 |--$-->| kp15=
c0
|--$-->| kp16=c3 |
+---------+ $ +--------+ $ +---------+
+---------+ $ +--------
-
+ $ +---------+
| $ $
| $
$
+---------+ $ +--------+ $
+---------+ $ +--------
-
+ $
| kp14=c2 |--$-->| kp15=
1
| $
| kp14=c2 |--$-->| kp15=
c0
| $
+---------+ $ +--------+ $
+---------+ $ +--------
-
+ $
$ $
$
$
Note that we had to duplicate "kp15=
1
" and there was no way to avoid
Note that we had to duplicate "kp15=
c0
" and there was no way to avoid
that.
that.
The induction step: AND the obtained expression with another "wrapping"
The induction step: AND the obtained expression with another "wrapping"
expression like (*).
expression like (*).
...
@@ -477,7 +477,7 @@ typedef struct st_qsel_param {
...
@@ -477,7 +477,7 @@ typedef struct st_qsel_param {
max_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
];
max_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
];
bool
quick
;
// Don't calulate possible keys
bool
quick
;
// Don't calulate possible keys
COND
*
cond
;
COND
*
cond
;
/* Numbr of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */
/* Numb
e
r of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */
uint
alloced_sel_args
;
uint
alloced_sel_args
;
}
PARAM
;
}
PARAM
;
...
@@ -681,7 +681,8 @@ SEL_ARG *SEL_ARG::clone(PARAM *param, SEL_ARG *new_parent, SEL_ARG **next_arg)
...
@@ -681,7 +681,8 @@ SEL_ARG *SEL_ARG::clone(PARAM *param, SEL_ARG *new_parent, SEL_ARG **next_arg)
tmp
->
parent
=
new_parent
;
tmp
->
parent
=
new_parent
;
tmp
->
next_key_part
=
next_key_part
;
tmp
->
next_key_part
=
next_key_part
;
if
(
left
!=
&
null_element
)
if
(
left
!=
&
null_element
)
tmp
->
left
=
left
->
clone
(
param
,
tmp
,
next_arg
);
if
(
!
(
tmp
->
left
=
left
->
clone
(
param
,
tmp
,
next_arg
)))
return
0
;
// OOM
tmp
->
prev
=
*
next_arg
;
// Link into next/prev chain
tmp
->
prev
=
*
next_arg
;
// Link into next/prev chain
(
*
next_arg
)
->
next
=
tmp
;
(
*
next_arg
)
->
next
=
tmp
;
...
...
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