diff options
author | igor@igor-inspiron.creware.com <> | 2005-06-13 06:10:19 -0700 |
---|---|---|
committer | igor@igor-inspiron.creware.com <> | 2005-06-13 06:10:19 -0700 |
commit | 750fca61f9f0aa8830e583a8d84f60f14a4e76aa (patch) | |
tree | e65e709e34df00878a6743e82b3008035aaf8daa /sql/sql_select.cc | |
parent | a3e72ec85ae4f94b7dd179007d7dabeba15eb87e (diff) | |
download | mariadb-git-750fca61f9f0aa8830e583a8d84f60f14a4e76aa.tar.gz |
ctype_utf8.test, ctype_utf8.result:
Added a test case for bug #11167.
sql_select.cc:
Fixed bug #11167.
In 4.1 char/varchar fields are limited by 255 characters in
length that make them longer than 255 bytes in size for such
character sets as UTF8. The functions store_record_in_cache
and read_cached_records did not take into account this
Moreover the code did not take into account that the size
of the varchar fields in 5.0 can be up to 65535 bytes
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5b1603b44e2..2cb650cda2a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8112,9 +8112,9 @@ store_record_in_cache(JOIN_CACHE *cache) end > str && end[-1] == ' ' ; end--) ; length=(uint) (end-str); - memcpy(pos+1,str,length); - *pos=(uchar) length; - pos+=length+1; + memcpy(pos+sizeof(uint), str, length); + *((uint *) pos)= length; + pos+= length+sizeof(uint); } else { @@ -8177,9 +8177,9 @@ read_cached_record(JOIN_TAB *tab) { if (copy->strip) { - memcpy(copy->str,pos+1,length=(uint) *pos); - memset(copy->str+length,' ',copy->length-length); - pos+=1+length; + memcpy(copy->str, pos+sizeof(uint), length= *((uint *) pos)); + memset(copy->str+length, ' ', copy->length-length); + pos+= sizeof(uint)+length; } else { |