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
d8361678
Commit
d8361678
authored
Sep 07, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-in-4.1
parents
bebe295d
a02094ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+8
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+10
-0
sql/item_subselect.cc
sql/item_subselect.cc
+1
-1
No files found.
mysql-test/r/subselect.result
View file @
d8361678
...
@@ -1361,3 +1361,11 @@ userid pmtotal pmnew calc_total calc_new
...
@@ -1361,3 +1361,11 @@ userid pmtotal pmnew calc_total calc_new
1 0 0 9 3
1 0 0 9 3
2 0 0 4 2
2 0 0 4 2
drop table t1, t2;
drop table t1, t2;
create table t1 (s1 char(5));
select (select 'a','b' from t1 union select 'a','b' from t1) from t1;
ERROR 21000: Cardinality error (more/less than 1 columns)
insert into t1 values ('tttt');
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
s1
tttt
drop table t1;
mysql-test/t/subselect.test
View file @
d8361678
...
@@ -922,3 +922,13 @@ insert into t2 values(1,0,0),(2,0,0);
...
@@ -922,3 +922,13 @@ insert into t2 values(1,0,0),(2,0,0);
insert
into
t1
values
(
1
,
0
),(
1
,
0
),(
1
,
0
),(
1
,
12
),(
1
,
15
),(
1
,
123
),(
1
,
12312
),(
1
,
12312
),(
1
,
123
),(
2
,
0
),(
2
,
0
),(
2
,
1
),(
2
,
2
);
insert
into
t1
values
(
1
,
0
),(
1
,
0
),(
1
,
0
),(
1
,
12
),(
1
,
15
),(
1
,
123
),(
1
,
12312
),(
1
,
12312
),(
1
,
123
),(
2
,
0
),(
2
,
0
),(
2
,
1
),(
2
,
2
);
select
userid
,
pmtotal
,
pmnew
,
(
select
count
(
rd
)
from
t1
where
toid
=
t2
.
userid
)
calc_total
,
(
select
count
(
rd
)
from
t1
where
rd
=
0
and
toid
=
t2
.
userid
)
calc_new
from
t2
where
userid
in
(
select
distinct
toid
from
t1
);
select
userid
,
pmtotal
,
pmnew
,
(
select
count
(
rd
)
from
t1
where
toid
=
t2
.
userid
)
calc_total
,
(
select
count
(
rd
)
from
t1
where
rd
=
0
and
toid
=
t2
.
userid
)
calc_new
from
t2
where
userid
in
(
select
distinct
toid
from
t1
);
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# row union
#
create
table
t1
(
s1
char
(
5
));
--
error
1240
select
(
select
'a'
,
'b'
from
t1
union
select
'a'
,
'b'
from
t1
)
from
t1
;
insert
into
t1
values
(
'tttt'
);
select
*
from
t1
where
(
'a'
,
'b'
)
=
(
select
'a'
,
'b'
from
t1
union
select
'a'
,
'b'
from
t1
);
drop
table
t1
;
sql/item_subselect.cc
View file @
d8361678
...
@@ -846,7 +846,7 @@ void subselect_union_engine::fix_length_and_dec(Item_cache **row)
...
@@ -846,7 +846,7 @@ void subselect_union_engine::fix_length_and_dec(Item_cache **row)
SELECT_LEX
*
sl
=
unit
->
first_select
();
SELECT_LEX
*
sl
=
unit
->
first_select
();
bool
fake
=
0
;
bool
fake
=
0
;
res_type
=
set_row
(
sl
,
item
,
row
,
&
fake
);
res_type
=
set_row
(
sl
,
item
,
row
,
&
fake
);
for
(
sl
=
sl
->
next_select
();
sl
;
sl
->
next_select
())
for
(
sl
=
sl
->
next_select
();
sl
;
sl
=
sl
->
next_select
())
{
{
List_iterator_fast
<
Item
>
li
(
sl
->
item_list
);
List_iterator_fast
<
Item
>
li
(
sl
->
item_list
);
Item
*
sel_item
;
Item
*
sel_item
;
...
...
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