diff options
author | serg@serg.mylan <> | 2004-04-06 21:35:26 +0200 |
---|---|---|
committer | serg@serg.mylan <> | 2004-04-06 21:35:26 +0200 |
commit | e8eda8129f4dfb4128a3392a70f055aa04797ba9 (patch) | |
tree | 49936e67024c8911d22de045aa8314e5f88d506b /sql/field.h | |
parent | 83f6f4a05ccab146830a92f1859d20d92f5ad4e6 (diff) | |
download | mariadb-git-e8eda8129f4dfb4128a3392a70f055aa04797ba9.tar.gz |
::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
Field::val_str simplification, comment
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h index 75bb96f2f6d..e6188d43f57 100644 --- a/sql/field.h +++ b/sql/field.h @@ -98,6 +98,18 @@ public: virtual void store_time(TIME *ltime,timestamp_type t_type); virtual double val_real(void)=0; virtual longlong val_int(void)=0; + String *val_str(String *str) { return val_str(str, str); } + /* val_str(buf1, buf2) gets two buffers and should use them as follows: + if it needs a temp buffer to convert result to string - use buf1 + example Field_tiny::val_str() + if the value exists as a string already - use buf2 + example Field_string::val_str() + consequently, buf2 may be created as 'String buf;' - no memory + will be allocated for it. buf1 will be allocated to hold a + value if it's too small. Using allocated buffer for buf2 may result in + an unnecessary free (and later, may be an alloc). + This trickery is used to decrease a number of malloc calls. + */ virtual String *val_str(String*,String *)=0; virtual Item_result result_type () const=0; virtual Item_result cmp_type () const { return result_type(); } |