#include <item_cmpfunc.h>
Inheritance diagram for in_vector:


Public Member Functions | |
| in_vector () | |
| in_vector (uint elements, uint element_length, qsort2_cmp cmp_func, CHARSET_INFO *cmp_coll) | |
| virtual | ~in_vector () |
| virtual void | set (uint pos, Item *item)=0 |
| virtual byte * | get_value (Item *item)=0 |
| void | sort () |
| int | find (Item *item) |
| virtual Item * | create_item () |
| virtual void | value_to_item (uint pos, Item *item) |
| bool | compare_elems (uint pos1, uint pos2) |
Public Attributes | |
| char * | base |
| uint | size |
| qsort2_cmp | compare |
| CHARSET_INFO * | collation |
| uint | count |
| uint | used_count |
Definition at line 639 of file item_cmpfunc.h.
| in_vector::in_vector | ( | ) | [inline] |
| in_vector::in_vector | ( | uint | elements, | |
| uint | element_length, | |||
| qsort2_cmp | cmp_func, | |||
| CHARSET_INFO * | cmp_coll | |||
| ) | [inline] |
Definition at line 649 of file item_cmpfunc.h.
00651 :base((char*) sql_calloc(elements*element_length)), 00652 size(element_length), compare(cmp_func), collation(cmp_coll), 00653 count(elements), used_count(elements) {}
| virtual in_vector::~in_vector | ( | ) | [inline, virtual] |
| virtual Item* in_vector::create_item | ( | ) | [inline, virtual] |
Reimplemented in in_string, in_longlong, in_double, and in_decimal.
Definition at line 671 of file item_cmpfunc.h.
References NULL.
00671 { return NULL; }
| int in_vector::find | ( | Item * | item | ) |
Definition at line 2090 of file item_cmpfunc.cc.
References base, collation, compare, get_value(), size, start(), and used_count.
Referenced by Item_func_in::val_int().
02091 { 02092 byte *result=get_value(item); 02093 if (!result || !used_count) 02094 return 0; // Null value 02095 02096 uint start,end; 02097 start=0; end=used_count-1; 02098 while (start != end) 02099 { 02100 uint mid=(start+end+1)/2; 02101 int res; 02102 if ((res=(*compare)(collation, base+mid*size, result)) == 0) 02103 return 1; 02104 if (res < 0) 02105 start=mid; 02106 else 02107 end=mid-1; 02108 } 02109 return (int) ((*compare)(collation, base+start*size, result) == 0); 02110 }
Here is the call graph for this function:

Here is the caller graph for this function:

Implemented in in_string, in_longlong, in_double, in_decimal, and in_row.
Referenced by find().
Here is the caller graph for this function:

Implemented in in_string, in_longlong, in_double, in_decimal, and in_row.
Referenced by Item_func_in::fix_length_and_dec().
Here is the caller graph for this function:

| void in_vector::sort | ( | ) | [inline] |
Definition at line 657 of file item_cmpfunc.h.
References base, collation, compare, qsort2(), size, and used_count.
Referenced by Item_func_in::fix_length_and_dec().
Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in in_string, in_longlong, in_double, and in_decimal.
Definition at line 681 of file item_cmpfunc.h.
| char* in_vector::base |
Definition at line 642 of file item_cmpfunc.h.
Referenced by compare_elems(), find(), in_row::in_row(), in_decimal::set(), in_double::set(), in_longlong::set(), in_row::set(), in_string::set(), sort(), in_decimal::value_to_item(), in_double::value_to_item(), in_longlong::value_to_item(), in_string::value_to_item(), in_row::~in_row(), and in_string::~in_string().
Definition at line 645 of file item_cmpfunc.h.
Referenced by compare_elems(), in_string::create_item(), find(), in_row::in_row(), and sort().
Definition at line 644 of file item_cmpfunc.h.
Referenced by compare_elems(), find(), in_row::in_row(), and sort().
Definition at line 646 of file item_cmpfunc.h.
Referenced by in_row::in_row(), and in_string::~in_string().
Definition at line 643 of file item_cmpfunc.h.
Referenced by compare_elems(), find(), in_row::in_row(), and sort().
Definition at line 647 of file item_cmpfunc.h.
Referenced by find(), Item_func_in::fix_length_and_dec(), in_row::in_row(), and sort().
1.4.7

