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
a70ae437
Commit
a70ae437
authored
Jan 28, 2004
by
jani@rhols221.adsl.netsonic.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in GREATES() and LEAST() function, that caused a core
dump when result was NULL.
parent
8dea612a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
mysql-test/r/func_test.result
mysql-test/r/func_test.result
+6
-0
mysql-test/t/func_test.test
mysql-test/t/func_test.test
+8
-0
sql/item_func.cc
sql/item_func.cc
+2
-0
No files found.
mysql-test/r/func_test.result
View file @
a70ae437
...
...
@@ -165,3 +165,9 @@ SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1
rank rank rank
2 2 NULL
DROP TABLE t1,t2;
CREATE TABLE t1 (d varchar(6), k int);
INSERT INTO t1 VALUES (NULL, 2);
SELECT GREATEST(d,d) FROM t1 WHERE k=2;
GREATEST(d,d)
NULL
DROP TABLE t1;
mysql-test/t/func_test.test
View file @
a70ae437
...
...
@@ -85,3 +85,11 @@ CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20
INSERT
INTO
t2
VALUES
(
1
,
'Everyone'
,
2
),(
2
,
'Help'
,
3
),(
3
,
'Customer Support'
,
1
);
SELECT
f_acc
.
rank
,
a1
.
rank
,
a2
.
rank
FROM
t1
LEFT
JOIN
t1
f1
ON
(
f1
.
access_id
=
1
AND
f1
.
faq_group_id
=
t1
.
faq_group_id
)
LEFT
JOIN
t2
a1
ON
(
a1
.
access_id
=
f1
.
access_id
)
LEFT
JOIN
t1
f2
ON
(
f2
.
access_id
=
3
AND
f2
.
faq_group_id
=
t1
.
faq_group_id
)
LEFT
JOIN
t2
a2
ON
(
a2
.
access_id
=
f2
.
access_id
),
t2
f_acc
WHERE
LEAST
(
a1
.
rank
,
a2
.
rank
)
=
f_acc
.
rank
;
DROP
TABLE
t1
,
t2
;
#
# Test for GREATEST() and LEAST() bug, which segfaulted 4.1.1 server
#
CREATE
TABLE
t1
(
d
varchar
(
6
),
k
int
);
INSERT
INTO
t1
VALUES
(
NULL
,
2
);
SELECT
GREATEST
(
d
,
d
)
FROM
t1
WHERE
k
=
2
;
DROP
TABLE
t1
;
sql/item_func.cc
View file @
a70ae437
...
...
@@ -1068,6 +1068,8 @@ String *Item_func_min_max::val_str(String *str)
}
}
}
if
(
!
res
)
// If NULL
return
0
;
res
->
set_charset
(
collation
.
collation
);
return
res
;
}
...
...
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