The world's most popular open source database
#include <sql_string.h>
Inheritance diagram for String:


Public Member Functions | |
| String () | |
| String (uint32 length_arg) | |
| String (const char *str, CHARSET_INFO *cs) | |
| String (const char *str, uint32 len, CHARSET_INFO *cs) | |
| String (char *str, uint32 len, CHARSET_INFO *cs) | |
| String (const String &str) | |
| ~String () | |
| void | set_charset (CHARSET_INFO *charset) |
| CHARSET_INFO * | charset () const |
| uint32 | length () const |
| uint32 | alloced_length () const |
| char & | operator[] (uint32 i) const |
| void | length (uint32 len) |
| bool | is_empty () |
| const char * | ptr () const |
| char * | c_ptr () |
| char * | c_ptr_quick () |
| char * | c_ptr_safe () |
| void | set (String &str, uint32 offset, uint32 arg_length) |
| void | set (char *str, uint32 arg_length, CHARSET_INFO *cs) |
| void | set (const char *str, uint32 arg_length, CHARSET_INFO *cs) |
| bool | set_ascii (const char *str, uint32 arg_length) |
| void | set_quick (char *str, uint32 arg_length, CHARSET_INFO *cs) |
| bool | set (longlong num, CHARSET_INFO *cs) |
| bool | set (ulonglong num, CHARSET_INFO *cs) |
| bool | set (double num, uint decimals, CHARSET_INFO *cs) |
| void | chop () |
| void | free () |
| bool | alloc (uint32 arg_length) |
| bool | real_alloc (uint32 arg_length) |
| bool | realloc (uint32 arg_length) |
| void | shrink (uint32 arg_length) |
| bool | is_alloced () |
| String & | operator= (const String &s) |
| bool | copy () |
| bool | copy (const String &s) |
| bool | copy (const char *s, uint32 arg_length, CHARSET_INFO *cs) |
| bool | copy_aligned (const char *s, uint32 arg_length, uint32 offset, CHARSET_INFO *cs) |
| bool | set_or_copy_aligned (const char *s, uint32 arg_length, CHARSET_INFO *cs) |
| bool | copy (const char *s, uint32 arg_length, CHARSET_INFO *csfrom, CHARSET_INFO *csto, uint *errors) |
| bool | append (const String &s) |
| bool | append (const char *s) |
| bool | append (const char *s, uint32 arg_length) |
| bool | append (const char *s, uint32 arg_length, CHARSET_INFO *cs) |
| bool | append (IO_CACHE *file, uint32 arg_length) |
| bool | append_with_prefill (const char *s, uint32 arg_length, uint32 full_length, char fill_char) |
| int | strstr (const String &search, uint32 offset=0) |
| int | strrstr (const String &search, uint32 offset=0) |
| bool | replace (uint32 offset, uint32 arg_length, const char *to, uint32 length) |
| bool | replace (uint32 offset, uint32 arg_length, const String &to) |
| bool | append (char chr) |
| bool | fill (uint32 max_length, char fill) |
| void | strip_sp () |
| uint32 | numchars () |
| int | charpos (int i, uint32 offset=0) |
| int | reserve (uint32 space_needed) |
| int | reserve (uint32 space_needed, uint32 grow_by) |
| void | q_append (const char c) |
| void | q_append (const uint32 n) |
| void | q_append (double d) |
| void | q_append (double *d) |
| void | q_append (const char *data, uint32 data_len) |
| void | write_at_position (int position, uint32 value) |
| void | qs_append (const char *str, uint32 len) |
| void | qs_append (double d) |
| void | qs_append (double *d) |
| void | qs_append (const char c) |
| void | qs_append (int i) |
| void | qs_append (uint i) |
| char * | prep_append (uint32 arg_length, uint32 step_alloc) |
| bool | append (const char *s, uint32 arg_length, uint32 step_alloc) |
| void | print (String *print) |
| void | swap (String &s) |
| bool | uses_buffer_owned_by (const String *s) const |
| String () | |
| String (uint32 length_arg) | |
| String (const char *str, CHARSET_INFO *cs) | |
| String (const char *str, uint32 len, CHARSET_INFO *cs) | |
| String (char *str, uint32 len, CHARSET_INFO *cs) | |
| String (const String &str) | |
| ~String () | |
| void | set_charset (CHARSET_INFO *charset) |
| CHARSET_INFO * | charset () const |
| uint32 | length () const |
| uint32 | alloced_length () const |
| char & | operator[] (uint32 i) const |
| void | length (uint32 len) |
| bool | is_empty () |
| void | mark_as_const () |
| const char * | ptr () const |
| char * | c_ptr () |
| char * | c_ptr_quick () |
| char * | c_ptr_safe () |
| void | set (String &str, uint32 offset, uint32 arg_length) |
| void | set (char *str, uint32 arg_length, CHARSET_INFO *cs) |
| void | set (const char *str, uint32 arg_length, CHARSET_INFO *cs) |
| bool | set_ascii (const char *str, uint32 arg_length) |
| void | set_quick (char *str, uint32 arg_length, CHARSET_INFO *cs) |
| bool | set_int (longlong num, bool unsigned_flag, CHARSET_INFO *cs) |
| bool | set (longlong num, CHARSET_INFO *cs) |
| bool | set (ulonglong num, CHARSET_INFO *cs) |
| bool | set_real (double num, uint decimals, CHARSET_INFO *cs) |
| void | chop () |
| void | free () |
| bool | alloc (uint32 arg_length) |
| bool | real_alloc (uint32 arg_length) |
| bool | realloc (uint32 arg_length) |
| void | shrink (uint32 arg_length) |
| bool | is_alloced () |
| String & | operator= (const String &s) |
| bool | copy () |
| bool | copy (const String &s) |
| bool | copy (const char *s, uint32 arg_length, CHARSET_INFO *cs) |
| bool | copy_aligned (const char *s, uint32 arg_length, uint32 offset, CHARSET_INFO *cs) |
| bool | set_or_copy_aligned (const char *s, uint32 arg_length, CHARSET_INFO *cs) |
| bool | copy (const char *s, uint32 arg_length, CHARSET_INFO *csfrom, CHARSET_INFO *csto, uint *errors) |
| bool | append (const String &s) |
| bool | append (const char *s) |
| bool | append (const char *s, uint32 arg_length) |
| bool | append (const char *s, uint32 arg_length, CHARSET_INFO *cs) |
| bool | append (IO_CACHE *file, uint32 arg_length) |
| bool | append_with_prefill (const char *s, uint32 arg_length, uint32 full_length, char fill_char) |
| int | strstr (const String &search, uint32 offset=0) |
| int | strrstr (const String &search, uint32 offset=0) |
| bool | replace (uint32 offset, uint32 arg_length, const char *to, uint32 length) |
| bool | replace (uint32 offset, uint32 arg_length, const String &to) |
| bool | append (char chr) |
| bool | fill (uint32 max_length, char fill) |
| void | strip_sp () |
| uint32 | numchars () |
| int | charpos (int i, uint32 offset=0) |
| int | reserve (uint32 space_needed) |
| int | reserve (uint32 space_needed, uint32 grow_by) |
| void | q_append (const char c) |
| void | q_append (const uint32 n) |
| void | q_append (double d) |
| void | q_append (double *d) |
| void | q_append (const char *data, uint32 data_len) |
| void | write_at_position (int position, uint32 value) |
| void | qs_append (const char *str, uint32 len) |
| void | qs_append (double d) |
| void | qs_append (double *d) |
| void | qs_append (const char c) |
| void | qs_append (int i) |
| void | qs_append (uint i) |
| char * | prep_append (uint32 arg_length, uint32 step_alloc) |
| bool | append (const char *s, uint32 arg_length, uint32 step_alloc) |
| void | print (String *print) |
| void | swap (String &s) |
| bool | uses_buffer_owned_by (const String *s) const |
Static Public Member Functions | |
| static void * | operator new (size_t size, MEM_ROOT *mem_root) |
| static void | operator delete (void *ptr_arg, size_t size) |
| static void | operator delete (void *ptr_arg, MEM_ROOT *mem_root) |
| static bool | needs_conversion (uint32 arg_length, CHARSET_INFO *cs_from, CHARSET_INFO *cs_to, uint32 *offset) |
| static void * | operator new (size_t size, MEM_ROOT *mem_root) |
| static void | operator delete (void *ptr_arg, size_t size) |
| static void | operator delete (void *ptr_arg, MEM_ROOT *mem_root) |
| static bool | needs_conversion (uint32 arg_length, CHARSET_INFO *cs_from, CHARSET_INFO *cs_to, uint32 *offset) |
Private Attributes | |
| char * | Ptr |
| uint32 | str_length |
| uint32 | Alloced_length |
| bool | alloced |
| CHARSET_INFO * | str_charset |
| char * | Ptr |
| CHARSET_INFO * | str_charset |
Friends | |
| int | sortcmp (const String *a, const String *b, CHARSET_INFO *cs) |
| int | stringcmp (const String *a, const String *b) |
| String * | copy_if_not_alloced (String *a, String *b, uint32 arg_length) |
| int | sortcmp (const String *a, const String *b, CHARSET_INFO *cs) |
| int | stringcmp (const String *a, const String *b) |
| String * | copy_if_not_alloced (String *a, String *b, uint32 arg_length) |
Definition at line 34 of file sql_string.h.
| String::String | ( | ) | [inline] |
Definition at line 41 of file sql_string.h.
References alloced, Alloced_length, my_charset_bin, str_charset, and str_length.
00042 { 00043 Ptr=0; str_length=Alloced_length=0; alloced=0; 00044 str_charset= &my_charset_bin; 00045 }
| String::String | ( | uint32 | length_arg | ) | [inline] |
Definition at line 46 of file sql_string.h.
References alloced, Alloced_length, my_charset_bin, real_alloc(), and str_charset.
00047 { 00048 alloced=0; Alloced_length=0; (void) real_alloc(length_arg); 00049 str_charset= &my_charset_bin; 00050 }
Here is the call graph for this function:

| String::String | ( | const char * | str, | |
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 51 of file sql_string.h.
References alloced, Alloced_length, str_charset, str_length, and strlen().
00052 { 00053 Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0; 00054 str_charset=cs; 00055 }
Here is the call graph for this function:

| String::String | ( | const char * | str, | |
| uint32 | len, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 56 of file sql_string.h.
References alloced, Alloced_length, str_charset, and str_length.
00057 { 00058 Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0; 00059 str_charset=cs; 00060 }
| String::String | ( | char * | str, | |
| uint32 | len, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 61 of file sql_string.h.
References alloced, Alloced_length, str_charset, and str_length.
00062 { 00063 Ptr=(char*) str; Alloced_length=str_length=len; alloced=0; 00064 str_charset=cs; 00065 }
| String::String | ( | const String & | str | ) | [inline] |
Definition at line 66 of file sql_string.h.
References alloced, Alloced_length, Ptr, str_charset, and str_length.
00067 { 00068 Ptr=str.Ptr ; str_length=str.str_length ; 00069 Alloced_length=str.Alloced_length; alloced=0; 00070 str_charset=str.str_charset; 00071 }
| String::~String | ( | ) | [inline] |
Definition at line 78 of file sql_string.h.
References free().
00078 { free(); }
Here is the call graph for this function:

| String::String | ( | ) | [inline] |
Definition at line 41 of file sql_string.h.
References alloced, Alloced_length, my_charset_bin, str_charset, and str_length.
00042 { 00043 Ptr=0; str_length=Alloced_length=0; alloced=0; 00044 str_charset= &my_charset_bin; 00045 }
| String::String | ( | uint32 | length_arg | ) | [inline] |
Definition at line 46 of file sql_string.h.
References alloced, Alloced_length, my_charset_bin, real_alloc(), and str_charset.
00047 { 00048 alloced=0; Alloced_length=0; (void) real_alloc(length_arg); 00049 str_charset= &my_charset_bin; 00050 }
Here is the call graph for this function:

| String::String | ( | const char * | str, | |
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 51 of file sql_string.h.
References alloced, Alloced_length, str_charset, str_length, and strlen().
00052 { 00053 Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0; 00054 str_charset=cs; 00055 }
Here is the call graph for this function:

| String::String | ( | const char * | str, | |
| uint32 | len, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 56 of file sql_string.h.
References alloced, Alloced_length, str_charset, and str_length.
00057 { 00058 Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0; 00059 str_charset=cs; 00060 }
| String::String | ( | char * | str, | |
| uint32 | len, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 61 of file sql_string.h.
References alloced, Alloced_length, str_charset, and str_length.
00062 { 00063 Ptr=(char*) str; Alloced_length=str_length=len; alloced=0; 00064 str_charset=cs; 00065 }
| String::String | ( | const String & | str | ) | [inline] |
Definition at line 66 of file sql_string.h.
References alloced, Alloced_length, Ptr, str_charset, and str_length.
00067 { 00068 Ptr=str.Ptr ; str_length=str.str_length ; 00069 Alloced_length=str.Alloced_length; alloced=0; 00070 str_charset=str.str_charset; 00071 }
| String::~String | ( | ) | [inline] |
Definition at line 78 of file sql_string.h.
References free().
00078 { free(); }
Here is the call graph for this function:

Definition at line 187 of file sql_string.h.
References Alloced_length, and real_alloc().
00188 { 00189 if (arg_length < Alloced_length) 00190 return 0; 00191 return real_alloc(arg_length); 00192 }
Here is the call graph for this function:

Definition at line 183 of file sql_string.h.
References Alloced_length, and real_alloc().
Referenced by alloc_buffer(), copy(), copy_aligned(), Item_extract::fix_length_and_dec(), Item_date_add_interval::fix_length_and_dec(), ha_archive::get_row(), Item_func_user::init(), make_datetime(), my_decimal2string(), Protocol_prep::prepare_for_send(), read_and_execute(), set(), set_int(), set_real(), Field::val_int_as_str(), Item_nodeset_func_parentbyname::val_nodeset(), Item_nodeset_func_ancestorbyname::val_nodeset(), Item_nodeset_func_union::val_nodeset(), Item_nodeset_func::val_str(), Item_func_maketime::val_str(), Item_func_makedate::val_str(), Item_date_typecast::val_str(), Item_char_typecast::val_str(), Item_func_convert_tz::val_str(), Item_func_from_unixtime::val_str(), Item_func_date_format::val_str(), Item_func_sec_to_time::val_str(), Item_func_curdate::val_str(), Item_date::val_str(), Item_func_quote::val_str(), Item_load_file::val_str(), Item_func_unhex::val_str(), Item_func_hex::val_str(), Item_func_lpad::val_str(), Item_func_make_set::val_str(), Item_func_soundex::val_str(), Item_str_conv::val_str(), Item_func_concat_ws::val_str(), Item_func_des_decrypt::val_str(), Item_func_des_encrypt::val_str(), Item_func_concat::val_str(), Item_func_aes_decrypt::val_str(), Item_func_aes_encrypt::val_str(), Item_func_sha::val_str(), Item_func_md5::val_str(), and Field_timestamp::val_str().
00184 { 00185 if (arg_length < Alloced_length) 00186 return 0; 00187 return real_alloc(arg_length); 00188 }
Here is the call graph for this function:

Here is the caller graph for this function:

| uint32 String::alloced_length | ( | ) | const [inline] |
Definition at line 83 of file sql_string.h.
References Alloced_length.
00083 { return Alloced_length;}
| uint32 String::alloced_length | ( | ) | const [inline] |
Definition at line 83 of file sql_string.h.
References Alloced_length.
Referenced by alloc_buffer(), Cached_item_str::cmp(), Event_scheduler::dump_internal_status(), ha_archive::info(), read_and_execute(), Item_param::reset(), Field_bit_as_char::sql_type(), Field_bit::sql_type(), Field_varstring::sql_type(), Field_string::sql_type(), Field_year::sql_type(), Field_double::sql_type(), Field_float::sql_type(), Field_long::sql_type(), Field_medium::sql_type(), Field_short::sql_type(), Field_tiny::sql_type(), Field_new_decimal::sql_type(), Field_decimal::sql_type(), Item_char_typecast::val_str(), Item_func_reverse::val_str(), Item_func_concat_ws::val_str(), and Item_func_concat::val_str().
00083 { return Alloced_length;}
Here is the caller graph for this function:

Definition at line 340 of file sql_string.h.
References Alloced_length, FALSE, memcpy, realloc(), str_length, and TRUE.
00341 { 00342 uint32 new_length= arg_length + str_length; 00343 if (new_length > Alloced_length && realloc(new_length + step_alloc)) 00344 return TRUE; 00345 memcpy(Ptr+str_length, s, arg_length); 00346 str_length+= arg_length; 00347 return FALSE; 00348 }
Here is the call graph for this function:

| bool String::append | ( | char | chr | ) | [inline] |
Definition at line 251 of file sql_string.h.
References Alloced_length, realloc(), and str_length.
00252 { 00253 if (str_length < Alloced_length) 00254 { 00255 Ptr[str_length++]=chr; 00256 } 00257 else 00258 { 00259 if (realloc(str_length+1)) 00260 return 1; 00261 Ptr[str_length++]=chr; 00262 } 00263 return 0; 00264 }
Here is the call graph for this function:

| bool String::append | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) |
| bool String::append | ( | const char * | s | ) |
Definition at line 336 of file sql_string.h.
References Alloced_length, FALSE, memcpy, realloc(), str_length, and TRUE.
00337 { 00338 uint32 new_length= arg_length + str_length; 00339 if (new_length > Alloced_length && realloc(new_length + step_alloc)) 00340 return TRUE; 00341 memcpy(Ptr+str_length, s, arg_length); 00342 str_length+= arg_length; 00343 return FALSE; 00344 }
Here is the call graph for this function:

| bool String::append | ( | char | chr | ) | [inline] |
Definition at line 247 of file sql_string.h.
References Alloced_length, realloc(), and str_length.
00248 { 00249 if (str_length < Alloced_length) 00250 { 00251 Ptr[str_length++]=chr; 00252 } 00253 else 00254 { 00255 if (realloc(str_length+1)) 00256 return 1; 00257 Ptr[str_length++]=chr; 00258 } 00259 return 0; 00260 }
Here is the call graph for this function:

Definition at line 515 of file sql_string.cc.
References FALSE, my_b_read, realloc(), shrink(), str_length, and TRUE.
00516 { 00517 if (realloc(str_length+arg_length)) 00518 return TRUE; 00519 if (my_b_read(file, (byte*) Ptr + str_length, arg_length)) 00520 { 00521 shrink(str_length); 00522 return TRUE; 00523 } 00524 str_length+=arg_length; 00525 return FALSE; 00526 }
Here is the call graph for this function:

| bool String::append | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 476 of file sql_string.cc.
References copy_and_convert(), FALSE, charset_info_st::mbmaxlen, charset_info_st::mbminlen, memcpy, needs_conversion(), realloc(), str_charset, str_length, and TRUE.
00477 { 00478 uint32 dummy_offset; 00479 00480 if (needs_conversion(arg_length, cs, str_charset, &dummy_offset)) 00481 { 00482 uint32 add_length= arg_length / cs->mbminlen * str_charset->mbmaxlen; 00483 uint dummy_errors; 00484 if (realloc(str_length + add_length)) 00485 return TRUE; 00486 str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, 00487 s, arg_length, cs, &dummy_errors); 00488 } 00489 else 00490 { 00491 if (realloc(str_length + arg_length)) 00492 return TRUE; 00493 memcpy(Ptr + str_length, s, arg_length); 00494 str_length+= arg_length; 00495 } 00496 return FALSE; 00497 }
Here is the call graph for this function:

Definition at line 430 of file sql_string.cc.
References copy_and_convert(), FALSE, charset_info_st::mbmaxlen, charset_info_st::mbminlen, memcpy, my_charset_latin1, realloc(), str_charset, str_length, and TRUE.
00431 { 00432 if (!arg_length) 00433 return FALSE; 00434 00435 /* 00436 For an ASCII incompatible string, e.g. UCS-2, we need to convert 00437 */ 00438 if (str_charset->mbminlen > 1) 00439 { 00440 uint32 add_length=arg_length * str_charset->mbmaxlen; 00441 uint dummy_errors; 00442 if (realloc(str_length+ add_length)) 00443 return TRUE; 00444 str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, 00445 s, arg_length, &my_charset_latin1, 00446 &dummy_errors); 00447 return FALSE; 00448 } 00449 00450 /* 00451 For an ASCII compatinble string we can just append. 00452 */ 00453 if (realloc(str_length+arg_length)) 00454 return TRUE; 00455 memcpy(Ptr+str_length,s,arg_length); 00456 str_length+=arg_length; 00457 return FALSE; 00458 }
Here is the call graph for this function:

| bool String::append | ( | const char * | s | ) |
Definition at line 413 of file sql_string.cc.
References FALSE, length(), memcpy, ptr(), realloc(), str_length, and TRUE.
Referenced by QUICK_ROR_UNION_SELECT::add_info_string(), QUICK_ROR_INTERSECT_SELECT::add_info_string(), QUICK_INDEX_MERGE_SELECT::add_info_string(), QUICK_RANGE_SELECT::add_info_string(), add_int_to_prompt(), QUICK_GROUP_MIN_MAX_SELECT::add_keys_and_lengths(), QUICK_ROR_UNION_SELECT::add_keys_and_lengths(), QUICK_ROR_INTERSECT_SELECT::add_keys_and_lengths(), QUICK_INDEX_MERGE_SELECT::add_keys_and_lengths(), QUICK_RANGE_SELECT::add_keys_and_lengths(), add_user_option(), Field_num::add_zerofill_and_unsigned(), Item_string::append(), append(), append_algorithm(), ha_myisammrg::append_create_info(), append_directory(), XPathFilter::append_element(), append_escaped(), append_identifier(), append_unescaped(), append_user(), append_with_prefill(), Table_triggers_list::change_table_name_in_triggers(), collect_decimal(), collect_longlong(), collect_partition_expr(), collect_real(), collect_string(), collect_ulonglong(), construct_prompt(), sp_head::create(), db_create_routine(), dump_leaf_key(), ha_tina::encode_quote(), analyse::end_of_records(), evex_print_warnings(), sp_head::execute_function(), execute_sqlcom_select(), ha_tina::find_current_row(), fix_history(), Item_func_sp::func_name(), field_str::get_opt_type(), get_schema_partitions_record(), get_schema_views_record(), Load_log_event::Load_log_event(), make_date_time(), mysql_create_or_drop_trigger(), mysql_drop_view(), mysql_register_view(), mysql_rm_table_part2(), mysql_show_grants(), pack_fields(), st_table_list::print(), sp_instr_set_trigger_field::print(), Item_sum_unique_users::print(), Item_func_unique_users::print(), Item_func_get_format::print(), Item_func_timestamp_diff::print(), Item_func_add_time::print(), Item_char_typecast::print(), Item_typecast::print(), Item_extract::print(), Item_date_add_interval::print(), Item_func_group_concat::print(), Item_sum::print(), subselect_indexsubquery_engine::print(), subselect_uniquesubquery_engine::print(), Item_allany_subselect::print(), Item_in_subselect::print(), Item_exists_subselect::print(), Item_maxmin_subselect::print(), Item_subselect::print(), Item_func_binary::print(), Item_func_set_collation::print(), Item_func_conv_charset::print(), Item_func_make_set::print(), Item_func_format::print(), Item_func_trim::print(), Item_row::print(), Item_func_match::print(), Item_user_var_as_out_param::print(), Item_func_get_user_var::print(), Item_func_set_user_var::print(), Item_func_benchmark::print(), Item_func_locate::print(), Item_decimal_typecast::print(), Item_func_unsigned::print(), Item_func_signed::print(), Item_func::print(), Item_equal::print(), Item_func_isnotnull::print(), Item_cond::print(), Item_func_in::print(), Item_func_case::print(), Item_func_between::print(), Item_static_string_func::print(), Item_static_float_func::print(), Item_null::print(), Item::print(), Item_cache::print(), Item_trigger_field::print(), Item_insert_value::print(), Item_default_value::print(), Item_ref_null_helper::print(), Item_float::print(), Item_param::print(), Item_string::print(), Item_decimal::print(), Item_uint::print(), Item_int::print(), Item_ident::print(), Item_name_const::print(), Item_case_expr::print(), Item_splocal::print(), print(), Item_func::print_args(), Item_func_set_user_var::print_as_stmt(), handler::print_error(), Item::print_item_w_name(), print_join(), handler::print_keydup_error(), Item_func::print_op(), print_ror_scans_arr(), print_sel_tree(), print_where(), Log_event::read_log_event(), select_describe(), Item_param::set_longdata(), sp_returns_type(), Field_set::sql_type(), Field_enum::sql_type(), Field_blob::sql_type(), Field_varstring::sql_type(), Field_string::sql_type(), Event_scheduler::stop_all_running_events(), Protocol_prep::store(), Protocol::store(), store_create_info(), store_key_options(), Protocol_simple::store_null(), Protocol_prep::store_time(), Protocol_prep::store_tiny(), subst_spvars(), sys_var_thd_sql_mode::symbolic_mode_representation(), Rpl_filter::table_rule_ent_dynamic_array_to_str(), Rpl_filter::table_rule_ent_hash_to_str(), TEST_filesort(), Item_func_xml_update::val_str(), Item_nodeset_func::val_str(), Item_func_inet_ntoa::val_str(), Item_func_export_set::val_str(), Item_func_lpad::val_str(), Item_func_char::val_str(), Item_func_make_set::val_str(), Item_func_concat_ws::val_str(), Item_func_des_encrypt::val_str(), Item_func_concat::val_str(), sys_var_log_output::value_ptr(), and view_store_options().
00414 { 00415 if (s.length()) 00416 { 00417 if (realloc(str_length+s.length())) 00418 return TRUE; 00419 memcpy(Ptr+str_length,s.ptr(),s.length()); 00420 str_length+=s.length(); 00421 } 00422 return FALSE; 00423 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool String::append_with_prefill | ( | const char * | s, | |
| uint32 | arg_length, | |||
| uint32 | full_length, | |||
| char | fill_char | |||
| ) |
| bool String::append_with_prefill | ( | const char * | s, | |
| uint32 | arg_length, | |||
| uint32 | full_length, | |||
| char | fill_char | |||
| ) |
Definition at line 528 of file sql_string.cc.
References append(), bfill, FALSE, realloc(), str_length, and TRUE.
Referenced by make_date_time().
00530 { 00531 int t_length= arg_length > full_length ? arg_length : full_length; 00532 00533 if (realloc(str_length + t_length)) 00534 return TRUE; 00535 t_length= full_length - arg_length; 00536 if (t_length > 0) 00537 { 00538 bfill(Ptr+str_length, t_length, fill_char); 00539 str_length=str_length + t_length; 00540 } 00541 append(s, arg_length); 00542 return FALSE; 00543 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char* String::c_ptr | ( | ) | [inline] |
Definition at line 89 of file sql_string.h.
References realloc(), and str_length.
00090 { 00091 if (!Ptr || Ptr[str_length]) /* Should be safe */ 00092 (void) realloc(str_length); 00093 return Ptr; 00094 }
Here is the call graph for this function:

| char* String::c_ptr | ( | ) | [inline] |
Definition at line 88 of file sql_string.h.
References realloc(), and str_length.
Referenced by sys_var_thd_storage_engine::check(), sys_var_thd_lc_time_names::check(), sys_var_thd_time_zone::check(), sys_var_character_set::check(), sys_var_collation::check(), sys_var_thd_date_time_format::check(), sys_var::check_enum(), Field::check_int(), sys_var::check_set(), Event_timed::compile(), db_create_routine(), db_load_routine(), evex_print_warnings(), fix_history(), Item_func_set_collation::fix_length_and_dec(), make_truncated_value_warning(), mysql_drop_view(), mysql_rm_known_files(), mysql_table_grant(), handler::print_error(), handler::print_keydup_error(), Events::show_create_event(), Event_scheduler::stop_all_running_events(), store_natural_using_join_columns(), string_ptr_cmp(), sys_check_ftb_syntax(), sys_update_ftb_syntax(), sys_var_thd_dbug::update(), Item::val_decimal_from_string(), Field_double::val_int(), Item_func_signed::val_int_from_str(), Item_func_group_concat::val_real(), Item_load_file::val_str(), Item_func_encrypt::val_str(), Item_func_old_password::val_str(), and Item_func_password::val_str().
00089 { 00090 if (!Ptr || Ptr[str_length]) /* Should be safe */ 00091 (void) realloc(str_length); 00092 return Ptr; 00093 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char* String::c_ptr_quick | ( | ) | [inline] |
Definition at line 95 of file sql_string.h.
References Alloced_length, and str_length.
00096 { 00097 if (Ptr && str_length < Alloced_length) 00098 Ptr[str_length]=0; 00099 return Ptr; 00100 }
| char* String::c_ptr_quick | ( | ) | [inline] |
Definition at line 94 of file sql_string.h.
References Alloced_length, and str_length.
Referenced by Item_param::new_item(), and Item_param::query_val_str().
00095 { 00096 if (Ptr && str_length < Alloced_length) 00097 Ptr[str_length]=0; 00098 return Ptr; 00099 }
Here is the caller graph for this function:

| char* String::c_ptr_safe | ( | ) | [inline] |
Definition at line 101 of file sql_string.h.
References Alloced_length, realloc(), and str_length.
00102 { 00103 if (Ptr && str_length < Alloced_length) 00104 Ptr[str_length]=0; 00105 else 00106 (void) realloc(str_length); 00107 return Ptr; 00108 }
Here is the call graph for this function:

| char* String::c_ptr_safe | ( | ) | [inline] |
Definition at line 100 of file sql_string.h.
References Alloced_length, realloc(), and str_length.
Referenced by mysql_create_user(), mysql_drop_user(), mysql_rename_user(), handler::print_error(), and Item_char_typecast::val_str().
00101 { 00102 if (Ptr && str_length < Alloced_length) 00103 Ptr[str_length]=0; 00104 else 00105 (void) realloc(str_length); 00106 return Ptr; 00107 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int String::charpos | ( | int | i, | |
| uint32 | offset = 0 | |||
| ) |
| int String::charpos | ( | int | i, | |
| uint32 | offset = 0 | |||
| ) |
Definition at line 550 of file sql_string.cc.
References my_charset_handler_st::charpos, charset_info_st::cset, str_charset, and str_length.
Referenced by Item_func_locate::val_int(), Item_char_typecast::val_str(), Item_func_lpad::val_str(), Item_func_rpad::val_str(), Item_func_substr::val_str(), Item_func_right::val_str(), Item_func_left::val_str(), and Item_func_insert::val_str().
00551 { 00552 if (i <= 0) 00553 return i; 00554 return str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,i); 00555 }
Here is the caller graph for this function:

| CHARSET_INFO* String::charset | ( | void | ) | const [inline] |
| CHARSET_INFO* String::charset | ( | ) | const [inline] |
Definition at line 81 of file sql_string.h.
References str_charset.
Referenced by append_identifier(), Item_cache_str::charset(), Item_str_func::check_well_formed_result(), Item_param::convert_str_value(), create_typelib(), analyse::end_of_records(), Item_nodeset_func::fix_length_and_dec(), get_dynamic_sql_string(), get_interval_value(), get_schema_column_record(), Item_func_user::init(), Item_func_match::init_search(), Item_func_conv_charset::Item_func_conv_charset(), make_date_time(), Item_sum_hybrid::min_max_update_str_field(), mysql_prepare_table(), mysql_show_grants(), Item_param::new_item(), resolve_const_item(), Item_func_sysconst::safe_charset_converter(), Item_static_string_func::safe_charset_converter(), Item_param::safe_charset_converter(), Item_string::safe_charset_converter(), Item_static_float_func::safe_charset_converter(), Item_num::safe_charset_converter(), Item_param::save_in_field(), Item::send(), Field::send_binary(), in_string::set(), set_charset(), sortcmp2(), sp_get_item_value(), Field_bit_as_char::sql_type(), Field_bit::sql_type(), Field_set::sql_type(), Field_enum::sql_type(), Field_varstring::sql_type(), Field_string::sql_type(), Field_year::sql_type(), Field_double::sql_type(), Field_float::sql_type(), Field_long::sql_type(), Field_medium::sql_type(), Field_short::sql_type(), Field_tiny::sql_type(), Field_new_decimal::sql_type(), Field_decimal::sql_type(), Protocol_simple::store(), Protocol::store(), Field_longstr::store_decimal(), Protocol_prep::store_decimal(), Item_ref::str_result(), Item_field::str_result(), Item_str_func::val_decimal(), Item_func_numhybrid::val_decimal(), Item::val_decimal_from_string(), Item_proc_string::val_int(), Item_str_func::val_int(), Item_func_ord::val_int(), Item_func_numhybrid::val_int(), Item_copy_string::val_int(), Item_cache_str::val_int(), Item_param::val_int(), Item_string::val_int(), Item_proc_string::val_real(), Item_sum_hybrid::val_real(), Item_str_func::val_real(), Item_func_numhybrid::val_real(), Item_copy_string::val_real(), Item_cache_str::val_real(), Item_param::val_real(), Item_string::val_real(), Item_func_conv_charset::val_str(), Item_func_conv::val_str(), Item_func_encrypt::val_str(), Item_func_old_password::val_str(), Item_func_password::val_str(), Item_func_trim::val_str(), Item_func_rtrim::val_str(), Item_func_substr_index::val_str(), Item_func_replace::val_str(), Item_func_reverse::val_str(), Item_func_sp::val_str(), Item_field::val_str(), and Item_sp_variable::val_str().
00081 { return str_charset; }
Here is the caller graph for this function:

| void String::chop | ( | ) | [inline] |
Definition at line 171 of file sql_string.h.
References str_length.
00172 { 00173 Ptr[str_length--]= '\0'; 00174 }
| void String::chop | ( | ) | [inline] |
Definition at line 167 of file sql_string.h.
References str_length.
00168 { 00169 Ptr[str_length--]= '\0'; 00170 }
| bool String::copy | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | csfrom, | |||
| CHARSET_INFO * | csto, | |||
| uint * | errors | |||
| ) |
| bool String::copy | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) |
| bool String::copy | ( | ) |
| bool String::copy | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | csfrom, | |||
| CHARSET_INFO * | csto, | |||
| uint * | errors | |||
| ) |
Definition at line 336 of file sql_string.cc.
References alloc(), copy(), copy_aligned(), copy_and_convert(), FALSE, charset_info_st::mbmaxlen, my_charset_bin, needs_conversion(), offset, str_charset, str_length, and TRUE.
00338 { 00339 uint32 offset; 00340 if (!needs_conversion(arg_length, from_cs, to_cs, &offset)) 00341 { 00342 *errors= 0; 00343 return copy(str, arg_length, to_cs); 00344 } 00345 if ((from_cs == &my_charset_bin) && offset) 00346 { 00347 *errors= 0; 00348 return copy_aligned(str, arg_length, offset, to_cs); 00349 } 00350 uint32 new_length= to_cs->mbmaxlen*arg_length; 00351 if (alloc(new_length)) 00352 return TRUE; 00353 str_length=copy_and_convert((char*) Ptr, new_length, to_cs, 00354 str, arg_length, from_cs, errors); 00355 str_charset=to_cs; 00356 return FALSE; 00357 }
Here is the call graph for this function:

| bool String::copy | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 223 of file sql_string.cc.
References alloc(), FALSE, memcpy, str_charset, str_length, and TRUE.
00224 { 00225 if (alloc(arg_length)) 00226 return TRUE; 00227 if ((str_length=arg_length)) 00228 memcpy(Ptr,str,arg_length); 00229 Ptr[arg_length]=0; 00230 str_charset=cs; 00231 return FALSE; 00232 }
Here is the call graph for this function:

Definition at line 212 of file sql_string.cc.
References alloc(), bmove(), FALSE, Ptr, str_charset, str_length, and TRUE.
00213 { 00214 if (alloc(str.str_length)) 00215 return TRUE; 00216 str_length=str.str_length; 00217 bmove(Ptr,str.Ptr,str_length); // May be overlapping 00218 Ptr[str_length]=0; 00219 str_charset=str.str_charset; 00220 return FALSE; 00221 }
Here is the call graph for this function:

| bool String::copy | ( | ) |
Definition at line 202 of file sql_string.cc.
References alloced, Alloced_length, FALSE, realloc(), and str_length.
Referenced by field_str::add(), Item_sum_max::add(), Item_sum_min::add(), alloc_buffer(), Field::check_int(), Item_func_group_concat::clear(), Cached_item_str::cmp(), com_go(), com_server_help(), Item_copy_string::copy(), Field_blob::copy(), copy(), create_func_space(), create_typelib(), get_schema_column_record(), Item_func_match::init_search(), Item_func_conv_charset::Item_func_conv_charset(), make_date_time(), make_truncated_value_warning(), mysql_prepare_table(), Item_func_sysconst::safe_charset_converter(), Item_hex_string::safe_charset_converter(), Item_static_string_func::safe_charset_converter(), Item_param::safe_charset_converter(), Item_string::safe_charset_converter(), Item_static_float_func::safe_charset_converter(), Item_num::safe_charset_converter(), Item_proc_string::set(), in_string::set(), set(), set_ascii(), set_real(), Item_param::set_str(), Item_string::set_str_with_copy(), Item_cache_str::store(), Field_set::store(), Field_enum::store(), Field_blob::store(), Field_varstring::store(), Field_string::store(), Field_decimal::store(), Protocol::store_string_aux(), str2my_decimal(), Item_char_typecast::val_str(), Item_func_quote::val_str(), Item_func_hex::val_str(), Item_func_collation::val_str(), Item_func_charset::val_str(), Item_func_conv_charset::val_str(), Item_func_conv::val_str(), Item_func_make_set::val_str(), Item_func_database::val_str(), Item_func_encrypt::val_str(), Item_func_concat_ws::val_str(), Item_func_concat::val_str(), and Item_func_sp::val_str().
00203 { 00204 if (!alloced) 00205 { 00206 Alloced_length=0; // Force realloc 00207 return realloc(str_length); 00208 } 00209 return FALSE; 00210 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool String::copy_aligned | ( | const char * | s, | |
| uint32 | arg_length, | |||
| uint32 | offset, | |||
| CHARSET_INFO * | cs | |||
| ) |
| bool String::copy_aligned | ( | const char * | s, | |
| uint32 | arg_length, | |||
| uint32 | offset, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 294 of file sql_string.cc.
References alloc(), bzero, DBUG_ASSERT, FALSE, charset_info_st::mbmaxlen, memcpy, str_charset, str_length, and TRUE.
Referenced by copy(), and set_or_copy_aligned().
00296 { 00297 /* How many bytes are in incomplete character */ 00298 offset= cs->mbmaxlen - offset; /* How many zeros we should prepend */ 00299 DBUG_ASSERT(offset && offset != cs->mbmaxlen); 00300 00301 uint32 aligned_length= arg_length + offset; 00302 if (alloc(aligned_length)) 00303 return TRUE; 00304 00305 /* 00306 Note, this is only safe for little-endian UCS-2. 00307 If we add big-endian UCS-2 sometimes, this code 00308 will be more complicated. But it's OK for now. 00309 */ 00310 bzero((char*) Ptr, offset); 00311 memcpy(Ptr + offset, str, arg_length); 00312 Ptr[aligned_length]=0; 00313 /* str_length is always >= 0 as arg_length is != 0 */ 00314 str_length= aligned_length; 00315 str_charset= cs; 00316 return FALSE; 00317 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 393 of file sql_string.cc.
References bfill, FALSE, realloc(), str_length, and TRUE.
00394 { 00395 if (str_length > max_length) 00396 Ptr[str_length=max_length]=0; 00397 else 00398 { 00399 if (realloc(max_length)) 00400 return TRUE; 00401 bfill(Ptr+str_length,max_length-str_length,fill_char); 00402 str_length=max_length; 00403 } 00404 return FALSE; 00405 }
Here is the call graph for this function:

| void String::free | ( | ) | [inline] |
Definition at line 176 of file sql_string.h.
References alloced, Alloced_length, my_free, MYF, and str_length.
00177 { 00178 if (alloced) 00179 { 00180 alloced=0; 00181 Alloced_length=0; 00182 my_free(Ptr,MYF(0)); 00183 Ptr=0; 00184 str_length=0; /* Safety */ 00185 } 00186 }
| void String::free | ( | ) | [inline] |
Definition at line 172 of file sql_string.h.
References alloced, Alloced_length, my_free, MYF, and str_length.
Referenced by construct_prompt(), Field_blob::free(), Protocol::free(), free_string(), mysql_end(), operator=(), read_and_execute(), real_alloc(), Item_param::reset(), set(), and ~String().
00173 { 00174 if (alloced) 00175 { 00176 alloced=0; 00177 Alloced_length=0; 00178 my_free(Ptr,MYF(0)); 00179 Ptr=0; 00180 str_length=0; /* Safety */ 00181 } 00182 }
Here is the caller graph for this function:

| bool String::is_alloced | ( | ) | [inline] |
| bool String::is_alloced | ( | ) | [inline] |
Definition at line 208 of file sql_string.h.
References alloced.
Referenced by read_and_execute(), Item_func_concat_ws::val_str(), and Item_func_concat::val_str().
00208 { return alloced; }
Here is the caller graph for this function:

| bool String::is_empty | ( | ) | [inline] |
Definition at line 86 of file sql_string.h.
References str_length.
00086 { return (str_length == 0); }
| bool String::is_empty | ( | ) | [inline] |
Definition at line 86 of file sql_string.h.
References str_length.
Referenced by com_edit(), handler::print_error(), read_and_execute(), and Item_func_uncompressed_length::val_int().
00086 { return (str_length == 0); }
Here is the caller graph for this function:

| void String::length | ( | uint32 | len | ) | [inline] |
| uint32 String::length | ( | ) | const [inline] |
| void String::length | ( | uint32 | len | ) | [inline] |
| uint32 String::length | ( | ) | const [inline] |
Definition at line 82 of file sql_string.h.
References str_length.
Referenced by field_str::add(), Item_func_group_concat::add(), alloc_buffer(), append(), append_escaped(), append_user(), Table_triggers_list::change_table_name_in_triggers(), change_to_use_tmp_fields(), sys_var_thd_storage_engine::check(), sys_var_thd_date_time_format::check(), sys_var::check_enum(), sys_var::check_set(), Item_str_func::check_well_formed_result(), Item_func_group_concat::clear(), Item_sum_hybrid::clear(), close_temporary_tables(), Cached_item_str::cmp(), collect_partition_expr(), com_edit(), com_source(), Arg_comparator::compare_binary_string(), Event_timed::compile(), Item_param::convert_str_value(), create_field::create_field(), create_typelib(), db_create_routine(), db_find_routine(), db_load_routine(), Event_scheduler::dump_internal_status(), dump_leaf_key(), ha_tina::encode_quote(), analyse::end_of_records(), evex_print_warnings(), Prepared_statement::execute(), sp_head::execute_function(), execute_sqlcom_select(), ha_tina::find_current_row(), Item_func_like::fix_fields(), Item_name_const::fix_fields(), Item_xml_str_func::fix_length_and_dec(), Item_func_sp::func_name(), Event_timed::get_create_event(), Item_func_str_to_date::get_date(), Item::get_date(), Field::get_date(), get_dynamic_sql_string(), get_field(), get_interval_value(), get_mm_leaf(), get_schema_column_record(), get_schema_partitions_record(), get_schema_views_record(), Item::get_time(), Field::get_time(), GRANT_COLUMN::GRANT_COLUMN(), Item_func_user::init(), create_field::init(), Item_func_match::init_search(), insert_params_from_vars_with_log(), insert_params_withlog(), Item_func_conv_charset::Item_func_conv_charset(), key_unpack(), Load_log_event::Load_log_event(), make_date(), make_date_time(), make_datetime(), make_sortkey(), make_time(), Item_sum_hybrid::min_max_update_str_field(), my_decimal2string(), mysql_checksum_table(), mysql_create_or_drop_trigger(), mysql_drop_view(), mysql_load(), mysql_prepare_table(), mysql_register_view(), mysql_rm_table_part2(), mysql_show_grants(), mysql_table_grant(), mysqld_dump_create_info(), Item_string::new_item(), Item_param::new_item(), XPathFilter::numelements(), pack_fields(), Ndb_item::pack_length(), Item_xml_str_func::parse_xml(), Item_nodeset_func::prepare(), Protocol_prep::prepare_for_resend(), Protocol_simple::prepare_for_resend(), Item_nodeset_func::prepare_nodes(), handler::print_error(), handler::print_keydup_error(), print_ror_scans_arr(), print_sel_tree(), print_where(), Item_param::query_val_str(), read_and_execute(), READ_INFO::READ_INFO(), replace_column_table(), Item_param::reset(), resolve_const_item(), Item_func_sysconst::safe_charset_converter(), Item_hex_string::safe_charset_converter(), Item_static_string_func::safe_charset_converter(), Item_param::safe_charset_converter(), Item_string::safe_charset_converter(), Item_static_float_func::safe_charset_converter(), Item_num::safe_charset_converter(), Item_hex_string::save_in_field(), Item_string::save_in_field(), Item_copy_string::save_in_field(), Item_param::save_in_field(), select_describe(), Item::send(), Field::send_binary(), Protocol::send_fields(), Events::show_create_event(), sortcmp(), Field_bit_as_char::sql_type(), Field_bit::sql_type(), Field_set::sql_type(), Field_enum::sql_type(), Field_varstring::sql_type(), Field_string::sql_type(), Field_year::sql_type(), Field_double::sql_type(), Field_float::sql_type(), Field_long::sql_type(), Field_medium::sql_type(), Field_short::sql_type(), Field_tiny::sql_type(), Field_new_decimal::sql_type(), Field_decimal::sql_type(), srtcmp_in(), Event_scheduler::stop_all_running_events(), Field_set::store(), Field_enum::store(), Field_blob::store(), Field_varstring::store(), Field_string::store(), Field_decimal::store(), Protocol_simple::store(), Protocol::store(), Field_longstr::store_decimal(), Protocol_prep::store_decimal(), Protocol_simple::store_decimal(), store_schema_proc(), Protocol::store_string_aux(), str2my_decimal(), stringcmp(), strrstr(), strstr(), subst_spvars(), sys_var_thd_sql_mode::symbolic_mode_representation(), Rpl_filter::table_rule_ent_dynamic_array_to_str(), Rpl_filter::table_rule_ent_hash_to_str(), TEST_filesort(), test_if_string_in_list(), typelib(), tz_load_from_open_tables(), update_sys_var_str(), update_sys_var_str_path(), Item_str_func::val_decimal(), Item_func_numhybrid::val_decimal(), Item::val_decimal_from_string(), Item_proc_string::val_int(), Item_nodeset_to_const_comparator::val_int(), Item_func_xpath_count::val_int(), Item_func_xpath_position::val_int(), Item_xpath_cast_bool::val_int(), Item_extract::val_int(), Item_func_group_concat::val_int(), Item_func_crc32::val_int(), Item_str_func::val_int(), Item_func_is_used_lock::val_int(), Item_func_is_free_lock::val_int(), Item_func_inet_aton::val_int(), Item_func_release_lock::val_int(), Item_func_get_lock::val_int(), Item_master_pos_wait::val_int(), Item_func_ord::val_int(), Item_func_ascii::val_int(), Item_func_locate::val_int(), Item_func_length::val_int(), Item_func_numhybrid::val_int(), Item_func_like::val_int(), Item_copy_string::val_int(), Item_cache_str::val_int(), Item_hex_string::val_int(), Item_param::val_int(), Item_string::val_int(), Field::val_int_as_str(), Item_func_signed::val_int_from_str(), Item_nodeset_func_elementbyindex::val_nodeset(), Item_nodeset_func_predicate::val_nodeset(), Item_nodeset_func_union::val_nodeset(), Item_nodeset_func_rootelement::val_nodeset(), Item_proc_string::val_real(), Item_func_xpath_sum::val_real(), Item_sum_hybrid::val_real(), Item_str_func::val_real(), Item_func_match::val_real(), Item_func_numhybrid::val_real(), Item_copy_string::val_real(), Item_cache_str::val_real(), Item_param::val_real(), Item_string::val_real(), Item_func_xml_update::val_str(), Item_nodeset_func::val_str(), Item_func_get_format::val_str(), Item_char_typecast::val_str(), Item_func_date_format::val_str(), Item_func_group_concat::val_str(), Item_func_uuid::val_str(), Item_func_quote::val_str(), Item_func_inet_ntoa::val_str(), Item_func_export_set::val_str(), Item_load_file::val_str(), Item_func_unhex::val_str(), Item_func_hex::val_str(), Item_func_conv_charset::val_str(), Item_func_conv::val_str(), Item_func_lpad::val_str(), Item_func_rpad::val_str(), Item_func_repeat::val_str(), Item_func_char::val_str(), Item_func_make_set::val_str(), Item_func_format::val_str(), Item_func_soundex::val_str(), Item_func_decode::val_str(), Item_func_encode::val_str(), Item_func_encrypt::val_str(), Item_func_old_password::val_str(), Item_func_password::val_str(), Item_func_trim::val_str(), Item_func_rtrim::val_str(), Item_func_ltrim::val_str(), Item_func_substr_index::val_str(), Item_func_substr::val_str(), Item_func_right::val_str(), Item_func_left::val_str(), Item_str_conv::val_str(), Item_func_insert::val_str(), Item_func_replace::val_str(), Item_func_reverse::val_str(), Item_func_concat_ws::val_str(), Item_func_des_decrypt::val_str(), Item_func_des_encrypt::val_str(), Item_func_concat::val_str(), Item_func_aes_decrypt::val_str(), Item_func_aes_encrypt::val_str(), Item_func_sha::val_str(), Item_func_md5::val_str(), Item_param::val_str(), Item_sp_variable::val_str(), Field_null::val_str(), Field_timestamp::val_str(), sys_var_log_output::value_ptr(), Protocol::write(), and write_parameter().
00082 { return str_length;}
Here is the caller graph for this function:

| void String::mark_as_const | ( | ) | [inline] |
Definition at line 87 of file sql_string.h.
References Alloced_length.
Referenced by Item_func_user::init(), Item_func_conv_charset::Item_func_conv_charset(), Item_func_sysconst::safe_charset_converter(), Item_hex_string::safe_charset_converter(), Item_static_string_func::safe_charset_converter(), Item_param::safe_charset_converter(), Item_string::safe_charset_converter(), Item_static_float_func::safe_charset_converter(), Item_num::safe_charset_converter(), Item_func_substr_index::val_str(), and Item_sp_variable::val_str().
00087 { Alloced_length= 0;}
Here is the caller graph for this function:

| static bool String::needs_conversion | ( | uint32 | arg_length, | |
| CHARSET_INFO * | cs_from, | |||
| CHARSET_INFO * | cs_to, | |||
| uint32 * | offset | |||
| ) | [static] |
| bool String::needs_conversion | ( | uint32 | arg_length, | |
| CHARSET_INFO * | cs_from, | |||
| CHARSET_INFO * | cs_to, | |||
| uint32 * | offset | |||
| ) | [static] |
Definition at line 253 of file sql_string.cc.
References FALSE, charset_info_st::mbminlen, my_charset_bin, my_charset_same(), and TRUE.
Referenced by agg_item_charsets(), append(), copy(), create_typelib(), get_dynamic_sql_string(), mysql_prepare_table(), Item_param::set_from_user_var(), setup_one_conversion_function(), Field_set::store(), Field_enum::store(), Field_blob::store(), Field_varstring::store(), and Field_string::store().
00257 { 00258 *offset= 0; 00259 if ((to_cs == &my_charset_bin) || 00260 (to_cs == from_cs) || 00261 my_charset_same(from_cs, to_cs) || 00262 ((from_cs == &my_charset_bin) && 00263 (!(*offset=(arg_length % to_cs->mbminlen))))) 00264 return FALSE; 00265 return TRUE; 00266 }
Here is the call graph for this function:

Here is the caller graph for this function:

| uint32 String::numchars | ( | ) |
| uint32 String::numchars | ( | ) |
Definition at line 545 of file sql_string.cc.
References charset_info_st::cset, my_charset_handler_st::numchars, str_charset, and str_length.
Referenced by Item_string::Item_string(), Item_param::safe_charset_converter(), Item_string::set_str_with_copy(), Item_func_char_length::val_int(), Item_func_lpad::val_str(), Item_func_rpad::val_str(), Item_func_substr::val_str(), and Item_func_right::val_str().
00546 { 00547 return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length); 00548 }
Here is the caller graph for this function:

| static void String::operator delete | ( | void * | ptr_arg, | |
| MEM_ROOT * | mem_root | |||
| ) | [inline, static] |
| static void String::operator delete | ( | void * | ptr_arg, | |
| size_t | size | |||
| ) | [inline, static] |
| static void String::operator delete | ( | void * | ptr_arg, | |
| MEM_ROOT * | mem_root | |||
| ) | [inline, static] |
| static void String::operator delete | ( | void * | ptr_arg, | |
| size_t | size | |||
| ) | [inline, static] |
Definition at line 72 of file sql_string.h.
References alloc_root().
00073 { return (void*) alloc_root(mem_root, (uint) size); }
Here is the call graph for this function:

Definition at line 72 of file sql_string.h.
References alloc_root().
00073 { return (void*) alloc_root(mem_root, (uint) size); }
Here is the call graph for this function:

Definition at line 213 of file sql_string.h.
References alloced, Alloced_length, DBUG_ASSERT, free(), Ptr, str_length, and uses_buffer_owned_by().
00214 { 00215 if (&s != this) 00216 { 00217 /* 00218 It is forbidden to do assignments like 00219 some_string = substring_of_that_string 00220 */ 00221 DBUG_ASSERT(!s.uses_buffer_owned_by(this)); 00222 free(); 00223 Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length; 00224 alloced=0; 00225 } 00226 return *this; 00227 }
Here is the call graph for this function:

Definition at line 209 of file sql_string.h.
References alloced, Alloced_length, DBUG_ASSERT, free(), Ptr, str_length, and uses_buffer_owned_by().
00210 { 00211 if (&s != this) 00212 { 00213 /* 00214 It is forbidden to do assignments like 00215 some_string = substring_of_that_string 00216 */ 00217 DBUG_ASSERT(!s.uses_buffer_owned_by(this)); 00218 free(); 00219 Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length; 00220 alloced=0; 00221 } 00222 return *this; 00223 }
Here is the call graph for this function:

| char& String::operator[] | ( | uint32 | i | ) | const [inline] |
| char& String::operator[] | ( | uint32 | i | ) | const [inline] |
Definition at line 327 of file sql_string.h.
References Alloced_length, realloc(), and str_length.
00328 { 00329 uint32 new_length= arg_length + str_length; 00330 if (new_length > Alloced_length) 00331 { 00332 if (realloc(new_length + step_alloc)) 00333 return 0; 00334 } 00335 uint32 old_length= str_length; 00336 str_length+= arg_length; 00337 return Ptr+ old_length; /* Area to use */ 00338 }
Here is the call graph for this function:

Definition at line 323 of file sql_string.h.
References Alloced_length, realloc(), and str_length.
Referenced by Protocol_prep::store(), Protocol_prep::store_long(), Protocol_prep::store_longlong(), and Protocol_prep::store_short().
00324 { 00325 uint32 new_length= arg_length + str_length; 00326 if (new_length > Alloced_length) 00327 { 00328 if (realloc(new_length + step_alloc)) 00329 return 0; 00330 } 00331 uint32 old_length= str_length; 00332 str_length+= arg_length; 00333 return Ptr+ old_length; /* Area to use */ 00334 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void String::print | ( | String * | ) |
| void String::print | ( | String * | ) |
Definition at line 842 of file sql_string.cc.
References append(), and str_length.
Referenced by Item_func_set_collation::print(), and Item_string::print().
00843 { 00844 char *st= (char*)Ptr, *end= st+str_length; 00845 for (; st < end; st++) 00846 { 00847 uchar c= *st; 00848 switch (c) 00849 { 00850 case '\\': 00851 str->append("\\\\", 2); 00852 break; 00853 case '\0': 00854 str->append("\\0", 2); 00855 break; 00856 case '\'': 00857 str->append("\\'", 2); 00858 break; 00859 case '\n': 00860 str->append("\\n", 2); 00861 break; 00862 case '\r': 00863 str->append("\\r", 2); 00864 break; 00865 case 26: //Ctrl-Z 00866 str->append("\\z", 2); 00867 break; 00868 default: 00869 str->append(c); 00870 } 00871 } 00872 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* String::ptr | ( | ) | const [inline] |
| const char* String::ptr | ( | ) | const [inline] |
Definition at line 87 of file sql_string.h.
Referenced by field_str::add(), append(), append_escaped(), Table_triggers_list::change_table_name_in_triggers(), change_to_use_tmp_fields(), sys_var_thd_storage_engine::check(), sys_var_thd_date_time_format::check(), sys_var_str::check(), sys_var::check_enum(), Item_str_func::check_well_formed_result(), close_temporary_tables(), com_edit(), Arg_comparator::compare_binary_string(), construct_prompt(), Item_param::convert_str_value(), Field_blob::copy(), sp_head::create(), create_field::create_field(), create_typelib(), db_create_routine(), db_find_routine(), Event_scheduler::dump_internal_status(), XPathFilter::element(), ha_tina::encode_quote(), analyse::end_of_records(), Prepared_statement::execute(), sp_head::execute_function(), execute_sqlcom_select(), ha_tina::find_current_row(), Item_func_like::fix_fields(), Item_name_const::fix_fields(), fix_history(), Item_xml_str_func::fix_length_and_dec(), Item_func_sp::func_name(), Item_func_str_to_date::get_date(), Item::get_date(), Field::get_date(), get_dynamic_sql_string(), get_field(), get_interval_value(), get_mm_leaf(), ha_archive::get_row(), get_schema_column_record(), get_schema_partitions_record(), get_schema_views_record(), Item::get_time(), Field::get_time(), Ndb_item::get_val(), GRANT_COLUMN::GRANT_COLUMN(), Item_func_user::init(), Item_func_match::init_search(), Item_func_conv_charset::Item_func_conv_charset(), Load_log_event::Load_log_event(), main(), make_date(), make_date_time(), make_datetime(), make_sortkey(), make_time(), Item_sum_hybrid::min_max_update_str_field(), my_decimal2string(), mysql_checksum_table(), mysql_create_or_drop_trigger(), mysql_prepare_table(), mysql_register_view(), mysql_show_grants(), mysql_table_grant(), mysqld_dump_create_info(), Item_string::new_item(), pack_fields(), Item_xml_str_func::parse_xml(), Item_nodeset_func::prepare(), Protocol_prep::prepare_for_resend(), Item_nodeset_func::prepare_nodes(), handler::print_error(), print_field_values(), print_ror_scans_arr(), print_sel_tree(), print_table_data_xml(), print_where(), read_and_execute(), READ_INFO::READ_INFO(), replace_column_table(), resolve_const_item(), Item_func_sysconst::safe_charset_converter(), Item_hex_string::safe_charset_converter(), Item_static_string_func::safe_charset_converter(), Item_param::safe_charset_converter(), Item_string::safe_charset_converter(), Item_static_float_func::safe_charset_converter(), Item_num::safe_charset_converter(), Item_hex_string::save_in_field(), Item_string::save_in_field(), Item_copy_string::save_in_field(), Item_param::save_in_field(), select_describe(), Item_func_like::select_optimize(), Item::send(), Field::send_binary(), Protocol::send_fields(), set(), sortcmp(), sp_find_routine(), Field_bit_as_char::sql_type(), Field_bit::sql_type(), Field_set::sql_type(), Field_enum::sql_type(), Field_varstring::sql_type(), Field_string::sql_type(), Field_year::sql_type(), Field_double::sql_type(), Field_float::sql_type(), Field_long::sql_type(), Field_medium::sql_type(), Field_short::sql_type(), Field_tiny::sql_type(), Field_new_decimal::sql_type(), Field_decimal::sql_type(), srtcmp_in(), Field_set::store(), Field_enum::store(), Field_blob::store(), Field_varstring::store(), Field_string::store(), Field_decimal::store(), Protocol_simple::store(), Protocol::store(), store_create_info(), Field_longstr::store_decimal(), Protocol_prep::store_decimal(), Protocol_simple::store_decimal(), Protocol_prep::store_null(), store_schema_proc(), Protocol::store_string_aux(), str2my_decimal(), stringcmp(), strrstr(), strstr(), subst_spvars(), sys_var_thd_sql_mode::symbolic_mode_representation(), sys_check_log_path(), TEST_filesort(), test_if_string_in_list(), typelib(), tz_load_from_open_tables(), ha_tina::update_row(), update_sys_var_str(), update_sys_var_str_path(), Item_str_func::val_decimal(), Item_func_numhybrid::val_decimal(), Item::val_decimal_from_string(), Item_proc_string::val_int(), Item_nodeset_to_const_comparator::val_int(), Item_func_xpath_count::val_int(), Item_func_xpath_position::val_int(), Item_extract::val_int(), Item_func_group_concat::val_int(), Item_func_crc32::val_int(), Item_func_uncompressed_length::val_int(), Item_str_func::val_int(), Item_func_is_used_lock::val_int(), Item_func_is_free_lock::val_int(), Item_func_inet_aton::val_int(), Item_func_release_lock::val_int(), Item_func_get_lock::val_int(), Item_func_ord::val_int(), Item_func_locate::val_int(), Item_func_numhybrid::val_int(), Item_func_like::val_int(), Item_copy_string::val_int(), Item_cache_str::val_int(), Item_hex_string::val_int(), Item_param::val_int(), Item_string::val_int(), Field::val_int_as_str(), Item_func_signed::val_int_from_str(), Item_nodeset_func_parentbyname::val_nodeset(), Item_nodeset_func_ancestorbyname::val_nodeset(), Item_nodeset_func_union::val_nodeset(), Item_proc_string::val_real(), Item_func_xpath_sum::val_real(), Item_sum_hybrid::val_real(), Item_str_func::val_real(), Item_func_match::val_real(), Item_func_numhybrid::val_real(), Item_copy_string::val_real(), Item_cache_str::val_real(), Item_param::val_real(), Item_string::val_real(), Item_func_xml_update::val_str(), Item_nodeset_func::val_str(), Item_func_get_format::val_str(), Item_char_typecast::val_str(), Item_func_date_format::val_str(), Item_func_uuid::val_str(), Item_func_quote::val_str(), Item_load_file::val_str(), Item_func_unhex::val_str(), Item_func_hex::val_str(), Item_func_conv_charset::val_str(), Item_func_conv::val_str(), Item_func_rpad::val_str(), Item_func_repeat::val_str(), Item_func_format::val_str(), Item_func_soundex::val_str(), Item_func_decode::val_str(), Item_func_encode::val_str(), Item_func_trim::val_str(), Item_func_rtrim::val_str(), Item_func_ltrim::val_str(), Item_func_substr_index::val_str(), Item_str_conv::val_str(), Item_func_replace::val_str(), Item_func_reverse::val_str(), Item_func_concat_ws::val_str(), Item_func_des_decrypt::val_str(), Item_func_des_encrypt::val_str(), Item_func_concat::val_str(), Item_func_aes_decrypt::val_str(), Item_func_aes_encrypt::val_str(), Item_func_sha::val_str(), Item_func_md5::val_str(), Item_param::val_str(), Item_sp_variable::val_str(), Field_timestamp::val_str(), sys_var_thd_time_zone::value_ptr(), sys_var_log_output::value_ptr(), Protocol::write(), write_parameter(), and ha_tina::write_row().
00087 { return Ptr; }
Here is the caller graph for this function:

| void String::q_append | ( | const char * | data, | |
| uint32 | data_len | |||
| ) | [inline] |
Definition at line 303 of file sql_string.h.
References memcpy, and str_length.
00304 { 00305 memcpy(Ptr + str_length, data, data_len); 00306 str_length += data_len; 00307 }
| void String::q_append | ( | double * | d | ) | [inline] |
Definition at line 298 of file sql_string.h.
References float8store, and str_length.
00299 { 00300 float8store(Ptr + str_length, *d); 00301 str_length += 8; 00302 }
| void String::q_append | ( | double | d | ) | [inline] |
Definition at line 293 of file sql_string.h.
References float8store, and str_length.
00294 { 00295 float8store(Ptr + str_length, d); 00296 str_length += 8; 00297 }
| void String::q_append | ( | const uint32 | n | ) | [inline] |
Definition at line 288 of file sql_string.h.
References int4store, and str_length.
00289 { 00290 int4store(Ptr + str_length, n); 00291 str_length += 4; 00292 }
| void String::q_append | ( | const char | c | ) | [inline] |
Definition at line 284 of file sql_string.h.
References str_length.
00285 { 00286 Ptr[str_length++] = c; 00287 }
| void String::q_append | ( | const char * | data, | |
| uint32 | data_len | |||
| ) | [inline] |
Definition at line 299 of file sql_string.h.
References memcpy, and str_length.
00300 { 00301 memcpy(Ptr + str_length, data, data_len); 00302 str_length += data_len; 00303 }
| void String::q_append | ( | double * | d | ) | [inline] |
Definition at line 294 of file sql_string.h.
References float8store, and str_length.
00295 { 00296 float8store(Ptr + str_length, *d); 00297 str_length += 8; 00298 }
| void String::q_append | ( | double | d | ) | [inline] |
Definition at line 289 of file sql_string.h.
References float8store, and str_length.
00290 { 00291 float8store(Ptr + str_length, d); 00292 str_length += 8; 00293 }
| void String::q_append | ( | const uint32 | n | ) | [inline] |
Definition at line 284 of file sql_string.h.
References int4store, and str_length.
00285 { 00286 int4store(Ptr + str_length, n); 00287 str_length += 4; 00288 }
| void String::q_append | ( | const char | c | ) | [inline] |
Definition at line 280 of file sql_string.h.
References str_length.
Referenced by close_temporary_tables().
00281 { 00282 Ptr[str_length++] = c; 00283 }
Here is the caller graph for this function:

| void String::qs_append | ( | uint | i | ) |
| void String::qs_append | ( | int | i | ) |
| void String::qs_append | ( | const char | c | ) | [inline] |
Definition at line 317 of file sql_string.h.
References str_length.
00318 { 00319 Ptr[str_length]= c; 00320 str_length++; 00321 }
| void String::qs_append | ( | double * | d | ) |
| void String::qs_append | ( | double | d | ) |
| void String::qs_append | ( | const char * | str, | |
| uint32 | len | |||
| ) |
| void String::qs_append | ( | uint | i | ) |
Definition at line 694 of file sql_string.cc.
References int(), int10_to_str(), and str_length.
00695 { 00696 char *buff= Ptr + str_length; 00697 char *end= int10_to_str(i, buff, 10); 00698 str_length+= (int) (end-buff); 00699 }
Here is the call graph for this function:

| void String::qs_append | ( | int | i | ) |
Definition at line 687 of file sql_string.cc.
References int(), int10_to_str(), and str_length.
00688 { 00689 char *buff= Ptr + str_length; 00690 char *end= int10_to_str(i, buff, -10); 00691 str_length+= (int) (end-buff); 00692 }
Here is the call graph for this function:

| void String::qs_append | ( | const char | c | ) | [inline] |
Definition at line 313 of file sql_string.h.
References str_length.
00314 { 00315 Ptr[str_length]= c; 00316 str_length++; 00317 }
| void String::qs_append | ( | double * | d | ) |
Definition at line 680 of file sql_string.cc.
References float8get, and qs_append().
Here is the call graph for this function:

| void String::qs_append | ( | double | d | ) |
Definition at line 674 of file sql_string.cc.
References my_sprintf, and str_length.
00675 { 00676 char *buff = Ptr + str_length; 00677 str_length+= my_sprintf(buff, (buff, "%.14g", d)); 00678 }
| void String::qs_append | ( | const char * | str, | |
| uint32 | len | |||
| ) |
Definition at line 668 of file sql_string.cc.
References memcpy, and str_length.
Referenced by sp_instr_set_case_expr::print(), sp_instr_error::print(), sp_instr_cfetch::print(), sp_instr_cclose::print(), sp_instr_copen::print(), sp_instr_cpop::print(), sp_instr_cpush::print(), sp_instr_hreturn::print(), sp_instr_hpop::print(), sp_instr_hpush_jump::print(), sp_instr_freturn::print(), sp_instr_jump_if_not::print(), sp_instr_jump::print(), sp_instr_set::print(), sp_instr_stmt::print(), Item_case_expr::print(), Item_splocal::print(), and qs_append().
00669 { 00670 memcpy(Ptr + str_length, str, len + 1); 00671 str_length += len; 00672 }
Here is the caller graph for this function:

Definition at line 45 of file sql_string.cc.
References ALIGN_SIZE, alloced, Alloced_length, FALSE, free(), my_malloc(), MY_WME, MYF, str_length, and TRUE.
Referenced by alloc(), shrink(), and String().
00046 { 00047 arg_length=ALIGN_SIZE(arg_length+1); 00048 str_length=0; 00049 if (Alloced_length < arg_length) 00050 { 00051 free(); 00052 if (!(Ptr=(char*) my_malloc(arg_length,MYF(MY_WME)))) 00053 return TRUE; 00054 Alloced_length=arg_length; 00055 alloced=1; 00056 } 00057 Ptr[0]=0; 00058 return FALSE; 00059 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 67 of file sql_string.cc.
References ALIGN_SIZE, alloced, Alloced_length, FALSE, memcpy, my_malloc(), my_realloc(), MY_WME, MYF, str_length, and TRUE.
Referenced by append(), append_escaped(), append_with_prefill(), c_ptr(), c_ptr_safe(), copy(), fill(), main(), prep_append(), replace(), reserve(), Protocol::send_fields(), Item_func_uuid::val_str(), Item_func_char::val_str(), and Item_func_reverse::val_str().
00068 { 00069 uint32 len=ALIGN_SIZE(alloc_length+1); 00070 if (Alloced_length < len) 00071 { 00072 char *new_ptr; 00073 if (alloced) 00074 { 00075 if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME)))) 00076 { 00077 Ptr=new_ptr; 00078 Alloced_length=len; 00079 } 00080 else 00081 return TRUE; // Signal error 00082 } 00083 else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME)))) 00084 { 00085 if (str_length) // Avoid bugs in memcpy on AIX 00086 memcpy(new_ptr,Ptr,str_length); 00087 new_ptr[str_length]=0; 00088 Ptr=new_ptr; 00089 Alloced_length=len; 00090 alloced=1; 00091 } 00092 else 00093 return TRUE; // Signal error 00094 } 00095 Ptr[alloc_length]=0; // This make other funcs shorter 00096 return FALSE; 00097 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 626 of file sql_string.cc.
References bmove(), bmove_upp(), FALSE, memcpy, realloc(), str_length, and TRUE.
Referenced by replace(), Item_func_insert::val_str(), Item_func_replace::val_str(), Item_func_concat_ws::val_str(), and Item_func_concat::val_str().
00628 { 00629 long diff = (long) length-(long) arg_length; 00630 if (offset+arg_length <= str_length) 00631 { 00632 if (diff < 0) 00633 { 00634 if (length) 00635 memcpy(Ptr+offset,to,length); 00636 bmove(Ptr+offset+length,Ptr+offset+arg_length, 00637 str_length-offset-arg_length); 00638 } 00639 else 00640 { 00641 if (diff) 00642 { 00643 if (realloc(str_length+(uint32) diff)) 00644 return TRUE; 00645 bmove_upp(Ptr+str_length+diff,Ptr+str_length, 00646 str_length-offset-arg_length); 00647 } 00648 if (length) 00649 memcpy(Ptr+offset,to,length); 00650 } 00651 str_length+=(uint32) diff; 00652 } 00653 return FALSE; 00654 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int String::reserve | ( | uint32 | space_needed | ) | [inline] |
Definition at line 273 of file sql_string.h.
References realloc(), and str_length.
00274 { 00275 return realloc(str_length + space_needed); 00276 }
Here is the call graph for this function:

Definition at line 658 of file sql_string.cc.
References Alloced_length, FALSE, max, realloc(), str_length, and TRUE.
00659 { 00660 if (Alloced_length < str_length + space_needed) 00661 { 00662 if (realloc(Alloced_length + max(space_needed, grow_by) - 1)) 00663 return TRUE; 00664 } 00665 return FALSE; 00666 }
Here is the call graph for this function:

| int String::reserve | ( | uint32 | space_needed | ) | [inline] |
Definition at line 269 of file sql_string.h.
References realloc(), and str_length.
Referenced by append_identifier(), sp_instr_set_case_expr::print(), sp_instr_error::print(), sp_instr_cfetch::print(), sp_instr_cclose::print(), sp_instr_copen::print(), sp_instr_cpop::print(), sp_instr_cpush::print(), sp_instr_hreturn::print(), sp_instr_hpop::print(), sp_instr_hpush_jump::print(), sp_instr_freturn::print(), sp_instr_jump_if_not::print(), sp_instr_jump::print(), sp_instr_set::print(), sp_instr_stmt::print(), Item_splocal::print(), Item_param::query_val_str(), and Item_param::val_str().
00270 { 00271 return realloc(str_length + space_needed); 00272 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool String::set | ( | ulonglong | num, | |
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 145 of file sql_string.h.
References set_int().
Here is the call graph for this function:

| bool String::set | ( | longlong | num, | |
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 143 of file sql_string.h.
References set_int().
00144 { return set_int(num, false, cs); }
Here is the call graph for this function:

| void String::set | ( | const char * | str, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 127 of file sql_string.h.
References alloced, Alloced_length, free(), str_charset, and str_length.
00128 { 00129 free(); 00130 Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0; 00131 str_charset=cs; 00132 }
Here is the call graph for this function:

| void String::set | ( | char * | str, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 121 of file sql_string.h.
References alloced, Alloced_length, free(), str_charset, and str_length.
00122 { 00123 free(); 00124 Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0; 00125 str_charset=cs; 00126 }
Here is the call graph for this function:

Definition at line 110 of file sql_string.h.
References alloced, Alloced_length, DBUG_ASSERT, free(), ptr(), str_charset, and str_length.
00111 { 00112 DBUG_ASSERT(&str != this); 00113 free(); 00114 Ptr=(char*) str.ptr()+offset; str_length=arg_length; alloced=0; 00115 if (str.Alloced_length) 00116 Alloced_length=str.Alloced_length-offset; 00117 else 00118 Alloced_length=0; 00119 str_charset=str.str_charset; 00120 }
Here is the call graph for this function:

| bool String::set | ( | double | num, | |
| uint | decimals, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 121 of file sql_string.cc.
References alloc(), copy(), FALSE, int(), my_charset_latin1, my_isdigit, my_sprintf, NOT_FIXED_DEC, pos(), str_charset, str_length, strlen(), to, TRUE, and VOID.
00122 { 00123 char buff[331]; 00124 uint dummy_errors; 00125 00126 str_charset=cs; 00127 if (decimals >= NOT_FIXED_DEC) 00128 { 00129 uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME 00130 return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); 00131 } 00132 #ifdef HAVE_FCONVERT 00133 int decpt,sign; 00134 char *pos,*to; 00135 00136 VOID(fconvert(num,(int) decimals,&decpt,&sign,buff+1)); 00137 if (!my_isdigit(&my_charset_latin1, buff[1])) 00138 { // Nan or Inf 00139 pos=buff+1; 00140 if (sign) 00141 { 00142 buff[0]='-'; 00143 pos=buff; 00144 } 00145 uint dummy_errors; 00146 return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors); 00147 } 00148 if (alloc((uint32) ((uint32) decpt+3+decimals))) 00149 return TRUE; 00150 to=Ptr; 00151 if (sign) 00152 *to++='-'; 00153 00154 pos=buff+1; 00155 if (decpt < 0) 00156 { /* value is < 0 */ 00157 *to++='0'; 00158 if (!decimals) 00159 goto end; 00160 *to++='.'; 00161 if ((uint32) -decpt > decimals) 00162 decpt= - (int) decimals; 00163 decimals=(uint32) ((int) decimals+decpt); 00164 while (decpt++ < 0) 00165 *to++='0'; 00166 } 00167 else if (decpt == 0) 00168 { 00169 *to++= '0'; 00170 if (!decimals) 00171 goto end; 00172 *to++='.'; 00173 } 00174 else 00175 { 00176 while (decpt-- > 0) 00177 *to++= *pos++; 00178 if (!decimals) 00179 goto end; 00180 *to++='.'; 00181 } 00182 while (decimals--) 00183 *to++= *pos++; 00184 00185 end: 00186 *to=0; 00187 str_length=(uint32) (to-Ptr); 00188 return FALSE; 00189 #else 00190 #ifdef HAVE_SNPRINTF 00191 buff[sizeof(buff)-1]=0; // Safety 00192 snprintf(buff,sizeof(buff)-1, "%.*f",(int) decimals,num); 00193 #else 00194 sprintf(buff,"%.*f",(int) decimals,num); 00195 #endif 00196 return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs, 00197 &dummy_errors); 00198 #endif 00199 }
Here is the call graph for this function:

| bool String::set | ( | ulonglong | num, | |
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 110 of file sql_string.cc.
References alloc(), charset_info_st::cset, FALSE, my_charset_handler_st::longlong10_to_str, charset_info_st::mbmaxlen, str_charset, str_length, and TRUE.
00111 { 00112 uint l=20*cs->mbmaxlen+1; 00113 00114 if (alloc(l)) 00115 return TRUE; 00116 str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,10,num); 00117 str_charset=cs; 00118 return FALSE; 00119 }
Here is the call graph for this function:

| bool String::set | ( | longlong | num, | |
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 99 of file sql_string.cc.
References alloc(), charset_info_st::cset, FALSE, my_charset_handler_st::longlong10_to_str, charset_info_st::mbmaxlen, str_charset, str_length, and TRUE.
00100 { 00101 uint l=20*cs->mbmaxlen+1; 00102 00103 if (alloc(l)) 00104 return TRUE; 00105 str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,-10,num); 00106 str_charset=cs; 00107 return FALSE; 00108 }
Here is the call graph for this function:

| void String::set | ( | const char * | str, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 126 of file sql_string.h.
References alloced, Alloced_length, free(), str_charset, and str_length.
00127 { 00128 free(); 00129 Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0; 00130 str_charset=cs; 00131 }
Here is the call graph for this function:

| void String::set | ( | char * | str, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 120 of file sql_string.h.
References alloced, Alloced_length, free(), str_charset, and str_length.
00121 { 00122 free(); 00123 Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0; 00124 str_charset=cs; 00125 }
Here is the call graph for this function:

Definition at line 109 of file sql_string.h.
References alloced, Alloced_length, DBUG_ASSERT, free(), ptr(), str_charset, and str_length.
Referenced by collect_longlong(), collect_ulonglong(), Item_param::convert_str_value(), Event_scheduler::dump_internal_status(), analyse::end_of_records(), get_dynamic_sql_string(), get_field(), field_ulonglong::get_max_arg(), field_longlong::get_max_arg(), field_ulonglong::get_min_arg(), field_longlong::get_min_arg(), get_schema_column_record(), get_schema_partitions_record(), ha_archive::ha_archive(), ha_tina::ha_tina(), Item_func_match::init_search(), Item_bin_string::Item_bin_string(), Item_func_user::Item_func_user(), Item_hex_string::Item_hex_string(), my_tz_init(), mysql_create_or_drop_trigger(), Item_char_typecast::print(), Item_func_format::print(), Item_func_benchmark::print(), Item_uint::print(), Item_int::print(), Item_param::query_val_str(), Item_string::safe_charset_converter(), Item_proc_string::set(), set_ascii(), set_or_copy_aligned(), Event_scheduler::stop_all_running_events(), Item_cache_str::store(), tz_load_from_open_tables(), Item_nodeset_to_const_comparator::val_int(), Item_proc_int::val_str(), Item_func_weekday::val_str(), Item_func_month::val_str(), Item_func_get_format::val_str(), Item_func_sysdate_local::val_str(), Item_func_now::val_str(), Item_func_curtime::val_str(), Item_func_dayname::val_str(), Item_func_monthname::val_str(), Item_in_subselect::val_str(), Item_exists_subselect::val_str(), Item_func_encrypt::val_str(), Item_func_old_password::val_str(), Item_func_password::val_str(), Item_func_trim::val_str(), Item_func_rtrim::val_str(), Item_func_ltrim::val_str(), Item_func_substr_index::val_str(), Item_func_substr::val_str(), Item_func_right::val_str(), Item_func_left::val_str(), Item_cache_int::val_str(), Item_param::val_str(), Item_uint::val_str(), Item_int::val_str(), Item_sp_variable::val_str(), Field_timestamp::val_str(), and write_parameter().
00110 { 00111 DBUG_ASSERT(&str != this); 00112 free(); 00113 Ptr=(char*) str.ptr()+offset; str_length=arg_length; alloced=0; 00114 if (str.Alloced_length) 00115 Alloced_length=str.Alloced_length-offset; 00116 else 00117 Alloced_length=0; 00118 str_charset=str.str_charset; 00119 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 379 of file sql_string.cc.
References copy(), charset_info_st::mbminlen, my_charset_latin1, set(), and str_charset.
Referenced by Item_func_trim::fix_length_and_dec(), Field_blob::sql_type(), Field_datetime::sql_type(), Field_newdate::sql_type(), Field_date::sql_type(), Field_time::sql_type(), Field_timestamp::sql_type(), Field_double::sql_type(), Field_float::sql_type(), and Field_null::sql_type().
00380 { 00381 if (str_charset->mbminlen == 1) 00382 { 00383 set(str, arg_length, str_charset); 00384 return 0; 00385 } 00386 uint dummy_errors; 00387 return copy(str, arg_length, &my_charset_latin1, str_charset, &dummy_errors); 00388 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void String::set_charset | ( | CHARSET_INFO * | charset | ) | [inline] |
Definition at line 80 of file sql_string.h.
References charset(), and str_charset.
00080 { str_charset= charset; }
Here is the call graph for this function:

| void String::set_charset | ( | CHARSET_INFO * | charset | ) | [inline] |
Definition at line 80 of file sql_string.h.
References charset(), and str_charset.
Referenced by Item_param::convert_str_value(), db_create_routine(), db_load_routine(), Item_func_group_concat::fix_fields(), Item_xml_str_func::fix_length_and_dec(), Item_func_trim::fix_length_and_dec(), make_date(), make_date_time(), make_datetime(), make_time(), mysql_rm_table_part2(), Item_param::reset(), in_string::set(), Events::show_create_event(), Item_func_ifnull::str_op(), Item_ref::str_result(), Item_field::str_result(), Item_func_xml_update::val_str(), Item_nodeset_func::val_str(), Item_typecast::val_str(), Item_char_typecast::val_str(), Item_func_binary::val_str(), Item_func_uuid::val_str(), Item_func_quote::val_str(), Item_func_export_set::val_str(), Item_func_set_collation::val_str(), Item_func_lpad::val_str(), Item_func_char::val_str(), Item_func_elt::val_str(), Item_func_soundex::val_str(), Item_func_encode::val_str(), Item_func_substr_index::val_str(), Item_str_conv::val_str(), Item_func_replace::val_str(), Item_func_reverse::val_str(), Item_func_concat_ws::val_str(), Item_func_concat::val_str(), Item_func_min_max::val_str(), Item_func_if::val_str(), Item_param::val_str(), Item_decimal::val_str(), Item_field::val_str(), and Field_timestamp::val_str().
00080 { str_charset= charset; }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool String::set_int | ( | longlong | num, | |
| bool | unsigned_flag, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 99 of file sql_string.cc.
References alloc(), charset_info_st::cset, FALSE, my_charset_handler_st::longlong10_to_str, charset_info_st::mbmaxlen, str_charset, str_length, and TRUE.
Referenced by set(), Field_blob::store(), Item_sum_hybrid::val_str(), Item_func_min_max::val_str(), Item_func_numhybrid::val_str(), Item_int_func::val_str(), and Item::val_string_from_int().
00100 { 00101 uint l=20*cs->mbmaxlen+1; 00102 int base= unsigned_flag ? 10 : -10; 00103 00104 if (alloc(l)) 00105 return TRUE; 00106 str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,base,num); 00107 str_charset=cs; 00108 return FALSE; 00109 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool String::set_or_copy_aligned | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) |
| bool String::set_or_copy_aligned | ( | const char * | s, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 320 of file sql_string.cc.
References copy_aligned(), FALSE, charset_info_st::mbminlen, offset, and set().
Referenced by Item_string::Item_string().
00322 { 00323 /* How many bytes are in incomplete character */ 00324 uint32 offset= (arg_length % cs->mbminlen); 00325 00326 if (!offset) /* All characters are complete, just copy */ 00327 { 00328 set(str, arg_length, cs); 00329 return FALSE; 00330 } 00331 return copy_aligned(str, arg_length, offset, cs); 00332 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void String::set_quick | ( | char * | str, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 134 of file sql_string.h.
References alloced, Alloced_length, str_charset, and str_length.
00135 { 00136 if (!alloced) 00137 { 00138 Ptr=(char*) str; str_length=Alloced_length=arg_length; 00139 } 00140 str_charset=cs; 00141 }
| void String::set_quick | ( | char * | str, | |
| uint32 | arg_length, | |||
| CHARSET_INFO * | cs | |||
| ) | [inline] |
Definition at line 133 of file sql_string.h.
References alloced, Alloced_length, str_charset, and str_length.
Referenced by Item::save_in_field().
00134 { 00135 if (!alloced) 00136 { 00137 Ptr=(char*) str; str_length=Alloced_length=arg_length; 00138 } 00139 str_charset=cs; 00140 }
Here is the caller graph for this function:

| bool String::set_real | ( | double | num, | |
| uint | decimals, | |||
| CHARSET_INFO * | cs | |||
| ) |
Definition at line 111 of file sql_string.cc.
References alloc(), copy(), FALSE, int(), my_charset_latin1, my_isdigit, my_sprintf, NOT_FIXED_DEC, pos(), str_charset, str_length, strlen(), to, TRUE, and VOID.
Referenced by field_ulonglong::avg(), field_longlong::avg(), field_real::avg(), field_str::avg(), field_decimal::avg(), field_real::get_max_arg(), field_real::get_min_arg(), Item_float::print(), Item_param::query_val_str(), Item_proc_string::set(), field_ulonglong::std(), field_longlong::std(), field_real::std(), field_decimal::std(), Field_blob::store(), Item_proc_real::val_str(), Item_sum_hybrid::val_str(), Item_func_format::val_str(), Item_func_min_max::val_str(), Item_func_numhybrid::val_str(), Item_real_func::val_str(), Item_cache_real::val_str(), Item_param::val_str(), Item_float::val_str(), and Item::val_string_from_real().
00112 { 00113 char buff[331]; 00114 uint dummy_errors; 00115 00116 str_charset=cs; 00117 if (decimals >= NOT_FIXED_DEC) 00118 { 00119 uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME 00120 return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); 00121 } 00122 #ifdef HAVE_FCONVERT 00123 int decpt,sign; 00124 char *pos,*to; 00125 00126 VOID(fconvert(num,(int) decimals,&decpt,&sign,buff+1)); 00127 if (!my_isdigit(&my_charset_latin1, buff[1])) 00128 { // Nan or Inf 00129 pos=buff+1; 00130 if (sign) 00131 { 00132 buff[0]='-'; 00133 pos=buff; 00134 } 00135 uint dummy_errors; 00136 return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors); 00137 } 00138 if (alloc((uint32) ((uint32) decpt+3+decimals))) 00139 return TRUE; 00140 to=Ptr; 00141 if (sign) 00142 *to++='-'; 00143 00144 pos=buff+1; 00145 if (decpt < 0) 00146 { /* value is < 0 */ 00147 *to++='0'; 00148 if (!decimals) 00149 goto end; 00150 *to++='.'; 00151 if ((uint32) -decpt > decimals) 00152 decpt= - (int) decimals; 00153 decimals=(uint32) ((int) decimals+decpt); 00154 while (decpt++ < 0) 00155 *to++='0'; 00156 } 00157 else if (decpt == 0) 00158 { 00159 *to++= '0'; 00160 if (!decimals) 00161 goto end; 00162 *to++='.'; 00163 } 00164 else 00165 { 00166 while (decpt-- > 0) 00167 *to++= *pos++; 00168 if (!decimals) 00169 goto end; 00170 *to++='.'; 00171 } 00172 while (decimals--) 00173 *to++= *pos++; 00174 00175 end: 00176 *to=0; 00177 str_length=(uint32) (to-Ptr); 00178 return FALSE; 00179 #else 00180 #ifdef HAVE_SNPRINTF 00181 buff[sizeof(buff)-1]=0; // Safety 00182 snprintf(buff,sizeof(buff)-1, "%.*f",(int) decimals,num); 00183 #else 00184 sprintf(buff,"%.*f",(int) decimals,num); 00185 #endif 00186 return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs, 00187 &dummy_errors); 00188 #endif 00189 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void String::shrink | ( | uint32 | arg_length | ) | [inline] |
Definition at line 195 of file sql_string.h.
References Alloced_length, my_realloc(), MYF, and real_alloc().
00196 { 00197 if (arg_length < Alloced_length) 00198 { 00199 char *new_ptr; 00200 if (!(new_ptr=(char*) my_realloc(Ptr,arg_length,MYF(0)))) 00201 { 00202 Alloced_length = 0; 00203 real_alloc(arg_length); 00204 } 00205 else 00206 { 00207 Ptr=new_ptr; 00208 Alloced_length=arg_length; 00209 } 00210 } 00211 }
Here is the call graph for this function:

| void String::shrink | ( | uint32 | arg_length | ) | [inline] |
Definition at line 191 of file sql_string.h.
References Alloced_length, my_realloc(), MYF, and real_alloc().
Referenced by append().
00192 { 00193 if (arg_length < Alloced_length) 00194 { 00195 char *new_ptr; 00196 if (!(new_ptr=(char*) my_realloc(Ptr,arg_length,MYF(0)))) 00197 { 00198 Alloced_length = 0; 00199 real_alloc(arg_length); 00200 } 00201 else 00202 { 00203 Ptr=new_ptr; 00204 Alloced_length=arg_length; 00205 } 00206 } 00207 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void String::strip_sp | ( | ) |
| void String::strip_sp | ( | ) |
Definition at line 407 of file sql_string.cc.
References my_isspace, str_charset, and str_length.
00408 { 00409 while (str_length && my_isspace(str_charset,Ptr[str_length-1])) 00410 str_length--; 00411 }
Definition at line 588 of file sql_string.cc.
References length(), ptr(), search_end(), skip(), and str_length.
Referenced by Item_func_substr_index::val_str().
00589 { 00590 if (s.length() <= offset && offset <= str_length) 00591 { 00592 if (!s.length()) 00593 return offset; // Empty string is always found 00594 register const char *str = Ptr+offset-1; 00595 register const char *search=s.ptr()+s.length()-1; 00596 00597 const char *end=Ptr+s.length()-2; 00598 const char *search_end=s.ptr()-1; 00599 skip: 00600 while (str != end) 00601 { 00602 if (*str-- == *search) 00603 { 00604 register char *i,*j; 00605 i=(char*) str; j=(char*) search-1; 00606 while (j != search_end) 00607 if (*i-- != *j--) goto skip; 00608 return (int) (i-Ptr) +1; 00609 } 00610 } 00611 } 00612 return -1; 00613 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 557 of file sql_string.cc.
References length(), ptr(), search_end(), skip(), and str_length.
Referenced by Item_func_substr_index::val_str(), and Item_func_replace::val_str().
00558 { 00559 if (s.length()+offset <= str_length) 00560 { 00561 if (!s.length()) 00562 return ((int) offset); // Empty string is always found 00563 00564 register const char *str = Ptr+offset; 00565 register const char *search=s.ptr(); 00566 const char *end=Ptr+str_length-s.length()+1; 00567 const char *search_end=s.ptr()+s.length(); 00568 skip: 00569 while (str != end) 00570 { 00571 if (*str++ == *search) 00572 { 00573 register char *i,*j; 00574 i=(char*) str; j=(char*) search+1; 00575 while (j != search_end) 00576 if (*i++ != *j++) goto skip; 00577 return (int) (str-Ptr) -1; 00578 } 00579 } 00580 } 00581 return -1; 00582 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void String::swap | ( | String & | s | ) |
| void String::swap | ( | String & | s | ) |
Definition at line 885 of file sql_string.cc.
References alloced, Alloced_length, Ptr, str_charset, str_length, and swap_variables.
00886 { 00887 swap_variables(char *, Ptr, s.Ptr); 00888 swap_variables(uint32, str_length, s.str_length); 00889 swap_variables(uint32, Alloced_length, s.Alloced_length); 00890 swap_variables(bool, alloced, s.alloced); 00891 swap_variables(CHARSET_INFO*, str_charset, s.str_charset); 00892 }
Definition at line 354 of file sql_string.h.
References alloced, Ptr, and str_length.
00355 { 00356 return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length); 00357 }
Definition at line 350 of file sql_string.h.
References alloced, Ptr, and str_length.
Referenced by operator=(), and in_string::set().
00351 { 00352 return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length); 00353 }
Here is the caller graph for this function:

| void String::write_at_position | ( | int | position, | |
| uint32 | value | |||
| ) | [inline] |
| void String::write_at_position | ( | int | position, | |
| uint32 | value | |||
| ) | [inline] |
Definition at line 754 of file sql_string.cc.
00755 { 00756 if (from->Alloced_length >= from_length) 00757 return from; 00758 if (from->alloced || !to || from == to) 00759 { 00760 (void) from->realloc(from_length); 00761 return from; 00762 } 00763 if (to->realloc(from_length)) 00764 return from; // Actually an error 00765 if ((to->str_length=min(from->str_length,from_length))) 00766 memcpy(to->Ptr,from->Ptr,to->str_length); 00767 to->str_charset=from->str_charset; 00768 return to; 00769 }
Definition at line 754 of file sql_string.cc.
00755 { 00756 if (from->Alloced_length >= from_length) 00757 return from; 00758 if (from->alloced || !to || from == to) 00759 { 00760 (void) from->realloc(from_length); 00761 return from; 00762 } 00763 if (to->realloc(from_length)) 00764 return from; // Actually an error 00765 if ((to->str_length=min(from->str_length,from_length))) 00766 memcpy(to->Ptr,from->Ptr,to->str_length); 00767 to->str_charset=from->str_charset; 00768 return to; 00769 }
| int sortcmp | ( | const String * | a, | |
| const String * | b, | |||
| CHARSET_INFO * | cs | |||
| ) | [friend] |
Definition at line 720 of file sql_string.cc.
00721 { 00722 return cs->coll->strnncollsp(cs, 00723 (unsigned char *) s->ptr(),s->length(), 00724 (unsigned char *) t->ptr(),t->length(), 0); 00725 }
| int sortcmp | ( | const String * | a, | |
| const String * | b, | |||
| CHARSET_INFO * | cs | |||
| ) | [friend] |
Definition at line 720 of file sql_string.cc.
00721 { 00722 return cs->coll->strnncollsp(cs, 00723 (unsigned char *) s->ptr(),s->length(), 00724 (unsigned char *) t->ptr(),t->length(), 0); 00725 }
bool String::alloced [private] |
Definition at line 38 of file sql_string.h.
Referenced by copy(), free(), is_alloced(), operator=(), real_alloc(), realloc(), set(), set_quick(), String(), swap(), and uses_buffer_owned_by().
uint32 String::Alloced_length [private] |
Definition at line 37 of file sql_string.h.
Referenced by alloc(), alloced_length(), append(), c_ptr_quick(), c_ptr_safe(), copy(), free(), mark_as_const(), operator=(), prep_append(), real_alloc(), realloc(), reserve(), set(), set_quick(), shrink(), String(), and swap().
char* String::Ptr [private] |
Definition at line 36 of file sql_string.h.
char* String::Ptr [private] |
Definition at line 36 of file sql_string.h.
Referenced by copy(), operator=(), String(), swap(), and uses_buffer_owned_by().
CHARSET_INFO* String::str_charset [private] |
Definition at line 39 of file sql_string.h.
CHARSET_INFO* String::str_charset [private] |
Definition at line 39 of file sql_string.h.
Referenced by append(), charpos(), charset(), copy(), copy_aligned(), numchars(), set(), set_ascii(), set_charset(), set_int(), set_quick(), set_real(), String(), strip_sp(), and swap().
uint32 String::str_length [private] |
Definition at line 37 of file sql_string.h.
Referenced by append(), append_with_prefill(), c_ptr(), c_ptr_quick(), c_ptr_safe(), charpos(), chop(), copy(), copy_aligned(), fill(), free(), is_empty(), length(), numchars(), operator=(), prep_append(), print(), q_append(), qs_append(), real_alloc(), realloc(), replace(), reserve(), set(), set_int(), set_quick(), set_real(), String(), strip_sp(), strrstr(), strstr(), swap(), and uses_buffer_owned_by().
1.4.7

