#include <item_timefunc.h>
Inheritance diagram for Item_func_sec_to_time:


Public Member Functions | |
| Item_func_sec_to_time (Item *item) | |
| double | val_real () |
| longlong | val_int () |
| String * | val_str (String *) |
| void | fix_length_and_dec () |
| enum_field_types | field_type () const |
| const char * | func_name () const |
| Field * | tmp_table_field (TABLE *table) |
| bool | result_as_longlong () |
| bool | check_partition_func_processor (byte *bool_arg) |
Definition at line 629 of file item_timefunc.h.
| Item_func_sec_to_time::Item_func_sec_to_time | ( | Item * | item | ) | [inline] |
| enum_field_types Item_func_sec_to_time::field_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 647 of file item_timefunc.h.
References MYSQL_TYPE_TIME.
00647 { return MYSQL_TYPE_TIME; }
| void Item_func_sec_to_time::fix_length_and_dec | ( | ) | [inline, virtual] |
Implements Item_result_field.
Definition at line 640 of file item_timefunc.h.
References Item::collation, DATETIME_DEC, Item::decimals, Item::max_length, MAX_TIME_WIDTH, Item::maybe_null, my_charset_bin, MY_CHARSET_BIN_MB_MAXLEN, and DTCollation::set().
00641 { 00642 collation.set(&my_charset_bin); 00643 maybe_null=1; 00644 decimals= DATETIME_DEC; 00645 max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; 00646 }
Here is the call graph for this function:

| const char* Item_func_sec_to_time::func_name | ( | ) | const [inline, virtual] |
| bool Item_func_sec_to_time::result_as_longlong | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 653 of file item_timefunc.h.
References TRUE.
00653 { return TRUE; }
Reimplemented from Item_func.
Definition at line 649 of file item_timefunc.h.
References Item::tmp_table_field_from_field_type().
00650 { 00651 return tmp_table_field_from_field_type(table, 0); 00652 }
Here is the call graph for this function:

| longlong Item_func_sec_to_time::val_int | ( | ) | [virtual] |
Reimplemented from Item_str_func.
Definition at line 1577 of file item_timefunc.cc.
References Item_func::args, DBUG_ASSERT, Item::fixed, Item::null_value, and Item::val_int().
Referenced by val_real(), and val_str().
01578 { 01579 DBUG_ASSERT(fixed == 1); 01580 longlong seconds=args[0]->val_int(); 01581 longlong sign=1; 01582 if ((null_value=args[0]->null_value)) 01583 return 0; 01584 if (seconds < 0) 01585 { 01586 seconds= -seconds; 01587 sign= -1; 01588 } 01589 return sign*((seconds / 3600)*10000+((seconds/60) % 60)*100+ (seconds % 60)); 01590 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double Item_func_sec_to_time::val_real | ( | void | ) | [inline, virtual] |
Reimplemented from Item_str_func.
Definition at line 633 of file item_timefunc.h.
References DBUG_ASSERT, Item::fixed, and val_int().
00634 { 00635 DBUG_ASSERT(fixed == 1); 00636 return (double) Item_func_sec_to_time::val_int(); 00637 }
Here is the call graph for this function:

Implements Item.
Definition at line 1546 of file item_timefunc.cc.
References String::alloc(), Item_func::args, st_mysql_time::day, DBUG_ASSERT, Item::fixed, st_mysql_time::hour, make_time(), st_mysql_time::minute, st_mysql_time::neg, Item::null_value, sec, st_mysql_time::second, and val_int().
01547 { 01548 DBUG_ASSERT(fixed == 1); 01549 longlong seconds=(longlong) args[0]->val_int(); 01550 uint sec; 01551 TIME ltime; 01552 01553 if ((null_value=args[0]->null_value) || str->alloc(19)) 01554 { 01555 null_value= 1; 01556 return (String*) 0; 01557 } 01558 01559 ltime.neg= 0; 01560 if (seconds < 0) 01561 { 01562 seconds= -seconds; 01563 ltime.neg= 1; 01564 } 01565 01566 sec= (uint) ((ulonglong) seconds % 3600); 01567 ltime.day= 0; 01568 ltime.hour= (uint) (seconds/3600); 01569 ltime.minute= sec/60; 01570 ltime.second= sec % 60; 01571 01572 make_time((DATE_TIME_FORMAT *) 0, <ime, str); 01573 return str; 01574 }
Here is the call graph for this function:

1.4.7

