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
69b90fb2
Commit
69b90fb2
authored
Apr 25, 2006
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@lsmy3:/data/users/bk/mysql-5.0-opt-bugs
into moonbone.local:/work/18739-bug-5.0-mysql
parents
3c06a20b
eb53a5b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
5 deletions
+39
-5
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+1
-1
mysql-test/r/case.result
mysql-test/r/case.result
+8
-0
mysql-test/t/case.test
mysql-test/t/case.test
+11
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+19
-4
No files found.
mysql-test/mysql-test-run.pl
View file @
69b90fb2
...
@@ -3302,7 +3302,7 @@ sub valgrind_arguments {
...
@@ -3302,7 +3302,7 @@ sub valgrind_arguments {
if
(
$opt_valgrind_options
)
if
(
$opt_valgrind_options
)
{
{
mtr_add_arg
(
$args
,
split
('
',
$opt_valgrind_options
));
mtr_add_arg
(
$args
,
'
%s
',
$_
)
for
(
split
('
',
$opt_valgrind_options
));
}
}
...
...
mysql-test/r/case.result
View file @
69b90fb2
...
@@ -175,6 +175,14 @@ SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
...
@@ -175,6 +175,14 @@ SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
case+union+test
case+union+test
case+union+test
case+union+test
nobug
nobug
create table t1(a float, b int default 3);
insert into t1 (a) values (2), (11), (8);
select min(a), min(case when 1=1 then a else NULL end),
min(case when 1!=1 then NULL else a end)
from t1 where b=3 group by b;
min(a) min(case when 1=1 then a else NULL end) min(case when 1!=1 then NULL else a end)
2 2 2
drop table t1;
CREATE TABLE t1 (EMPNUM INT);
CREATE TABLE t1 (EMPNUM INT);
INSERT INTO t1 VALUES (0), (2);
INSERT INTO t1 VALUES (0), (2);
CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));
CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));
...
...
mysql-test/t/case.test
View file @
69b90fb2
...
@@ -122,6 +122,17 @@ SELECT 'case+union+test'
...
@@ -122,6 +122,17 @@ SELECT 'case+union+test'
UNION
UNION
SELECT
CASE
'1'
WHEN
'2'
THEN
'BUG'
ELSE
'nobug'
END
;
SELECT
CASE
'1'
WHEN
'2'
THEN
'BUG'
ELSE
'nobug'
END
;
#
# Bug #17896: problem with MIN(CASE...)
#
create
table
t1
(
a
float
,
b
int
default
3
);
insert
into
t1
(
a
)
values
(
2
),
(
11
),
(
8
);
select
min
(
a
),
min
(
case
when
1
=
1
then
a
else
NULL
end
),
min
(
case
when
1
!=
1
then
NULL
else
a
end
)
from
t1
where
b
=
3
group
by
b
;
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
...
...
sql/item_cmpfunc.cc
View file @
69b90fb2
...
@@ -41,10 +41,25 @@ static Item_result item_store_type(Item_result a,Item_result b)
...
@@ -41,10 +41,25 @@ static Item_result item_store_type(Item_result a,Item_result b)
static
void
agg_result_type
(
Item_result
*
type
,
Item
**
items
,
uint
nitems
)
static
void
agg_result_type
(
Item_result
*
type
,
Item
**
items
,
uint
nitems
)
{
{
uint
i
;
Item
**
item
,
**
item_end
;
type
[
0
]
=
items
[
0
]
->
result_type
();
for
(
i
=
1
;
i
<
nitems
;
i
++
)
*
type
=
STRING_RESULT
;
type
[
0
]
=
item_store_type
(
type
[
0
],
items
[
i
]
->
result_type
());
/* Skip beginning NULL items */
for
(
item
=
items
,
item_end
=
item
+
nitems
;
item
<
item_end
;
item
++
)
{
if
((
*
item
)
->
type
()
!=
Item
::
NULL_ITEM
)
{
*
type
=
(
*
item
)
->
result_type
();
item
++
;
break
;
}
}
/* Combine result types. Note: NULL items don't affect the result */
for
(;
item
<
item_end
;
item
++
)
{
if
((
*
item
)
->
type
()
!=
Item
::
NULL_ITEM
)
*
type
=
item_store_type
(
type
[
0
],
(
*
item
)
->
result_type
());
}
}
}
...
...
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