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
b825c16e
Commit
b825c16e
authored
Jun 23, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug10151
parents
708a31db
a1baca1d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
mysql-test/r/case.result
mysql-test/r/case.result
+15
-0
mysql-test/t/case.test
mysql-test/t/case.test
+11
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+3
-1
No files found.
mysql-test/r/case.result
View file @
b825c16e
...
@@ -154,3 +154,18 @@ t1 CREATE TABLE `t1` (
...
@@ -154,3 +154,18 @@ t1 CREATE TABLE `t1` (
`COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default ''
`COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP TABLE t1;
SELECT 'case+union+test'
UNION
SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
case+union+test
case+union+test
nobug
SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END
nobug
SELECT 'case+union+test'
UNION
SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
case+union+test
case+union+test
nobug
mysql-test/t/case.test
View file @
b825c16e
...
@@ -107,3 +107,14 @@ explain extended SELECT
...
@@ -107,3 +107,14 @@ explain extended SELECT
COALESCE
(
'a'
COLLATE
latin1_bin
,
'b'
);
COALESCE
(
'a'
COLLATE
latin1_bin
,
'b'
);
SHOW
CREATE
TABLE
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# Test for BUG#10151
SELECT
'case+union+test'
UNION
SELECT
CASE
LOWER
(
'1'
)
WHEN
LOWER
(
'2'
)
THEN
'BUG'
ELSE
'nobug'
END
;
SELECT
CASE
LOWER
(
'1'
)
WHEN
LOWER
(
'2'
)
THEN
'BUG'
ELSE
'nobug'
END
;
SELECT
'case+union+test'
UNION
SELECT
CASE
'1'
WHEN
'2'
THEN
'BUG'
ELSE
'nobug'
END
;
sql/item_cmpfunc.cc
View file @
b825c16e
...
@@ -1174,6 +1174,8 @@ Item *Item_func_case::find_item(String *str)
...
@@ -1174,6 +1174,8 @@ Item *Item_func_case::find_item(String *str)
String
*
first_expr_str
,
*
tmp
;
String
*
first_expr_str
,
*
tmp
;
longlong
first_expr_int
;
longlong
first_expr_int
;
double
first_expr_real
;
double
first_expr_real
;
char
buff
[
MAX_FIELD_WIDTH
];
String
buff_str
(
buff
,
sizeof
(
buff
),
default_charset
());
/* These will be initialized later */
/* These will be initialized later */
LINT_INIT
(
first_expr_str
);
LINT_INIT
(
first_expr_str
);
...
@@ -1186,7 +1188,7 @@ Item *Item_func_case::find_item(String *str)
...
@@ -1186,7 +1188,7 @@ Item *Item_func_case::find_item(String *str)
{
{
case
STRING_RESULT
:
case
STRING_RESULT
:
// We can't use 'str' here as this may be overwritten
// We can't use 'str' here as this may be overwritten
if
(
!
(
first_expr_str
=
args
[
first_expr_num
]
->
val_str
(
&
str_value
)))
if
(
!
(
first_expr_str
=
args
[
first_expr_num
]
->
val_str
(
&
buff_str
)))
return
else_expr_num
!=
-
1
?
args
[
else_expr_num
]
:
0
;
// Impossible
return
else_expr_num
!=
-
1
?
args
[
else_expr_num
]
:
0
;
// Impossible
break
;
break
;
case
INT_RESULT
:
case
INT_RESULT
:
...
...
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