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
033b1c30
Commit
033b1c30
authored
Dec 25, 2002
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more correct argument for translation function (SCRUM related)
fiexd bug in LIMIT check
parent
e67a0d2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
sql/item_subselect.cc
sql/item_subselect.cc
+20
-21
sql/item_subselect.h
sql/item_subselect.h
+5
-5
No files found.
sql/item_subselect.cc
View file @
033b1c30
...
...
@@ -51,7 +51,7 @@ void Item_subselect::init(THD *thd, st_select_lex *select_lex,
DBUG_ENTER
(
"Item_subselect::init"
);
DBUG_PRINT
(
"subs"
,
(
"select_lex 0x%xl"
,
(
ulong
)
select_lex
));
select_transformer
(
select_lex
);
select_transformer
(
select_lex
->
master_unit
()
);
if
(
select_lex
->
next_select
())
engine
=
new
subselect_union_engine
(
thd
,
select_lex
->
master_unit
(),
result
,
this
);
...
...
@@ -67,7 +67,7 @@ Item_subselect::~Item_subselect()
delete
engine
;
}
void
Item_subselect
::
select_transformer
(
st_select_lex
*
select_lex
)
void
Item_subselect
::
select_transformer
(
st_select_lex
_unit
*
unit
)
{
DBUG_ENTER
(
"Item_subselect::select_transformer"
);
DBUG_VOID_RETURN
;
...
...
@@ -394,13 +394,12 @@ Item_allany_subselect::Item_allany_subselect(Item_allany_subselect *item):
func
=
item
->
func
;
}
void
Item_in_subselect
::
single_value_transformer
(
st_select_lex
*
select_lex
,
void
Item_in_subselect
::
single_value_transformer
(
st_select_lex
_unit
*
unit
,
Item
*
left_expr
,
compare_func_creator
func
)
{
DBUG_ENTER
(
"Item_in_subselect::single_value_transformer"
);
if
(
select_lex
->
master_unit
()
->
global_parameters
->
select_limit
!=
HA_POS_ERROR
)
if
(
unit
->
global_parameters
->
select_limit
!=
HA_POS_ERROR
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
"LIMIT & IN/ALL/ANY/SOME subquery"
);
...
...
@@ -420,17 +419,17 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
Item
*
expr
=
new
Item_ref
((
Item
**
)
optimizer
->
get_cache
(),
(
char
*
)
"<no matter>"
,
(
char
*
)
"<left expr>"
);
select_lex
->
master_unit
()
->
dependent
=
1
;
for
(
SELECT_LEX
*
sl
=
select_lex
;
sl
;
sl
=
sl
->
next_select
())
unit
->
dependent
=
1
;
for
(
SELECT_LEX
*
sl
=
unit
->
first_select
()
;
sl
;
sl
=
sl
->
next_select
())
{
if
(
s
elect_lex
->
select_limit
!=
HA_POS_ERROR
)
if
(
s
l
->
select_limit
!=
HA_POS_ERROR
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
"LIMIT & IN/ALL/ANY/SOME subquery"
);
DBUG_VOID_RETURN
;
}
s
elect_lex
->
dependent
=
1
;
s
l
->
dependent
=
1
;
Item
*
item
;
if
(
sl
->
item_list
.
elements
>
1
)
{
...
...
@@ -481,7 +480,7 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
my_error
(
ER_NO_TABLES_USED
,
MYF
(
0
));
DBUG_VOID_RETURN
;
}
if
(
select_lex
->
next_select
())
if
(
unit
->
first_select
()
->
next_select
())
{
/*
It is in union => we should perform it.
...
...
@@ -513,11 +512,11 @@ void Item_in_subselect::single_value_transformer(st_select_lex *select_lex,
DBUG_VOID_RETURN
;
}
void
Item_in_subselect
::
row_value_transformer
(
st_select_lex
*
select_lex
,
void
Item_in_subselect
::
row_value_transformer
(
st_select_lex
_unit
*
unit
,
Item
*
left_expr
)
{
DBUG_ENTER
(
"Item_in_subselect::row_value_transformer"
);
if
(
select_lex
->
master_unit
()
->
global_parameters
->
select_limit
!=
if
(
unit
->
global_parameters
->
select_limit
!=
HA_POS_ERROR
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
...
...
@@ -531,20 +530,20 @@ void Item_in_subselect::row_value_transformer(st_select_lex *select_lex,
current_thd
->
fatal_error
=
1
;
DBUG_VOID_RETURN
;
}
select_lex
->
master_unit
()
->
dependent
=
1
;
unit
->
dependent
=
1
;
uint
n
=
left_expr
->
cols
();
if
(
optimizer
->
preallocate_row
()
||
(
*
optimizer
->
get_cache
())
->
allocate
(
n
))
DBUG_VOID_RETURN
;
for
(
SELECT_LEX
*
sl
=
select_lex
;
sl
;
sl
=
sl
->
next_select
())
for
(
SELECT_LEX
*
sl
=
unit
->
first_select
()
;
sl
;
sl
=
sl
->
next_select
())
{
if
(
s
elect_lex
->
select_limit
!=
HA_POS_ERROR
)
if
(
s
l
->
select_limit
!=
HA_POS_ERROR
)
{
my_error
(
ER_NOT_SUPPORTED_YET
,
MYF
(
0
),
"LIMIT & IN/ALL/ANY/SOME subquery"
);
DBUG_VOID_RETURN
;
}
s
elect_lex
->
dependent
=
1
;
s
l
->
dependent
=
1
;
Item
*
item
=
0
;
List_iterator_fast
<
Item
>
li
(
sl
->
item_list
);
...
...
@@ -582,18 +581,18 @@ void Item_in_subselect::row_value_transformer(st_select_lex *select_lex,
}
void
Item_in_subselect
::
select_transformer
(
st_select_lex
*
select_lex
)
void
Item_in_subselect
::
select_transformer
(
st_select_lex
_unit
*
unit
)
{
if
(
left_expr
->
cols
()
==
1
)
single_value_transformer
(
select_lex
,
left_expr
,
single_value_transformer
(
unit
,
left_expr
,
&
Item_bool_func2
::
eq_creator
);
else
row_value_transformer
(
select_lex
,
left_expr
);
row_value_transformer
(
unit
,
left_expr
);
}
void
Item_allany_subselect
::
select_transformer
(
st_select_lex
*
select_lex
)
void
Item_allany_subselect
::
select_transformer
(
st_select_lex
_unit
*
unit
)
{
single_value_transformer
(
select_lex
,
left_expr
,
func
);
single_value_transformer
(
unit
,
left_expr
,
func
);
}
subselect_single_select_engine
::
subselect_single_select_engine
(
THD
*
thd
,
...
...
sql/item_subselect.h
View file @
033b1c30
...
...
@@ -71,7 +71,7 @@ public:
{
null_value
=
1
;
}
virtual
void
select_transformer
(
st_select_lex
*
select_lex
);
virtual
void
select_transformer
(
st_select_lex
_unit
*
unit
);
bool
assigned
()
{
return
value_assigned
;
}
void
assigned
(
bool
a
)
{
value_assigned
=
a
;
}
enum
Type
type
()
const
;
...
...
@@ -172,10 +172,10 @@ public:
null_value
=
0
;
was_null
=
0
;
}
virtual
void
select_transformer
(
st_select_lex
*
select_lex
);
void
single_value_transformer
(
st_select_lex
*
select_lex
,
virtual
void
select_transformer
(
st_select_lex
_unit
*
unit
);
void
single_value_transformer
(
st_select_lex
_unit
*
unit
,
Item
*
left_expr
,
compare_func_creator
func
);
void
row_value_transformer
(
st_select_lex
*
select_lex
,
Item
*
left_expr
);
void
row_value_transformer
(
st_select_lex
_unit
*
unit
,
Item
*
left_expr
);
longlong
val_int
();
double
val
();
String
*
val_str
(
String
*
);
...
...
@@ -194,7 +194,7 @@ public:
Item_allany_subselect
(
THD
*
thd
,
Item
*
left_expr
,
compare_func_creator
f
,
st_select_lex
*
select_lex
);
Item_allany_subselect
(
Item_allany_subselect
*
item
);
virtual
void
select_transformer
(
st_select_lex
*
select_lex
);
virtual
void
select_transformer
(
st_select_lex
_unit
*
unit
);
};
class
subselect_engine
...
...
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