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
c93ae4f8
Commit
c93ae4f8
authored
Mar 30, 2005
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
fdf32bd4
9471e922
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
0 deletions
+63
-0
mysql-test/include/ps_query.inc
mysql-test/include/ps_query.inc
+5
-0
mysql-test/r/ps_2myisam.result
mysql-test/r/ps_2myisam.result
+4
-0
mysql-test/r/ps_3innodb.result
mysql-test/r/ps_3innodb.result
+4
-0
mysql-test/r/ps_4heap.result
mysql-test/r/ps_4heap.result
+4
-0
mysql-test/r/ps_5merge.result
mysql-test/r/ps_5merge.result
+8
-0
mysql-test/r/ps_6bdb.result
mysql-test/r/ps_6bdb.result
+4
-0
mysql-test/r/ps_7ndb.result
mysql-test/r/ps_7ndb.result
+4
-0
sql/item.cc
sql/item.cc
+28
-0
sql/item.h
sql/item.h
+1
-0
sql/item_subselect.h
sql/item_subselect.h
+1
-0
No files found.
mysql-test/include/ps_query.inc
View file @
c93ae4f8
...
@@ -421,6 +421,11 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -421,6 +421,11 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
b=? and a = (select ? from t1 where b = ? ) '
;
b=? and a = (select ? from t1 where b = ? ) '
;
execute
stmt1
using
@
arg00
,
@
arg01
,
@
arg02
,
@
arg03
;
execute
stmt1
using
@
arg00
,
@
arg01
,
@
arg02
,
@
arg03
;
# Bug#8807
prepare
stmt1
from
'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? '
;
execute
stmt1
using
@
arg01
,
@
arg02
;
######## correlated subquery
######## correlated subquery
# no parameter
# no parameter
prepare
stmt1
from
' select a, b FROM t1 outer_table where
prepare
stmt1
from
' select a, b FROM t1 outer_table where
...
...
mysql-test/r/ps_2myisam.result
View file @
c93ae4f8
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
...
mysql-test/r/ps_3innodb.result
View file @
c93ae4f8
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
...
mysql-test/r/ps_4heap.result
View file @
c93ae4f8
...
@@ -769,6 +769,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -769,6 +769,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
...
mysql-test/r/ps_5merge.result
View file @
c93ae4f8
...
@@ -811,6 +811,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -811,6 +811,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
@@ -3820,6 +3824,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -3820,6 +3824,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
...
mysql-test/r/ps_6bdb.result
View file @
c93ae4f8
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
...
mysql-test/r/ps_7ndb.result
View file @
c93ae4f8
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
...
@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b
a ? b
2 1 two
2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ;
execute stmt1 ;
...
...
sql/item.cc
View file @
c93ae4f8
...
@@ -2094,6 +2094,34 @@ bool Item_param::convert_str_value(THD *thd)
...
@@ -2094,6 +2094,34 @@ bool Item_param::convert_str_value(THD *thd)
return
rc
;
return
rc
;
}
}
bool
Item_param
::
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
**
ref
)
{
DBUG_ASSERT
(
fixed
==
0
);
SELECT_LEX
*
cursel
=
(
SELECT_LEX
*
)
thd
->
lex
->
current_select
;
/*
Parameters in a subselect should mark the subselect as not constant
during prepare
*/
if
(
state
==
NO_VALUE
)
{
/*
SELECT_LEX_UNIT::item set only for subqueries, so test of it presence
can be barrier to stop before derived table SELECT or very outer SELECT
*/
for
(;
cursel
->
master_unit
()
->
item
;
cursel
=
cursel
->
outer_select
())
{
Item_subselect
*
subselect_item
=
cursel
->
master_unit
()
->
item
;
subselect_item
->
used_tables_cache
|=
OUTER_REF_TABLE_BIT
;
subselect_item
->
const_item_cache
=
0
;
}
}
fixed
=
1
;
return
0
;
}
void
Item_param
::
print
(
String
*
str
)
void
Item_param
::
print
(
String
*
str
)
{
{
...
...
sql/item.h
View file @
c93ae4f8
...
@@ -882,6 +882,7 @@ public:
...
@@ -882,6 +882,7 @@ public:
bool
get_time
(
TIME
*
tm
);
bool
get_time
(
TIME
*
tm
);
bool
get_date
(
TIME
*
tm
,
uint
fuzzydate
);
bool
get_date
(
TIME
*
tm
,
uint
fuzzydate
);
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
bool
fix_fields
(
THD
*
,
struct
st_table_list
*
,
Item
**
);
void
set_null
();
void
set_null
();
void
set_int
(
longlong
i
,
uint32
max_length_arg
);
void
set_int
(
longlong
i
,
uint32
max_length_arg
);
...
...
sql/item_subselect.h
View file @
c93ae4f8
...
@@ -120,6 +120,7 @@ public:
...
@@ -120,6 +120,7 @@ public:
friend
class
Item_in_optimizer
;
friend
class
Item_in_optimizer
;
friend
bool
Item_field
::
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
friend
bool
Item_field
::
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
friend
bool
Item_ref
::
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
friend
bool
Item_ref
::
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
friend
bool
Item_param
::
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
};
};
/* single value subselect */
/* single value subselect */
...
...
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