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
a02094ef
Commit
a02094ef
authored
Sep 07, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed row union processing
parent
b48f64be
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 @
a02094ef
...
...
@@ -1361,3 +1361,11 @@ userid pmtotal pmnew calc_total calc_new
1 0 0 9 3
2 0 0 4 2
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 @
a02094ef
...
...
@@ -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
);
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
;
#
# 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 @
a02094ef
...
...
@@ -846,7 +846,7 @@ void subselect_union_engine::fix_length_and_dec(Item_cache **row)
SELECT_LEX
*
sl
=
unit
->
first_select
();
bool
fake
=
0
;
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
);
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