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
c5b8f48c
Commit
c5b8f48c
authored
Jun 20, 2002
by
bar@gw.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New CHARSET() function
parent
44347c5a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+13
-0
sql/item_strfunc.h
sql/item_strfunc.h
+12
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-0
No files found.
sql/item_strfunc.cc
View file @
c5b8f48c
...
...
@@ -1911,12 +1911,25 @@ outp:
return
str
;
}
String
*
Item_func_charset
::
val_str
(
String
*
str
)
{
String
*
res
=
args
[
0
]
->
val_str
(
str
);
if
((
null_value
=
(
args
[
0
]
->
null_value
||
!
res
->
charset
())))
return
0
;
str
->
copy
(
res
->
charset
()
->
name
,
strlen
(
res
->
charset
()
->
name
));
return
str
;
}
void
Item_func_conv_charset3
::
fix_length_and_dec
()
{
/* BAR TODO: What to do here??? */
}
String
*
Item_func_hex
::
val_str
(
String
*
str
)
{
if
(
args
[
0
]
->
result_type
()
!=
STRING_RESULT
)
...
...
sql/item_strfunc.h
View file @
c5b8f48c
...
...
@@ -503,6 +503,18 @@ public:
const
char
*
func_name
()
const
{
return
"conv_charset3"
;
}
};
class
Item_func_charset
:
public
Item_str_func
{
public:
Item_func_charset
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
String
*
val_str
(
String
*
);
const
char
*
func_name
()
const
{
return
"charset"
;
}
void
fix_length_and_dec
()
{
max_length
=
20
;
// should be enough
};
};
/*******************************************************
Spatial functions
...
...
sql/sql_yacc.yy
View file @
c5b8f48c
...
...
@@ -1784,6 +1784,8 @@ simple_expr:
{ $$= new Item_func_atan($3,$5); }
| CHAR_SYM '(' expr_list ')'
{ $$= new Item_func_char(*$3); }
| CHARSET '(' expr ')'
{ $$= new Item_func_charset($3); }
| COALESCE '(' expr_list ')'
{ $$= new Item_func_coalesce(* $3); }
| CONCAT '(' expr_list ')'
...
...
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