#include <item_sum.h>
Inheritance diagram for Item_sum_count:


Public Member Functions | |
| Item_sum_count (Item *item_par) | |
| Item_sum_count (THD *thd, Item_sum_count *item) | |
| table_map | used_tables () const |
| bool | const_item () const |
| enum Sumfunctype | sum_func () const |
| void | clear () |
| void | no_rows_in_result () |
| bool | add () |
| void | make_const (longlong count_arg) |
| longlong | val_int () |
| void | reset_field () |
| void | cleanup () |
| void | update_field () |
| const char * | func_name () const |
| Item * | copy_or_same (THD *thd) |
Private Attributes | |
| longlong | count |
| table_map | used_table_cache |
Definition at line 468 of file item_sum.h.
| Item_sum_count::Item_sum_count | ( | Item * | item_par | ) | [inline] |
Definition at line 474 of file item_sum.h.
Referenced by copy_or_same().
00475 :Item_sum_int(item_par),count(0),used_table_cache(~(table_map) 0) 00476 {}
Here is the caller graph for this function:

| Item_sum_count::Item_sum_count | ( | THD * | thd, | |
| Item_sum_count * | item | |||
| ) | [inline] |
Definition at line 477 of file item_sum.h.
00478 :Item_sum_int(thd, item), count(item->count), 00479 used_table_cache(item->used_table_cache) 00480 {}
| bool Item_sum_count::add | ( | ) | [virtual] |
Implements Item_sum.
Definition at line 1023 of file item_sum.cc.
References Item_sum::args, count, Item::maybe_null, Item::null_value, and val_int().
01024 { 01025 if (!args[0]->maybe_null) 01026 count++; 01027 else 01028 { 01029 (void) args[0]->val_int(); 01030 if (!args[0]->null_value) 01031 count++; 01032 } 01033 return 0; 01034 }
Here is the call graph for this function:

| void Item_sum_count::cleanup | ( | ) | [virtual] |
Reimplemented from Item_result_field.
Definition at line 1043 of file item_sum.cc.
References Item_result_field::cleanup(), DBUG_ENTER, DBUG_VOID_RETURN, and used_table_cache.
01044 { 01045 DBUG_ENTER("Item_sum_count::cleanup"); 01046 Item_sum_int::cleanup(); 01047 used_table_cache= ~(table_map) 0; 01048 DBUG_VOID_RETURN; 01049 }
Here is the call graph for this function:

| void Item_sum_count::clear | ( | ) | [virtual] |
Implements Item_sum.
Definition at line 1017 of file item_sum.cc.
References count.
01018 { 01019 count= 0; 01020 }
| bool Item_sum_count::const_item | ( | ) | const [inline, virtual] |
Reimplemented from Item_sum.
Definition at line 482 of file item_sum.h.
References used_table_cache.
00482 { return !used_table_cache; }
| Item * Item_sum_count::copy_or_same | ( | THD * | thd | ) | [virtual] |
Reimplemented from Item.
Definition at line 1011 of file item_sum.cc.
References Item_sum_count().
01012 { 01013 return new (thd->mem_root) Item_sum_count(thd, this); 01014 }
Here is the call graph for this function:

| const char* Item_sum_count::func_name | ( | ) | const [inline, virtual] |
| void Item_sum_count::make_const | ( | longlong | count_arg | ) | [inline] |
Definition at line 487 of file item_sum.h.
References count, and used_table_cache.
00487 { count=count_arg; used_table_cache=0; }
| void Item_sum_count::no_rows_in_result | ( | ) | [inline, virtual] |
Reimplemented from Item_sum.
Definition at line 485 of file item_sum.h.
References count.
00485 { count=0; }
| void Item_sum_count::reset_field | ( | ) | [virtual] |
Reimplemented from Item_sum_num.
Definition at line 1935 of file item_sum.cc.
References Item_sum::args, int8store, Item::maybe_null, Item::null_value, Field::ptr, Item_result_field::result_field, and val_int().
01936 { 01937 char *res=result_field->ptr; 01938 longlong nr=0; 01939 01940 if (!args[0]->maybe_null) 01941 nr=1; 01942 else 01943 { 01944 (void) args[0]->val_int(); 01945 if (!args[0]->null_value) 01946 nr=1; 01947 } 01948 int8store(res,nr); 01949 }
Here is the call graph for this function:

| enum Sumfunctype Item_sum_count::sum_func | ( | ) | const [inline, virtual] |
Implements Item_sum.
Definition at line 483 of file item_sum.h.
References Item_sum::COUNT_FUNC.
00483 { return COUNT_FUNC; }
| void Item_sum_count::update_field | ( | ) | [virtual] |
Implements Item_sum.
Definition at line 2044 of file item_sum.cc.
References Item_sum::args, int8store, Item::maybe_null, Item::null_value, Field::ptr, Item_result_field::result_field, sint8korr, and val_int().
02045 { 02046 longlong nr; 02047 char *res=result_field->ptr; 02048 02049 nr=sint8korr(res); 02050 if (!args[0]->maybe_null) 02051 nr++; 02052 else 02053 { 02054 (void) args[0]->val_int(); 02055 if (!args[0]->null_value) 02056 nr++; 02057 } 02058 int8store(res,nr); 02059 }
Here is the call graph for this function:

| table_map Item_sum_count::used_tables | ( | ) | const [inline, virtual] |
Reimplemented from Item_sum.
Definition at line 481 of file item_sum.h.
References used_table_cache.
00481 { return used_table_cache; }
| longlong Item_sum_count::val_int | ( | ) | [virtual] |
Reimplemented from Item_sum_num.
Definition at line 1036 of file item_sum.cc.
References count, DBUG_ASSERT, and Item::fixed.
Referenced by add(), reset_field(), and update_field().
01037 { 01038 DBUG_ASSERT(fixed == 1); 01039 return (longlong) count; 01040 }
Here is the caller graph for this function:

longlong Item_sum_count::count [private] |
Definition at line 470 of file item_sum.h.
Referenced by add(), clear(), make_const(), no_rows_in_result(), and val_int().
table_map Item_sum_count::used_table_cache [private] |
Definition at line 471 of file item_sum.h.
Referenced by cleanup(), const_item(), make_const(), and used_tables().
1.4.7

