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
9b358f81
Commit
9b358f81
authored
Mar 29, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#26624: high mem usage (crash) in range optimizer
- Post-review fixes
parent
edd5a859
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 @
9b358f81
...
...
@@ -175,7 +175,7 @@ static char is_null_string[2]= {1,0};
Example:
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
following keyparts:
...
...
@@ -184,18 +184,18 @@ static char is_null_string[2]= {1,0};
We will obtain this SEL_ARG graph:
kp14 $ kp15 $ kp16
$ $
+---------+ $ +--------+ $ +---------+
| kp14=c1 |--$-->| kp15=
1
|--$-->| kp16=c3 |
+---------+ $ +--------+ $ +---------+
| $ $
+---------+ $ +--------+ $
| kp14=c2 |--$-->| kp15=
1
| $
+---------+ $ +--------+ $
$ $
kp14 $ kp15
$ kp16
$
$
+---------+ $ +--------
-
+ $ +---------+
| kp14=c1 |--$-->| kp15=
c0
|--$-->| kp16=c3 |
+---------+ $ +--------
-
+ $ +---------+
| $
$
+---------+ $ +--------
-
+ $
| 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.
The induction step: AND the obtained expression with another "wrapping"
expression like (*).
...
...
@@ -477,7 +477,7 @@ typedef struct st_qsel_param {
max_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
];
bool
quick
;
// Don't calulate possible keys
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
;
}
PARAM
;
...
...
@@ -681,7 +681,8 @@ SEL_ARG *SEL_ARG::clone(PARAM *param, SEL_ARG *new_parent, SEL_ARG **next_arg)
tmp
->
parent
=
new_parent
;
tmp
->
next_key_part
=
next_key_part
;
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
(
*
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