summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2000-11-15 23:00:06 +0200
committerunknown <monty@narttu.mysql.fi>2000-11-15 23:00:06 +0200
commit9a846a52ae62f701c2d54d3f468e2ead393acf91 (patch)
tree622092bf596b26a1f762020729c03d573a5b216d /sql/sql_string.cc
parentf3d2341f1f30384d92b285c1e421d8c599ee2b79 (diff)
downloadmariadb-git-9a846a52ae62f701c2d54d3f468e2ead393acf91.tar.gz
changed to use IO_CACHE instead of FILE
BitKeeper/deleted/.del-mf_reccache.c: ***MISSING WEAVE*** Docs/manual.texi: Fix licence information + update changelog client/mysqlimport.c: Fixed typo client/sql_string.cc: Added support for IO_CACHE client/sql_string.h: Added support for IO_CACHE include/my_sys.h: More options for IO_CACHE mysql.proj: Update mysys/Makefile.am: Remoced mf_reccache.c mysys/mf_cache.c: Fixed return value on error and optimzed used of write cache files mysys/mf_iocache.c: More options for IO_CACHE mysys/my_vsnprintf.c: Optimized code sql/mf_iocache.cc: merge with mf_iocache.c sql/net_pkg.cc: cleanup sql/sql_class.cc: Support for transaction safe log files sql/sql_string.cc: Added support for IO_CACHE sql/sql_string.h: Added support for IO_CACHE sql/time.cc: cleanup BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 7ca2d3c419e..4b9ebef21f1 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -95,17 +95,6 @@ bool String::realloc(uint32 alloc_length)
return FALSE;
}
-
-#ifdef NOT_NEEDED
-bool String::set(long num)
-{
- if (alloc(14))
- return TRUE;
- str_length=(uint32) (int10_to_str(num,Ptr,-10)-Ptr);
- return FALSE;
-}
-#endif
-
bool String::set(longlong num)
{
if (alloc(21))
@@ -274,6 +263,7 @@ bool String::append(const char *s,uint32 arg_length)
return FALSE;
}
+#ifdef TO_BE_REMOVED
bool String::append(FILE* file, uint32 arg_length, myf my_flags)
{
if (realloc(str_length+arg_length))
@@ -286,6 +276,20 @@ bool String::append(FILE* file, uint32 arg_length, myf my_flags)
str_length+=arg_length;
return FALSE;
}
+#endif
+
+bool String::append(IO_CACHE* file, uint32 arg_length)
+{
+ if (realloc(str_length+arg_length))
+ return TRUE;
+ if (my_b_read(file, (byte*) Ptr + str_length, arg_length))
+ {
+ shrink(str_length);
+ return TRUE;
+ }
+ str_length+=arg_length;
+ return FALSE;
+}
uint32 String::numchars()
{