From afa6728a9f7c00582b3dc9e96b2dce5c4ac1e56c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Mar 2004 08:50:37 +0200 Subject: Optimized GIS functions heap/hp_delete.c: Added comments mysql-test/r/gis.result: Updated results after name changes (all results line are unchanged) mysql-test/r/show_check.result: Update test results after fix in hp_delete.cc mysql-test/t/gis.test: Changed table names to longer, hopefully non conflicting ones. Added missing drop table mysys/hash.c: Inendation cleanup mysys/tree.c: Updated comments Decrease tree->allocated on delete (for status) sql/field.cc: Added safety checking for GIS objects sql/gstream.cc: Added copyright message Made a lot of speed/space optimizations Changed class names to be MySQL compliant sql/gstream.h: Made a lot of speed/space optimizations Changed class names to be MySQL compliant sql/item_create.cc: Indentation fixup sql/item_geofunc.cc: Use new gis interface functions and new gis class names. Simple optimizations Indentation fixups Fixed a lot of unlikely but possible errors. sql/item_geofunc.h: Moved SRID_SIZE to spatial.h sql/spatial.cc: Added copyright message Made a lot of speed/space optimizations Changed class names to be MySQL compliant sql/spatial.h: Made a lot of speed/space optimizations Changed class names to be MySQL compliant Indentation fixes Use bool instead of int as result type for functions that only return 0 or 1 sql/sql_string.cc: Simple optimizations sql/sql_string.h: Simple cleanups sql/structs.h: Added LEX_STRING_WITH_INIT (needed by spatial.cc) --- sql/sql_string.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'sql/sql_string.cc') diff --git a/sql/sql_string.cc b/sql/sql_string.cc index c6eda5f9fb2..e15beac90b0 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -126,8 +126,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs) str_charset=cs; if (decimals >= NOT_FIXED_DEC) { - sprintf(buff,"%.14g",num); // Enough for a DATETIME - return copy(buff, (uint32) strlen(buff), &my_charset_latin1, cs); + uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME + return copy(buff, len, &my_charset_latin1, cs); } #ifdef HAVE_FCONVERT int decpt,sign; @@ -671,9 +671,8 @@ int String::reserve(uint32 space_needed, uint32 grow_by) return FALSE; } -void String::qs_append(const char *str) +void String::qs_append(const char *str, uint32 len) { - int len = strlen(str); memcpy(Ptr + str_length, str, len + 1); str_length += len; } @@ -681,8 +680,7 @@ void String::qs_append(const char *str) void String::qs_append(double d) { char *buff = Ptr + str_length; - sprintf(buff,"%.14g", d); - str_length += strlen(buff); + str_length+= my_sprintf(buff, (buff, "%.14g", d)); } void String::qs_append(double *d) @@ -692,12 +690,6 @@ void String::qs_append(double *d) qs_append(ld); } -void String::qs_append(const char &c) -{ - Ptr[str_length] = c; - str_length += sizeof(c); -} - /* Compare strings according to collation, without end space. -- cgit v1.2.1