Commit e9ff6fbd authored by unknown's avatar unknown

field.cc:

  tis620 normalization will be implemented ad a SQL function, without automatic normalization on INSERT


sql/field.cc:
  tis620 normalization will be implemented ad a SQL function, without automatic normalization on INSERT
parent e7660c64
...@@ -3878,14 +3878,6 @@ void Field_datetime::sql_type(String &res) const ...@@ -3878,14 +3878,6 @@ void Field_datetime::sql_type(String &res) const
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
{ {
int error= 0; int error= 0;
#ifdef USE_TIS620
if (!binary()) {
ThNormalize((uchar *)ptr, field_length, (uchar *)from, length);
if (length < field_length) {
bfill(ptr + length, field_length - length, ' ');
}
}
#else
if (length <= field_length) if (length <= field_length)
{ {
memcpy(ptr,from,length); memcpy(ptr,from,length);
...@@ -3909,7 +3901,6 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) ...@@ -3909,7 +3901,6 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
} }
} }
} }
#endif /* USE_TIS620 */
return error; return error;
} }
...@@ -4062,12 +4053,6 @@ uint Field_string::max_packed_col_length(uint max_length) ...@@ -4062,12 +4053,6 @@ uint Field_string::max_packed_col_length(uint max_length)
int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
{ {
int error= 0; int error= 0;
#ifdef USE_TIS620
if (!binary())
{
ThNormalize((uchar *) ptr+2, field_length, (uchar *) from, length);
}
#else
if (length > field_length) if (length > field_length)
{ {
length=field_length; length=field_length;
...@@ -4075,7 +4060,6 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) ...@@ -4075,7 +4060,6 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
error= 1; error= 1;
} }
memcpy(ptr+2,from,length); memcpy(ptr+2,from,length);
#endif /* USE_TIS620 */
int2store(ptr, length); int2store(ptr, length);
return error; return error;
} }
...@@ -4376,28 +4360,11 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs) ...@@ -4376,28 +4360,11 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
} }
else else
{ {
#ifdef USE_TIS620
char *th_ptr=0;
#endif
Field_blob::store_length(len); Field_blob::store_length(len);
if (table->copy_blobs || len <= MAX_FIELD_WIDTH) if (table->copy_blobs || len <= MAX_FIELD_WIDTH)
{ // Must make a copy { // Must make a copy
#ifdef USE_TIS620
if (!binary())
{
/* If there isn't enough memory, use original string */
if ((th_ptr=(char * ) my_malloc(sizeof(char) * len,MYF(0))))
{
ThNormalize((uchar *) th_ptr, len, (uchar *) from, len);
from= (const char*) th_ptr;
}
}
#endif /* USE_TIS620 */
value.copy(from,len,charset()); value.copy(from,len,charset());
from=value.ptr(); from=value.ptr();
#ifdef USE_TIS620
my_free(th_ptr,MYF(MY_ALLOW_ZERO_PTR));
#endif
} }
bmove(ptr+packlength,(char*) &from,sizeof(char*)); bmove(ptr+packlength,(char*) &from,sizeof(char*));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment