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
b3e89e3b
Commit
b3e89e3b
authored
Mar 21, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IF() and LEAST() now honors coercibility
parent
c87303d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-2
sql/item_func.cc
sql/item_func.cc
+8
-3
No files found.
sql/item_cmpfunc.cc
View file @
b3e89e3b
...
@@ -723,8 +723,12 @@ Item_func_if::fix_length_and_dec()
...
@@ -723,8 +723,12 @@ Item_func_if::fix_length_and_dec()
else
if
(
arg1_type
==
STRING_RESULT
||
arg2_type
==
STRING_RESULT
)
else
if
(
arg1_type
==
STRING_RESULT
||
arg2_type
==
STRING_RESULT
)
{
{
cached_result_type
=
STRING_RESULT
;
cached_result_type
=
STRING_RESULT
;
set_charset
((
args
[
1
]
->
binary
()
||
args
[
2
]
->
binary
())
?
if
(
set_charset
(
args
[
1
]
->
charset
(),
args
[
1
]
->
coercibility
,
&
my_charset_bin
:
args
[
1
]
->
charset
());
args
[
2
]
->
charset
(),
args
[
2
]
->
coercibility
))
{
my_error
(
ER_WRONG_ARGUMENTS
,
MYF
(
0
),
func_name
());
return
;
}
}
}
else
else
{
{
...
@@ -760,6 +764,7 @@ Item_func_if::val_str(String *str)
...
@@ -760,6 +764,7 @@ Item_func_if::val_str(String *str)
{
{
Item
*
arg
=
args
[
0
]
->
val_int
()
?
args
[
1
]
:
args
[
2
];
Item
*
arg
=
args
[
0
]
->
val_int
()
?
args
[
1
]
:
args
[
2
];
String
*
res
=
arg
->
val_str
(
str
);
String
*
res
=
arg
->
val_str
(
str
);
res
->
set_charset
(
charset
());
null_value
=
arg
->
null_value
;
null_value
=
arg
->
null_value
;
return
res
;
return
res
;
}
}
...
...
sql/item_func.cc
View file @
b3e89e3b
...
@@ -855,9 +855,13 @@ void Item_func_min_max::fix_length_and_dec()
...
@@ -855,9 +855,13 @@ void Item_func_min_max::fix_length_and_dec()
maybe_null
=
0
;
maybe_null
=
0
;
cmp_type
=
item_cmp_type
(
cmp_type
,
args
[
i
]
->
result_type
());
cmp_type
=
item_cmp_type
(
cmp_type
,
args
[
i
]
->
result_type
());
if
(
i
==
0
)
if
(
i
==
0
)
set_charset
(
args
[
i
]
->
charset
());
set_charset
(
args
[
i
]
->
charset
(),
args
[
i
]
->
coercibility
);
else
if
(
args
[
i
]
->
charset
()
==
&
my_charset_bin
)
else
if
(
set_charset
(
charset
(),
coercibility
,
set_charset
(
&
my_charset_bin
);
args
[
i
]
->
charset
(),
args
[
i
]
->
coercibility
))
{
my_error
(
ER_WRONG_ARGUMENTS
,
MYF
(
0
),
func_name
());
break
;
}
}
}
}
}
...
@@ -909,6 +913,7 @@ String *Item_func_min_max::val_str(String *str)
...
@@ -909,6 +913,7 @@ String *Item_func_min_max::val_str(String *str)
}
}
}
}
}
}
res
->
set_charset
(
charset
());
return
res
;
return
res
;
}
}
case
ROW_RESULT
:
case
ROW_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