diff options
author | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-05-17 16:29:52 +0500 |
---|---|---|
committer | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-05-17 16:29:52 +0500 |
commit | 8bee96ab0ad02e45bb4652f6878173d030642051 (patch) | |
tree | e4f1191a52998c24839a96bb95784af36d1f03d0 /sql/sql_string.h | |
parent | b043f06666c278a4277e7d35b1bff418d45708c2 (diff) | |
download | mariadb-git-8bee96ab0ad02e45bb4652f6878173d030642051.tar.gz |
Now string values are created and filled with charset field
SELECT func(charset2) FROM t ORDER BY 1 works in correct charset
Diffstat (limited to 'sql/sql_string.h')
-rw-r--r-- | sql/sql_string.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sql/sql_string.h b/sql/sql_string.h index 9bf13b93628..68c5e005782 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -46,22 +46,21 @@ public: String(uint32 length_arg) { alloced=0; Alloced_length=0; (void) real_alloc(length_arg); - str_charset=default_charset_info; } - String(const char *str) + String(const char *str, CHARSET_INFO *cs) { Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0; - str_charset=default_charset_info; + str_charset=cs; } - String(const char *str,uint32 len) + String(const char *str,uint32 len, CHARSET_INFO *cs) { Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0; - str_charset=default_charset_info; + str_charset=cs; } - String(char *str,uint32 len) + String(char *str,uint32 len, CHARSET_INFO *cs) { Ptr=(char*) str; Alloced_length=str_length=len; alloced=0; - str_charset=default_charset_info; + str_charset=cs; } String(const String &str) { @@ -103,23 +102,27 @@ public: Alloced_length=str.Alloced_length-offset; else Alloced_length=0; + str_charset=str.str_charset; } - inline void set(char *str,uint32 arg_length) + inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs) { free(); Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0; + str_charset=cs; } - inline void set(const char *str,uint32 arg_length) + inline void set(const char *str,uint32 arg_length, CHARSET_INFO *cs) { free(); Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0; + str_charset=cs; } - inline void set_quick(char *str,uint32 arg_length) + inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs) { if (!alloced) { Ptr=(char*) str; str_length=Alloced_length=arg_length; } + str_charset=cs; } bool set(longlong num); /* bool set(long num); */ |