Updates for multi-byte character sets

(Note: test 'union' fails, but Sanja promised to fix this)


include/m_ctype.h:
  Changed prototype for strntod() to inform the user that source may be modified.
include/m_string.h:
  Moved my_vsnprintf to strings library
include/my_sys.h:
  Moved my_vsnprintf to strings library
libmysql/Makefile.shared:
  Moved my_vsnprintf to strings library
mysql-test/r/alter_table.result:
  Moved my_vsnprintf to strings library
mysql-test/r/create.result:
  Moved my_vsnprintf to strings library
mysql-test/r/ctype_many.result:
  Moved my_vsnprintf to strings library
mysql-test/r/fulltext.result:
  Moved my_vsnprintf to strings library
mysql-test/r/innodb.result:
  Moved my_vsnprintf to strings library
mysql-test/r/merge.result:
  Moved my_vsnprintf to strings library
mysql-test/r/select.result:
  Moved my_vsnprintf to strings library
mysql-test/r/show_check.result:
  Moved my_vsnprintf to strings library
mysql-test/r/type_blob.result:
  Moved my_vsnprintf to strings library
mysql-test/r/type_enum.result:
  Moved my_vsnprintf to strings library
mysql-test/r/type_ranges.result:
  Moved my_vsnprintf to strings library
mysql-test/r/type_set.result:
  Moved my_vsnprintf to strings library
mysys/Makefile.am:
  Moved my_vsnprintf to strings library
sql/field.cc:
  Fixed for character set handling
sql/field.h:
  Fixed for character set handling
sql/item.cc:
  Fixed for character set handling
sql/item.h:
  Fixed for character set handling
sql/item_func.cc:
  Fixed for character set handling
sql/item_func.h:
  Fixed for character set handling
sql/item_strfunc.cc:
  Fixed for character set handling
sql/item_sum.cc:
  Fixed for character set handling
sql/item_sum.h:
  Fixed for character set handling
sql/item_timefunc.cc:
  Fixed for character set handling
sql/mysqld.cc:
  Update to use new test_if_int()
sql/opt_range.cc:
  Fixed for character set handling
sql/procedure.h:
  Fixed for character set handling
sql/sql_class.cc:
  Fixed for character set handling
sql/sql_string.cc:
  Added multi byte support to append.
  Added set_latin1()
sql/sql_string.h:
  Added set_latin1()
sql/sql_update.cc:
  Cosmetic changes
strings/Makefile.am:
  Moved my_vsnprintf to strings library
strings/ctype-simple.c:
  Code review + cleanup
strings/ctype-utf8.c:
  Fixed strntod()
strings/my_vsnprintf.c:
  Added support for %#d and %#u
This commit is contained in:
unknown 2003-01-14 14:28:36 +02:00
commit 910c125bb6
38 changed files with 564 additions and 489 deletions

View file

@ -2874,37 +2874,31 @@ bs:
double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *nptr, uint l, char **endptr)
char *nptr, uint length, char **endptr)
{
char buf[256];
double res;
register char *b=buf;
register const char *s=nptr;
register const char *e=nptr+l;
register const char *end;
my_wc_t wc;
int cnv;
if((l+1)>sizeof(buf))
{
if (endptr)
*endptr=(char*)nptr;
my_errno=ERANGE;
return 0;
}
while ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
/* Cut too long strings */
if (length >= sizeof(buf))
length= sizeof(buf)-1;
end=nptr+length;
while ((cnv=cs->mb_wc(cs,&wc,s,end)) > 0)
{
s+=cnv;
if (wc < 128)
{
*b++=wc;
}
else
break;
if (wc > (int) (uchar) 'e' || !wc)
break; /* Can't be part of double */
*b++=wc;
}
*b='\0';
*b= 0;
res=strtod(buf,endptr);
res=strtod(buf, endptr);
if (endptr)
*endptr=(char*) (*endptr-buf+nptr);
return res;