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
9724795f
Commit
9724795f
authored
May 03, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-test-valgrind
parents
40d0c3e6
21d3d43c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
sql/opt_range.cc
sql/opt_range.cc
+19
-6
sql/opt_range.h
sql/opt_range.h
+4
-2
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
sql/opt_range.cc
View file @
9724795f
...
...
@@ -5513,14 +5513,26 @@ bool QUICK_ROR_UNION_SELECT::check_if_keys_used(List<Item> *fields)
}
/****************************************************************************
Create a QUICK RANGE based on a key
This allocates things in a new memory root, as this may be called many times
during a query.
****************************************************************************/
/*
Create quick select from ref/ref_or_null scan.
SYNOPSIS
get_quick_select_for_ref()
thd Thread handle
table Table to access
ref ref[_or_null] scan parameters
records Estimate of number of records (needed only to construct
quick select)
NOTES
This allocates things in a new memory root, as this may be called many
times during a query.
RETURN
Quick select that retrieves the same rows as passed ref scan
NULL on error.
*/
QUICK_RANGE_SELECT
*
get_quick_select_for_ref
(
THD
*
thd
,
TABLE
*
table
,
TABLE_REF
*
ref
)
TABLE_REF
*
ref
,
ha_rows
records
)
{
MEM_ROOT
*
old_root
=
thd
->
mem_root
;
/* The following call may change thd->mem_root */
...
...
@@ -5537,6 +5549,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
delete
quick
;
goto
err
;
}
quick
->
records
=
records
;
if
(
cp_buffer_from_ref
(
thd
,
ref
)
&&
thd
->
is_fatal_error
||
!
(
range
=
new
QUICK_RANGE
()))
...
...
sql/opt_range.h
View file @
9724795f
...
...
@@ -281,7 +281,8 @@ class QUICK_RANGE_SELECT : public QUICK_SELECT_I
friend
class
TRP_ROR_INTERSECT
;
friend
QUICK_RANGE_SELECT
*
get_quick_select_for_ref
(
THD
*
thd
,
TABLE
*
table
,
struct
st_table_ref
*
ref
);
struct
st_table_ref
*
ref
,
ha_rows
records
);
friend
bool
get_quick_keys
(
struct
st_qsel_param
*
param
,
QUICK_RANGE_SELECT
*
quick
,
KEY_PART
*
key
,
SEL_ARG
*
key_tree
,
...
...
@@ -709,5 +710,6 @@ class FT_SELECT: public QUICK_RANGE_SELECT {
};
QUICK_RANGE_SELECT
*
get_quick_select_for_ref
(
THD
*
thd
,
TABLE
*
table
,
struct
st_table_ref
*
ref
);
struct
st_table_ref
*
ref
,
ha_rows
records
);
#endif
sql/sql_select.cc
View file @
9724795f
...
...
@@ -11002,7 +11002,8 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
*/
if
(
!
(
select
->
quick
=
(
tab
->
type
==
JT_FT
?
new
FT_SELECT
(
thd
,
table
,
tab
->
ref
.
key
)
:
get_quick_select_for_ref
(
thd
,
table
,
&
tab
->
ref
))))
get_quick_select_for_ref
(
thd
,
table
,
&
tab
->
ref
,
tab
->
found_records
))))
goto
err
;
}
}
...
...
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