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
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,
...
@@ -883,9 +883,7 @@ subselect_single_select_engine(st_select_lex *select,
{
{
select_lex
=
select
;
select_lex
=
select
;
SELECT_LEX_UNIT
*
unit
=
select_lex
->
master_unit
();
SELECT_LEX_UNIT
*
unit
=
select_lex
->
master_unit
();
unit
->
set_limit
(
unit
->
global_parameters
->
select_limit
,
unit
->
set_limit
(
unit
->
global_parameters
,
select_lex
);
unit
->
global_parameters
->
offset_limit
,
select_lex
);
unit
->
item
=
item
;
unit
->
item
=
item
;
this
->
select_lex
=
select_lex
;
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,
...
@@ -154,8 +154,7 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
res
=
mysql_union
(
thd
,
lex
,
derived_result
,
unit
);
res
=
mysql_union
(
thd
,
lex
,
derived_result
,
unit
);
else
else
{
{
unit
->
set_limit
(
first_select
->
select_limit
,
first_select
->
offset_limit
,
unit
->
set_limit
(
first_select
,
first_select
);
first_select
);
lex
->
current_select
=
first_select
;
lex
->
current_select
=
first_select
;
res
=
mysql_select
(
thd
,
&
first_select
->
ref_pointer_array
,
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)
...
@@ -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
)
SELECT_LEX
*
sl
)
{
{
offset_limit_cnt
=
offse
t
;
offset_limit_cnt
=
values
->
offset_limi
t
;
select_limit_cnt
=
limit
+
offse
t
;
select_limit_cnt
=
values
->
select_limit
+
values
->
offset_limi
t
;
if
(
select_limit_cnt
<
limit
)
if
(
select_limit_cnt
<
values
->
select_
limit
)
select_limit_cnt
=
HA_POS_ERROR
;
// no limit
select_limit_cnt
=
HA_POS_ERROR
;
// no limit
if
(
select_limit_cnt
==
HA_POS_ERROR
)
if
(
select_limit_cnt
==
HA_POS_ERROR
)
sl
->
options
&=
~
OPTION_FOUND_ROWS
;
sl
->
options
&=
~
OPTION_FOUND_ROWS
;
...
...
sql/sql_lex.h
View file @
9bd49d48
...
@@ -371,7 +371,7 @@ public:
...
@@ -371,7 +371,7 @@ public:
bool
check_updateable
(
char
*
db
,
char
*
table
);
bool
check_updateable
(
char
*
db
,
char
*
table
);
void
print
(
String
*
str
);
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
void
mysql_init_query
(
THD
*
thd
,
bool
lexonly
);
friend
int
subselect_union_engine
::
exec
();
friend
int
subselect_union_engine
::
exec
();
...
...
sql/sql_parse.cc
View file @
9bd49d48
...
@@ -2179,8 +2179,7 @@ mysql_execute_command(THD *thd)
...
@@ -2179,8 +2179,7 @@ mysql_execute_command(THD *thd)
if
(
tables
&&
check_table_access
(
thd
,
SELECT_ACL
,
tables
,
0
))
if
(
tables
&&
check_table_access
(
thd
,
SELECT_ACL
,
tables
,
0
))
goto
error
;
// Error message is given
goto
error
;
// Error message is given
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
unit
->
set_limit
(
select_lex
,
select_lex
);
select_lex
);
if
(
!
(
res
=
open_and_lock_tables
(
thd
,
tables
)))
if
(
!
(
res
=
open_and_lock_tables
(
thd
,
tables
)))
{
{
...
@@ -2580,8 +2579,7 @@ mysql_execute_command(THD *thd)
...
@@ -2580,8 +2579,7 @@ mysql_execute_command(THD *thd)
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
select_lex
->
options
|=
SELECT_NO_UNLOCK
;
select_result
*
result
;
select_result
*
result
;
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
unit
->
set_limit
(
select_lex
,
select_lex
);
select_lex
);
if
(
find_real_table_in_list
(
tables
->
next
,
tables
->
db
,
tables
->
real_name
))
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)
...
@@ -179,9 +179,7 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
else
else
{
{
SELECT_LEX_UNIT
*
unit
=
&
lex
->
unit
;
SELECT_LEX_UNIT
*
unit
=
&
lex
->
unit
;
unit
->
set_limit
(
unit
->
global_parameters
->
select_limit
,
unit
->
set_limit
(
unit
->
global_parameters
,
select_lex
);
unit
->
global_parameters
->
offset_limit
,
select_lex
);
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
,
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
,
select_lex
->
with_wild
,
select_lex
->
item_list
,
select_lex
->
with_wild
,
select_lex
->
item_list
,
...
@@ -1015,8 +1013,7 @@ JOIN::reinit()
...
@@ -1015,8 +1013,7 @@ JOIN::reinit()
{
{
DBUG_ENTER
(
"JOIN::reinit"
);
DBUG_ENTER
(
"JOIN::reinit"
);
/* TODO move to unit reinit */
/* TODO move to unit reinit */
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
unit
->
set_limit
(
select_lex
,
select_lex
);
select_lex
);
if
(
setup_tables
(
tables_list
,
1
))
if
(
setup_tables
(
tables_list
,
1
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
@@ -9267,8 +9264,7 @@ int mysql_explain_select(THD *thd, SELECT_LEX *select_lex, char const *type,
...
@@ -9267,8 +9264,7 @@ int mysql_explain_select(THD *thd, SELECT_LEX *select_lex, char const *type,
unit
->
select_limit_cnt
=
HA_POS_ERROR
;
unit
->
select_limit_cnt
=
HA_POS_ERROR
;
}
}
else
else
unit
->
set_limit
(
select_lex
->
select_limit
,
select_lex
->
offset_limit
,
unit
->
set_limit
(
select_lex
,
select_lex
);
select_lex
);
int
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
int
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
,
(
TABLE_LIST
*
)
select_lex
->
table_list
.
first
,
select_lex
->
with_wild
,
select_lex
->
item_list
,
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,
...
@@ -151,7 +151,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
sl
->
options
|
thd_arg
->
options
|
additional_options
,
sl
->
options
|
thd_arg
->
options
|
additional_options
,
tmp_result
);
tmp_result
);
thd_arg
->
lex
->
current_select
=
sl
;
thd_arg
->
lex
->
current_select
=
sl
;
set_limit
(
sl
->
select_limit
,
sl
->
offset_limit
,
sl
);
set_limit
(
sl
,
sl
);
if
(
sl
->
braces
)
if
(
sl
->
braces
)
sl
->
options
&=
~
OPTION_FOUND_ROWS
;
sl
->
options
&=
~
OPTION_FOUND_ROWS
;
...
@@ -375,9 +375,7 @@ int st_select_lex_unit::exec()
...
@@ -375,9 +375,7 @@ int st_select_lex_unit::exec()
{
{
thd
->
lex
->
current_select
=
fake_select_lex
;
thd
->
lex
->
current_select
=
fake_select_lex
;
fake_select_lex
->
options
=
thd
->
options
;
fake_select_lex
->
options
=
thd
->
options
;
set_limit
(
global_parameters
->
select_limit
,
set_limit
(
global_parameters
,
fake_select_lex
);
global_parameters
->
offset_limit
,
fake_select_lex
);
if
(
found_rows_for_union
&&
!
thd
->
lex
->
describe
&&
if
(
found_rows_for_union
&&
!
thd
->
lex
->
describe
&&
select_limit_cnt
!=
HA_POS_ERROR
)
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