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
5e57a1ae
Commit
5e57a1ae
authored
Oct 25, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Add the function dtype_is_utf8().
parent
2eb32d30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
include/data0type.h
include/data0type.h
+10
-0
include/data0type.ic
include/data0type.ic
+25
-0
No files found.
include/data0type.h
View file @
5e57a1ae
...
...
@@ -275,6 +275,16 @@ dtype_form_prtype(
DATA_BINARY_TYPE etc. */
ulint
charset_coll
);
/* in: MySQL charset-collation code */
/*************************************************************************
Determines if a MySQL string type is a subset of UTF-8. This function
may return false negatives, in case further character-set collation
codes are introduced in MySQL later. */
UNIV_INLINE
ibool
dtype_is_utf8
(
/*==========*/
/* out: TRUE if a subset of UTF-8 */
ulint
prtype
);
/* in: precise data type */
/*************************************************************************
Gets the type length. */
UNIV_INLINE
ulint
...
...
include/data0type.ic
View file @
5e57a1ae
...
...
@@ -34,6 +34,31 @@ dtype_get_charset_coll(
return((prtype >> 16) & 0xFFUL);
}
/*************************************************************************
Determines if a MySQL string type is a subset of UTF-8. This function
may return false negatives, in case further character-set collation
codes are introduced in MySQL later. */
UNIV_INLINE
ibool
dtype_is_utf8(
/*==========*/
/* out: TRUE if a subset of UTF-8 */
ulint prtype) /* in: precise data type */
{
/* These codes have been copied from strings/ctype-extra.c
and strings/ctype-utf8.c. */
switch (dtype_get_charset_coll(prtype)) {
case 11: /* ascii_general_ci */
case 65: /* ascii_bin */
case 33: /* utf8_general_ci */
case 83: /* utf8_bin */
case 254: /* utf8_general_cs */
return(TRUE);
}
return(FALSE);
}
/*************************************************************************
Gets the MySQL type code from a dtype. */
UNIV_INLINE
...
...
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