summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-17 01:35:17 +0200
committerunknown <monty@mysql.com>2004-02-17 01:35:17 +0200
commitf9976eb1cd69b66bd1ac16a90f96fb222207c8c8 (patch)
tree7e3324032ecc97c6af3771a6904e8ae32dbf7a48 /sql/field.cc
parentcad7f2a155c26fe2477a104284a4db59470ae694 (diff)
downloadmariadb-git-f9976eb1cd69b66bd1ac16a90f96fb222207c8c8.tar.gz
Changed wellformedlen to well_formed_len
Fixed that blobs >16M can be inserted/updated Fixed bug when doing CREATE TEMPORARY TABLE ... LIKE include/m_ctype.h: Changed wellformedlen to well_formed_len include/mysql.h: Fixed comment libmysql/libmysql.c: Fixed indentation libmysqld/lib_sql.cc: Fixed indentation mysql-test/r/ctype_utf8.result: updated warning numbers mysql-test/r/innodb.result: Moved test to right place mysql-test/r/myisam-blob.result: More test for blobs mysql-test/r/rpl000002.result: Move test to better place mysql-test/r/rpl_log.result: Move test to better place mysql-test/r/union.result: Move test to better place mysql-test/t/innodb.test: Moved test to right place mysql-test/t/myisam-blob.test: More test of blobs mysql-test/t/rpl000002.test: Move test to better place mysql-test/t/rpl_log.test: Move test to better place mysql-test/t/union.test: Move test to better place sql/field.cc: Changed wellformedlen to well_formed_len. Fixed that blobs >16M can be inserted/updated (new bug) sql/field.h: Code optimization sql/sql_lex.cc: Changed short variable names sql/sql_show.cc: Optimized quote handling sql/sql_table.cc: Fixed bug when doing CREATE TEMPORARY TABLE ... LIKE sql/sql_union.cc: Added comment strings/ctype-big5.c: Changed wellformedlen to well_formed_len strings/ctype-bin.c: Changed wellformedlen to well_formed_len strings/ctype-euc_kr.c: Changed wellformedlen to well_formed_len strings/ctype-gb2312.c: Changed wellformedlen to well_formed_len strings/ctype-gbk.c: Changed wellformedlen to well_formed_len strings/ctype-latin1.c: Changed wellformedlen to well_formed_len strings/ctype-mb.c: Changed wellformedlen to well_formed_len strings/ctype-simple.c: Changed wellformedlen to well_formed_len strings/ctype-sjis.c: Changed wellformedlen to well_formed_len strings/ctype-tis620.c: Changed wellformedlen to well_formed_len strings/ctype-ucs2.c: Changed wellformedlen to well_formed_len Indentation changes strings/ctype-ujis.c: Changed wellformedlen to well_formed_len strings/ctype-utf8.c: Changed wellformedlen to well_formed_len
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 1e926c0926e..4632fbc5c69 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4075,10 +4075,10 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
Make sure we don't break a multibyte sequence
as well as don't copy a malformed data.
*/
- copy_length= field_charset->cset->wellformedlen(field_charset,
- from,from+length,
- field_length/
- field_charset->mbmaxlen);
+ copy_length= field_charset->cset->well_formed_len(field_charset,
+ from,from+length,
+ field_length/
+ field_charset->mbmaxlen);
memcpy(ptr,from,copy_length);
if (copy_length < field_length) // Append spaces if shorter
field_charset->cset->fill(field_charset,ptr+copy_length,
@@ -4571,11 +4571,15 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
}
copy_length= max_data_length();
- if (copy_length > length)
- copy_length= length;
- copy_length= field_charset->cset->wellformedlen(field_charset,
- from,from+copy_length,
- field_length);
+ /*
+ copy_length is ok as last argument to well_formed_len as this is never
+ used to limit the length of the data. The cut of long data is done with
+ the 'min()' call below.
+ */
+ copy_length= field_charset->cset->well_formed_len(field_charset,
+ from,from +
+ min(length, copy_length),
+ copy_length);
if (copy_length < length)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);