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
fe3aee30
Commit
fe3aee30
authored
Oct 10, 2008
by
Gleb Shchepa
Browse files
Options
Browse Files
Download
Plain Diff
automerge 5.0-bugteam --> 5.1-bugteam
parents
ac0027ae
e7520c4b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
mysql-test/r/metadata.result
mysql-test/r/metadata.result
+17
-0
mysql-test/t/metadata.test
mysql-test/t/metadata.test
+17
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-0
No files found.
mysql-test/r/metadata.result
View file @
fe3aee30
...
...
@@ -181,4 +181,21 @@ c1 c2
3 3
DROP VIEW v1,v2;
DROP TABLE t1,t2;
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '2008-01-01'), (2, '2008-01-02'), (3, '2008-01-03');
SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d),
CASE i WHEN i THEN d ELSE d END, GREATEST(d, d), LEAST(d, d)
FROM t1 ORDER BY RAND();
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01
2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02
2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03
COALESCE(d, d) IFNULL(d, d) IF(i, d, d) CASE i WHEN i THEN d ELSE d END GREATEST(d, d) LEAST(d, d)
def CASE i WHEN i THEN d ELSE d END CASE i WHEN i THEN d ELSE d END 10 10 10 Y 128 0 63
def COALESCE(d, d) COALESCE(d, d) 10 10 10 Y 128 0 63
def GREATEST(d, d) GREATEST(d, d) 10 10 10 Y 128 0 63
def IF(i, d, d) IF(i, d, d) 10 10 10 Y 128 0 63
def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/metadata.test
View file @
fe3aee30
...
...
@@ -112,4 +112,21 @@ SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2;
DROP
VIEW
v1
,
v2
;
DROP
TABLE
t1
,
t2
;
#
# Bug #39283: Date returned as VARBINARY to client for queries
# with COALESCE and JOIN
#
CREATE
TABLE
t1
(
i
INT
,
d
DATE
);
INSERT
INTO
t1
VALUES
(
1
,
'2008-01-01'
),
(
2
,
'2008-01-02'
),
(
3
,
'2008-01-03'
);
--
enable_metadata
--
sorted_result
SELECT
COALESCE
(
d
,
d
),
IFNULL
(
d
,
d
),
IF
(
i
,
d
,
d
),
CASE
i
WHEN
i
THEN
d
ELSE
d
END
,
GREATEST
(
d
,
d
),
LEAST
(
d
,
d
)
FROM
t1
ORDER
BY
RAND
();
# force filesort
--
disable_metadata
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/sql_select.cc
View file @
fe3aee30
...
...
@@ -9274,6 +9274,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
*/
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
||
type
==
MYSQL_TYPE_NEWDATE
||
type
==
MYSQL_TYPE_TIMESTAMP
||
type
==
MYSQL_TYPE_GEOMETRY
)
new_field
=
item
->
tmp_table_field_from_field_type
(
table
,
1
);
/*
...
...
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