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
9a99ac89
Commit
9a99ac89
authored
Jan 08, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New function to search for charset using charset name rather than collation name
parent
ba8a9d41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
include/my_sys.h
include/my_sys.h
+1
-0
mysys/charset.c
mysys/charset.c
+30
-9
No files found.
include/my_sys.h
View file @
9a99ac89
...
...
@@ -206,6 +206,7 @@ extern const char *get_charset_name(uint cs_number);
extern
CHARSET_INFO
*
get_charset
(
uint
cs_number
,
myf
flags
);
extern
my_bool
set_default_charset
(
uint
cs
,
myf
flags
);
extern
CHARSET_INFO
*
get_charset_by_name
(
const
char
*
cs_name
,
myf
flags
);
extern
CHARSET_INFO
*
get_charset_by_csname
(
const
char
*
cs_name
,
myf
flags
);
extern
my_bool
set_default_charset_by_name
(
const
char
*
cs_name
,
myf
flags
);
extern
void
free_charsets
(
void
);
extern
char
*
list_charsets
(
myf
want_flags
);
/* my_free() this string... */
...
...
mysys/charset.c
View file @
9a99ac89
...
...
@@ -615,14 +615,6 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
}
static
CHARSET_INFO
*
get_internal_charset_by_name
(
const
char
*
name
,
myf
flags
)
{
uint
cs_number
=
get_charset_number
(
name
);
return
cs_number
?
get_internal_charset
(
cs_number
,
flags
)
:
NULL
;
}
CHARSET_INFO
*
get_charset
(
uint
cs_number
,
myf
flags
)
{
CHARSET_INFO
*
cs
;
...
...
@@ -664,10 +656,39 @@ my_bool set_default_charset(uint cs, myf flags)
CHARSET_INFO
*
get_charset_by_name
(
const
char
*
cs_name
,
myf
flags
)
{
uint
cs_number
;
CHARSET_INFO
*
cs
;
(
void
)
init_available_charsets
(
MYF
(
0
));
/* If it isn't initialized */
cs
=
get_internal_charset_by_name
(
cs_name
,
flags
);
cs_number
=
get_charset_number
(
cs_name
);
cs
=
cs_number
?
get_internal_charset
(
cs_number
,
flags
)
:
NULL
;
if
(
!
cs
&&
(
flags
&
MY_WME
))
{
char
index_file
[
FN_REFLEN
];
strmov
(
get_charsets_dir
(
index_file
),
MY_CHARSET_INDEX
);
my_error
(
EE_UNKNOWN_CHARSET
,
MYF
(
ME_BELL
),
cs_name
,
index_file
);
}
return
cs
;
}
CHARSET_INFO
*
get_charset_by_csname
(
const
char
*
cs_name
,
myf
flags
)
{
CHARSET_INFO
*
cs
=
NULL
;
CHARSET_INFO
**
css
;
(
void
)
init_available_charsets
(
MYF
(
0
));
/* If it isn't initialized */
for
(
css
=
all_charsets
;
css
<
all_charsets
+
255
;
++
css
)
{
if
(
css
[
0
]
&&
css
[
0
]
->
csname
&&
!
strcmp
(
css
[
0
]
->
csname
,
cs_name
))
{
cs
=
css
[
0
]
->
number
?
get_internal_charset
(
css
[
0
]
->
number
,
flags
)
:
NULL
;
break
;
}
}
if
(
!
cs
&&
(
flags
&
MY_WME
))
{
char
index_file
[
FN_REFLEN
];
...
...
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