Loading include/m_ctype.h +6 −3 Original line number Diff line number Diff line Loading @@ -147,7 +147,8 @@ typedef struct my_charset_handler_st uint (*numchars)(struct charset_info_st *, const char *b, const char *e); uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos); uint (*well_formed_len)(struct charset_info_st *, const char *b,const char *e, uint nchars); const char *b,const char *e, uint nchars, int *error); uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length); uint (*numcells)(struct charset_info_st *, const char *b, const char *e); Loading Loading @@ -341,7 +342,8 @@ int my_wildcmp_8bit(CHARSET_INFO *, uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos, int *error); int my_mbcharlen_8bit(CHARSET_INFO *, uint c); Loading @@ -359,7 +361,8 @@ int my_wildcmp_mb(CHARSET_INFO *, uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos, int *error); uint my_instr_mb(struct charset_info_st *, const char *b, uint b_length, const char *s, uint s_length, Loading ndb/src/ndbapi/NdbIndexOperation.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -354,12 +354,14 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, *************************************************************************/ if ((tOpType == WriteRequest)) { if (!tAttrInfo->m_indexOnly){ int dummy_error; // invalid data can crash kernel if (cs != NULL && (*cs->cset->well_formed_len)(cs, aValueToWrite, aValueToWrite + sizeInBytes, sizeInBytes) != sizeInBytes) sizeInBytes, &dummy_error) != sizeInBytes) goto equal_error4; Uint32 ahValue; Uint32 sz = totalSizeInWords; Loading ndb/src/ndbapi/NdbOperationDefine.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -526,6 +526,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, const Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize; CHARSET_INFO* cs = tAttrInfo->m_cs; int dummy_error; // invalid data can crash kernel if (cs != NULL && // fast fix bug#7340 Loading @@ -533,7 +534,8 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, (*cs->cset->well_formed_len)(cs, aValue, aValue + sizeInBytes, sizeInBytes) != sizeInBytes) { sizeInBytes, &dummy_error) != sizeInBytes) { setErrorCodeAbort(744); return -1; } Loading ndb/src/ndbapi/NdbOperationSearch.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -226,12 +226,14 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, if ((tOpType == InsertRequest) || (tOpType == WriteRequest)) { if (!tAttrInfo->m_indexOnly){ int dummy_error; // invalid data can crash kernel if (cs != NULL && (*cs->cset->well_formed_len)(cs, aValueToWrite, aValueToWrite + sizeInBytes, sizeInBytes) != sizeInBytes) sizeInBytes, &dummy_error) != sizeInBytes) goto equal_error4; Uint32 ahValue; const Uint32 sz = totalSizeInWords; Loading sql/field.cc +8 −7 Original line number Diff line number Diff line Loading @@ -4941,7 +4941,8 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) copy_length= field_charset->cset->well_formed_len(field_charset, from,from+length, field_length/ field_charset->mbmaxlen); field_charset->mbmaxlen, &error); memcpy(ptr,from,copy_length); if (copy_length < field_length) // Append spaces if shorter field_charset->cset->fill(field_charset,ptr+copy_length, Loading @@ -4958,7 +4959,6 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) } if (error) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); return error; } Loading Loading @@ -5579,7 +5579,8 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) copy_length= field_charset->cset->well_formed_len(field_charset, from,from + min(length, copy_length), copy_length); copy_length, &error); if (copy_length < length) error= 1; Field_blob::store_length(copy_length); Loading Loading
include/m_ctype.h +6 −3 Original line number Diff line number Diff line Loading @@ -147,7 +147,8 @@ typedef struct my_charset_handler_st uint (*numchars)(struct charset_info_st *, const char *b, const char *e); uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos); uint (*well_formed_len)(struct charset_info_st *, const char *b,const char *e, uint nchars); const char *b,const char *e, uint nchars, int *error); uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length); uint (*numcells)(struct charset_info_st *, const char *b, const char *e); Loading Loading @@ -341,7 +342,8 @@ int my_wildcmp_8bit(CHARSET_INFO *, uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos, int *error); int my_mbcharlen_8bit(CHARSET_INFO *, uint c); Loading @@ -359,7 +361,8 @@ int my_wildcmp_mb(CHARSET_INFO *, uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos, int *error); uint my_instr_mb(struct charset_info_st *, const char *b, uint b_length, const char *s, uint s_length, Loading
ndb/src/ndbapi/NdbIndexOperation.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -354,12 +354,14 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, *************************************************************************/ if ((tOpType == WriteRequest)) { if (!tAttrInfo->m_indexOnly){ int dummy_error; // invalid data can crash kernel if (cs != NULL && (*cs->cset->well_formed_len)(cs, aValueToWrite, aValueToWrite + sizeInBytes, sizeInBytes) != sizeInBytes) sizeInBytes, &dummy_error) != sizeInBytes) goto equal_error4; Uint32 ahValue; Uint32 sz = totalSizeInWords; Loading
ndb/src/ndbapi/NdbOperationDefine.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -526,6 +526,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, const Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize; CHARSET_INFO* cs = tAttrInfo->m_cs; int dummy_error; // invalid data can crash kernel if (cs != NULL && // fast fix bug#7340 Loading @@ -533,7 +534,8 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, (*cs->cset->well_formed_len)(cs, aValue, aValue + sizeInBytes, sizeInBytes) != sizeInBytes) { sizeInBytes, &dummy_error) != sizeInBytes) { setErrorCodeAbort(744); return -1; } Loading
ndb/src/ndbapi/NdbOperationSearch.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -226,12 +226,14 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, if ((tOpType == InsertRequest) || (tOpType == WriteRequest)) { if (!tAttrInfo->m_indexOnly){ int dummy_error; // invalid data can crash kernel if (cs != NULL && (*cs->cset->well_formed_len)(cs, aValueToWrite, aValueToWrite + sizeInBytes, sizeInBytes) != sizeInBytes) sizeInBytes, &dummy_error) != sizeInBytes) goto equal_error4; Uint32 ahValue; const Uint32 sz = totalSizeInWords; Loading
sql/field.cc +8 −7 Original line number Diff line number Diff line Loading @@ -4941,7 +4941,8 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) copy_length= field_charset->cset->well_formed_len(field_charset, from,from+length, field_length/ field_charset->mbmaxlen); field_charset->mbmaxlen, &error); memcpy(ptr,from,copy_length); if (copy_length < field_length) // Append spaces if shorter field_charset->cset->fill(field_charset,ptr+copy_length, Loading @@ -4958,7 +4959,6 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) } if (error) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); return error; } Loading Loading @@ -5579,7 +5579,8 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) copy_length= field_charset->cset->well_formed_len(field_charset, from,from + min(length, copy_length), copy_length); copy_length, &error); if (copy_length < length) error= 1; Field_blob::store_length(copy_length); Loading