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
65febd1a
Commit
65febd1a
authored
May 15, 2009
by
Kristofer Pettersson
Browse files
Options
Browse Files
Download
Plain Diff
Automerge
parents
a41d3800
d8b4b50b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
3 deletions
+63
-3
mysql-test/r/type_time.result
mysql-test/r/type_time.result
+10
-0
mysql-test/r/union.result
mysql-test/r/union.result
+13
-0
mysql-test/t/type_time.test
mysql-test/t/type_time.test
+13
-0
mysql-test/t/union.test
mysql-test/t/union.test
+12
-0
sql/field.cc
sql/field.cc
+1
-1
sql/sql_union.cc
sql/sql_union.cc
+14
-2
No files found.
mysql-test/r/type_time.result
View file @
65febd1a
...
...
@@ -128,3 +128,13 @@ SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
sum(f3)
3
drop table t1;
#
# Bug #44792: valgrind warning when casting from time to time
#
CREATE TABLE t1 (c TIME);
INSERT INTO t1 VALUES ('0:00:00');
SELECT CAST(c AS TIME) FROM t1;
CAST(c AS TIME)
00:00:00
DROP TABLE t1;
End of 5.0 tests
mysql-test/r/union.result
View file @
65febd1a
...
...
@@ -1574,4 +1574,17 @@ SHOW FIELDS FROM t2;
Field Type Null Key Default Extra
d double(9,6) YES NULL
DROP TABLE t1, t2;
CREATE TABLE t1(a INT);
EXPLAIN EXTENDED
SELECT a FROM t1
UNION
SELECT a FROM t1
ORDER BY a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found
2 UNION t1 system NULL NULL NULL NULL 0 0.00 const row not found
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
Warnings:
Note 1003 select '0' AS `a` from `test`.`t1` union select '0' AS `a` from `test`.`t1` order by `a`
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/type_time.test
View file @
65febd1a
...
...
@@ -77,3 +77,16 @@ insert into t1 values('2007-07-02', 1);
insert
into
t1
values
(
'2007-07-02'
,
2
);
SELECT
sum
(
f3
)
FROM
t1
where
f2
=
'2007-07-01 00:00:00'
group
by
f2
;
drop
table
t1
;
--
echo
#
--
echo
# Bug #44792: valgrind warning when casting from time to time
--
echo
#
CREATE
TABLE
t1
(
c
TIME
);
INSERT
INTO
t1
VALUES
(
'0:00:00'
);
SELECT
CAST
(
c
AS
TIME
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
mysql-test/t/union.test
View file @
65febd1a
...
...
@@ -1089,4 +1089,16 @@ CREATE TABLE t2 AS SELECT d FROM t1 UNION SELECT d FROM t1;
SHOW
FIELDS
FROM
t2
;
DROP
TABLE
t1
,
t2
;
#
# Bug#43612 crash with explain extended, union, order by
#
CREATE
TABLE
t1
(
a
INT
);
EXPLAIN
EXTENDED
SELECT
a
FROM
t1
UNION
SELECT
a
FROM
t1
ORDER
BY
a
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/field.cc
View file @
65febd1a
...
...
@@ -5307,7 +5307,7 @@ bool Field_time::get_time(MYSQL_TIME *ltime)
ltime
->
neg
=
1
;
tmp
=-
tmp
;
}
ltime
->
day
=
0
;
ltime
->
year
=
ltime
->
month
=
ltime
->
day
=
0
;
ltime
->
hour
=
(
int
)
(
tmp
/
10000
);
tmp
-=
ltime
->
hour
*
10000
;
ltime
->
minute
=
(
int
)
tmp
/
100
;
...
...
sql/sql_union.cc
View file @
65febd1a
...
...
@@ -653,10 +653,22 @@ bool st_select_lex_unit::cleanup()
join
->
tables
=
0
;
}
error
|=
fake_select_lex
->
cleanup
();
if
(
fake_select_lex
->
order_list
.
elements
)
/*
There are two cases when we should clean order items:
1. UNION with SELECTs which all enclosed into braces
in this case global_parameters == fake_select_lex
2. UNION where last SELECT is not enclosed into braces
in this case global_parameters == 'last select'
So we should use global_parameters->order_list for
proper order list clean up.
Note: global_parameters and fake_select_lex are always
initialized for UNION
*/
DBUG_ASSERT
(
global_parameters
);
if
(
global_parameters
->
order_list
.
elements
)
{
ORDER
*
ord
;
for
(
ord
=
(
ORDER
*
)
fake_select_lex
->
order_list
.
first
;
ord
;
ord
=
ord
->
next
)
for
(
ord
=
(
ORDER
*
)
global_parameters
->
order_list
.
first
;
ord
;
ord
=
ord
->
next
)
(
*
ord
->
item
)
->
cleanup
();
}
}
...
...
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