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
9bd49d48
Commit
9bd49d48
authored
Mar 29, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
after review patch
commant for function
parent
b3936e42
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
25 deletions
+22
-25
sql/item_subselect.cc
sql/item_subselect.cc
+1
-3
sql/sql_derived.cc
sql/sql_derived.cc
+1
-2
sql/sql_lex.cc
sql/sql_lex.cc
+12
-4
sql/sql_lex.h
sql/sql_lex.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+2
-4
sql/sql_select.cc
sql/sql_select.cc
+3
-7
sql/sql_union.cc
sql/sql_union.cc
+2
-4
No files found.
sql/item_subselect.cc
View file @
9bd49d48
...
...
@@ -883,9 +883,7 @@ subselect_single_select_engine(st_select_lex *select,
{
select_lex
=
select
;
SELECT_LEX_UNIT
*
unit
=
select_lex
->
master_unit
();
unit
->
set_limit
(
unit
->
global_parameters
->
select_limit
,
unit
->
global_parameters
->
offset_limit
,
select_lex
);
unit
->
set_limit
(
unit
->
global_parameters
,
select_lex
);
unit
->
item
=
item
;
this
->
select_lex
=
select_lex
;
}
...
...
sql/sql_derived.cc
View file @
9bd49d48
...
...
@@ -154,8 +154,7 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
res
=
mysql_union
(
thd
,
lex
,
derived_result
,
unit
);
else
{
unit
->
set_limit
(
first_select
->
select_limit
,
first_select
->
offset_limit
,
first_select
);
unit
->
set_limit
(
first_select
,
first_select
);
lex
->
current_select
=
first_select
;
res
=
mysql_select
(
thd
,
&
first_select
->
ref_pointer_array
,
...
...
sql/sql_lex.cc
View file @
9bd49d48
...
...
@@ -1635,12 +1635,20 @@ void st_select_lex::print_limit(THD *thd, String *str)
}
}
void
st_select_lex_unit
::
set_limit
(
ha_rows
limit
,
ha_rows
offset
,
/*
initialize limit counters
SYNOPSIS
st_select_lex_unit::set_limit()
values - SELECT_LEX with initial values for counters
sl - SELECT_LEX for options set
*/
void
st_select_lex_unit
::
set_limit
(
SELECT_LEX
*
values
,
SELECT_LEX
*
sl
)
{
offset_limit_cnt
=
offse
t
;
select_limit_cnt
=
limit
+
offse
t
;
if
(
select_limit_cnt
<
limit
)
offset_limit_cnt
=
values
->
offset_limi
t
;
select_limit_cnt
=
values
->
select_limit
+
values
->
offset_limi
t
;
if
(
select_limit_cnt
<
values
->
select_
limit
)
select_limit_cnt
=
HA_POS_ERROR
;
// no limit
if
(
select_limit_cnt
==
HA_POS_ERROR
)
sl
->
options
&=
~
OPTION_FOUND_ROWS
;
...
...
sql/sql_lex.h
View file @
9bd49d48
...
...
@@ -371,7 +371,7 @@ class st_select_lex_unit: public st_select_lex_node {
bool
check_updateable
(
char
*
db
,
char
*
table
);
void
print
(
String
*
str
);
void
set_limit
(
ha_rows
limit
,
ha_rows
offset
,
st_select_lex
*
sl
);
void
set_limit
(
st_select_lex
*
values
,
st_select_lex
*
sl
);
friend
void
mysql_init_query
(
THD
*
thd
,
bool
lexonly
);
friend
int
subselect_union_engine
::
exec
();
...
...
sql/sql_parse.cc
View file @
9bd49d48
...
...
@@ -2179,8 +2179,7 @@ mysql_execute_command(THD *thd)
if
(
tables
&&
check_table_access
(
thd
,
SELECT_ACL
,
tables
,
0
))
goto
error
;
// Error message is given
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
select_lex
);
unit
->
set_limit
(
select_lex
,
select_lex
);
if
(
!
(
res
=
open_and_lock_tables
(
thd
,
tables
)))
{
...
...
@@ -2580,8 +2579,7 @@ mysql_execute_command(THD *thd)
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
select_result
*
result
;
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
select_lex
);
unit
->
set_limit
(
select_lex
,
select_lex
);
if
(
find_real_table_in_list
(
tables
->
next
,
tables
->
db
,
tables
->
real_name
))
{
...
...
sql/sql_select.cc
View file @
9bd49d48
...
...
@@ -179,9 +179,7 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
else
{
SELECT_LEX_UNIT
*
unit
=
&
lex
->
unit
;
unit
->
set_limit
(
unit
->
global_parameters
->
select_limit
,
unit
->
global_parameters
->
offset_limit
,
select_lex
);
unit
->
set_limit
(
unit
->
global_parameters
,
select_lex
);
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
,
select_lex
->
with_wild
,
select_lex
->
item_list
,
...
...
@@ -1015,8 +1013,7 @@ JOIN::reinit()
{
DBUG_ENTER
(
"JOIN::reinit"
);
/* TODO move to unit reinit */
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
select_lex
);
unit
->
set_limit
(
select_lex
,
select_lex
);
if
(
setup_tables
(
tables_list
,
1
))
DBUG_RETURN
(
1
);
...
...
@@ -9267,8 +9264,7 @@ int mysql_explain_select(THD *thd, SELECT_LEX *select_lex, char const *type,
unit
->
select_limit_cnt
=
HA_POS_ERROR
;
}
else
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
select_lex
);
unit
->
set_limit
(
select_lex
,
select_lex
);
int
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
,
select_lex
->
with_wild
,
select_lex
->
item_list
,
...
...
sql/sql_union.cc
View file @
9bd49d48
...
...
@@ -151,7 +151,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
sl
->
options
|
thd_arg
->
options
|
additional_options
,
tmp_result
);
thd_arg
->
lex
->
current_select
=
sl
;
set_limit
(
sl
->
select_limit
,
sl
->
offset_limit
,
sl
);
set_limit
(
sl
,
sl
);
if
(
sl
->
braces
)
sl
->
options
&=
~
OPTION_FOUND_ROWS
;
...
...
@@ -375,9 +375,7 @@ int st_select_lex_unit::exec()
{
thd
->
lex
->
current_select
=
fake_select_lex
;
fake_select_lex
->
options
=
thd
->
options
;
set_limit
(
global_parameters
->
select_limit
,
global_parameters
->
offset_limit
,
fake_select_lex
);
set_limit
(
global_parameters
,
fake_select_lex
);
if
(
found_rows_for_union
&&
!
thd
->
lex
->
describe
&&
select_limit_cnt
!=
HA_POS_ERROR
)
...
...
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