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
e99bc0d1
Commit
e99bc0d1
authored
Aug 14, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing unused String_copier::copy_fix.
Fixing misleading comments in String_copiers::well_formed_copy().
parent
0750b2df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
35 deletions
+2
-35
sql/sql_string.cc
sql/sql_string.cc
+1
-7
sql/sql_string.h
sql/sql_string.h
+1
-28
No files found.
sql/sql_string.cc
View file @
e99bc0d1
...
...
@@ -879,13 +879,7 @@ my_copy_with_hex_escaping(CHARSET_INFO *cs,
with optional character set conversion,
with optional left padding (for binary -> UCS2 conversion)
In case if there is a Unicode conversion (i.e. to_cs and from_cs are
different character sets and both are not &my_charset_bin), bad input bytes
as well as characters that cannot be encoded in to_cs are replaced to '?'.
In case of non-Unicode copying (i.e. to_cs and from_cs are same character set,
or from_cs is &my_charset_bin), the function stops on the first bad
byte sequence.
Bad input bytes are replaced to '?'.
The string that is written to "to" is always well-formed.
...
...
sql/sql_string.h
View file @
e99bc0d1
...
...
@@ -69,8 +69,7 @@ class String_copier: private MY_STRCONV_STATUS
srccs
,
src
,
src_length
,
nchars
,
this
);
}
/*
Copy a string. Fix bad bytes/characters one Unicode conversion,
break on bad bytes in case of non-Unicode copying.
Copy a string. Fix bad bytes/characters to '?'.
*/
uint
well_formed_copy
(
CHARSET_INFO
*
to_cs
,
char
*
to
,
uint
to_length
,
CHARSET_INFO
*
from_cs
,
const
char
*
from
,
...
...
@@ -84,32 +83,6 @@ class String_copier: private MY_STRCONV_STATUS
from_cs
,
from
,
from_length
,
from_length
/* No limit on "nchars"*/
);
}
/*
Copy a string. If a bad byte sequence is found in case of non-Unicode
copying, continues processing and replaces bad bytes to '?'.
*/
uint
copy_fix
(
CHARSET_INFO
*
to_cs
,
char
*
to
,
uint
to_length
,
CHARSET_INFO
*
from_cs
,
const
char
*
from
,
uint
from_length
)
{
uint
length
=
well_formed_copy
(
to_cs
,
to
,
to_length
,
from_cs
,
from
,
from_length
,
from_length
/* No limit on nchars */
);
if
(
well_formed_error_pos
()
&&
source_end_pos
()
<
from
+
from_length
)
{
/*
There was an error and there are still some bytes in the source string.
This is possible if there were no character set conversion and a
malformed byte sequence was found. Copy the rest and replace bad
bytes to '?'. Note: m_source_end_pos is not updated!!!
*/
uint
dummy_errors
;
length
+=
copy_and_convert
(
to
+
length
,
to_length
-
length
,
to_cs
,
source_end_pos
(),
from_length
-
(
source_end_pos
()
-
from
),
from_cs
,
&
dummy_errors
);
}
return
length
;
}
};
...
...
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