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
e8c70649
Commit
e8c70649
authored
Aug 26, 2001
by
tonu@x153.internalnet
Browse files
Options
Browse Files
Download
Plain Diff
Merge tonu@work.mysql.com:/home/bk/mysql-4.0
into x153.internalnet:/home/tonu/mysql-4.0
parents
451e3c8c
3b6546b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
24 deletions
+42
-24
mysql-test/r/union.result
mysql-test/r/union.result
+3
-0
mysql-test/t/union.test
mysql-test/t/union.test
+0
-1
sql/sql_select.cc
sql/sql_select.cc
+20
-17
sql/sql_union.cc
sql/sql_union.cc
+19
-6
No files found.
mysql-test/r/union.result
View file @
e8c70649
...
...
@@ -56,3 +56,6 @@ t2 c 1
t2 d 1
t2 e 1
t2 f 1
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
t2 ALL NULL NULL NULL NULL 4
mysql-test/t/union.test
View file @
e8c70649
...
...
@@ -17,7 +17,6 @@ select a,b from t1 union select a,b from t1;
select
't1'
,
b
,
count
(
*
)
from
t1
group
by
b
UNION
select
't2'
,
b
,
count
(
*
)
from
t2
group
by
b
;
# Test some error conditions with UNION
--
error
1215
explain
select
a
,
b
from
t1
union
all
select
a
,
b
from
t2
;
--
error
1215
...
...
sql/sql_select.cc
View file @
e8c70649
...
...
@@ -6752,23 +6752,25 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
/* Don't log this into the slow query log */
join
->
thd
->
lex
.
select_lex
.
options
&=
~
(
QUERY_NO_INDEX_USED
|
QUERY_NO_GOOD_INDEX_USED
);
field_list
.
push_back
(
new
Item_empty_string
(
"table"
,
NAME_LEN
));
field_list
.
push_back
(
new
Item_empty_string
(
"type"
,
10
));
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"possible_keys"
,
if
(
join
->
thd
->
lex
.
select
==
&
join
->
thd
->
lex
.
select_lex
)
{
field_list
.
push_back
(
new
Item_empty_string
(
"table"
,
NAME_LEN
));
field_list
.
push_back
(
new
Item_empty_string
(
"type"
,
10
));
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"possible_keys"
,
NAME_LEN
*
MAX_KEY
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"key"
,
NAME_LEN
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_int
(
"key_len"
,
0
,
3
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"ref"
,
NAME_LEN
*
MAX_REF_PARTS
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
new
Item_real
(
"rows"
,
0.0
,
0
,
10
));
field_list
.
push_back
(
new
Item_empty_string
(
"Extra"
,
255
));
if
(
send_fields
(
thd
,
field_list
,
1
))
return
;
/* purecov: inspected */
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"key"
,
NAME_LEN
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_int
(
"key_len"
,
0
,
3
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"ref"
,
NAME_LEN
*
MAX_REF_PARTS
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
new
Item_real
(
"rows"
,
0.0
,
0
,
10
));
field_list
.
push_back
(
new
Item_empty_string
(
"Extra"
,
255
));
if
(
send_fields
(
thd
,
field_list
,
1
))
return
;
}
char
buff
[
512
],
*
buff_ptr
;
String
tmp
(
buff
,
sizeof
(
buff
)),
*
packet
=
&
thd
->
packet
;
table_map
used_tables
=
0
;
...
...
@@ -6899,7 +6901,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
// For next iteration
used_tables
|=
table
->
map
;
}
send_eof
(
&
thd
->
net
);
if
(
!
join
->
thd
->
lex
.
select
->
next
)
send_eof
(
&
thd
->
net
);
DBUG_VOID_RETURN
;
}
...
...
sql/sql_union.cc
View file @
e8c70649
...
...
@@ -38,12 +38,6 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
uint
elements
;
DBUG_ENTER
(
"mysql_union"
);
if
(
lex
->
select_lex
.
options
&
SELECT_DESCRIBE
)
{
my_error
(
ER_WRONG_USAGE
,
MYF
(
0
),
"DESCRIBE"
,
"UNION"
);
return
-
1
;
}
/* Fix tables--to-be-unioned-from list to point at opened tables */
for
(
sl
=&
lex
->
select_lex
;
sl
;
sl
=
sl
->
next
)
{
...
...
@@ -66,6 +60,25 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
}
}
if
(
lex
->
select_lex
.
options
&
SELECT_DESCRIBE
)
{
for
(
sl
=
&
lex
->
select_lex
;
sl
;
sl
=
sl
->
next
)
{
lex
->
select
=
sl
;
res
=
mysql_select
(
thd
,
(
TABLE_LIST
*
)
sl
->
table_list
.
first
,
sl
->
item_list
,
sl
->
where
,
sl
->
ftfunc_list
,
(
ORDER
*
)
0
,
(
ORDER
*
)
sl
->
group_list
.
first
,
sl
->
having
,
(
ORDER
*
)
NULL
,
sl
->
options
|
thd
->
options
|
SELECT_NO_UNLOCK
|
SELECT_DESCRIBE
,
result
);
}
return
0
;
}
order
=
(
ORDER
*
)
last_sl
->
order_list
.
first
;
{
Item
*
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