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


Public Member Functions | |
| Item_func_makedate (Item *a, Item *b) | |
| String * | val_str (String *str) |
| const char * | func_name () const |
| enum_field_types | field_type () const |
| void | fix_length_and_dec () |
| Field * | tmp_table_field (TABLE *table) |
| bool | result_as_longlong () |
| longlong | val_int () |
| bool | check_partition_func_processor (byte *bool_arg) |
Definition at line 814 of file item_timefunc.h.
| enum_field_types Item_func_makedate::field_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 820 of file item_timefunc.h.
References MYSQL_TYPE_DATE.
00820 { return MYSQL_TYPE_DATE; }
| void Item_func_makedate::fix_length_and_dec | ( | ) | [inline, virtual] |
Implements Item_result_field.
Definition at line 821 of file item_timefunc.h.
References Item::decimals, MAX_DATE_WIDTH, Item::max_length, and MY_CHARSET_BIN_MB_MAXLEN.
00822 { 00823 decimals=0; 00824 max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; 00825 }
| const char* Item_func_makedate::func_name | ( | ) | const [inline, virtual] |
| bool Item_func_makedate::result_as_longlong | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 830 of file item_timefunc.h.
References TRUE.
00830 { return TRUE; }
Reimplemented from Item_func.
Definition at line 826 of file item_timefunc.h.
References Item::tmp_table_field_from_field_type().
00827 { 00828 return tmp_table_field_from_field_type(table, 0); 00829 }
Here is the call graph for this function:

| longlong Item_func_makedate::val_int | ( | ) | [virtual] |
Reimplemented from Item_str_func.
Definition at line 2482 of file item_timefunc.cc.
References Item_func::args, calc_daynr(), st_mysql_time::day, DBUG_ASSERT, err, Item::fixed, get_date_from_daynr(), MAX_DAY_NUMBER, st_mysql_time::month, Item::null_value, and st_mysql_time::year.
Referenced by val_str().
02483 { 02484 DBUG_ASSERT(fixed == 1); 02485 TIME l_time; 02486 long daynr= (long) args[1]->val_int(); 02487 long yearnr= (long) args[0]->val_int(); 02488 long days; 02489 02490 if (args[0]->null_value || args[1]->null_value || 02491 yearnr < 0 || daynr <= 0) 02492 goto err; 02493 02494 days= calc_daynr(yearnr,1,1) + daynr - 1; 02495 /* Day number from year 0 to 9999-12-31 */ 02496 if (days >= 0 && days < MAX_DAY_NUMBER) 02497 { 02498 null_value=0; 02499 get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day); 02500 return (longlong) (l_time.year * 10000L + l_time.month * 100 + l_time.day); 02501 } 02502 02503 err: 02504 null_value= 1; 02505 return 0; 02506 }
Here is the call graph for this function:

Here is the caller graph for this function:

Implements Item.
Definition at line 2452 of file item_timefunc.cc.
References String::alloc(), Item_func::args, calc_daynr(), st_mysql_time::day, DBUG_ASSERT, err, Item::fixed, get_date_from_daynr(), make_date(), MAX_DAY_NUMBER, st_mysql_time::month, Item::null_value, val_int(), and st_mysql_time::year.
02453 { 02454 DBUG_ASSERT(fixed == 1); 02455 TIME l_time; 02456 long daynr= (long) args[1]->val_int(); 02457 long yearnr= (long) args[0]->val_int(); 02458 long days; 02459 02460 if (args[0]->null_value || args[1]->null_value || 02461 yearnr < 0 || daynr <= 0) 02462 goto err; 02463 02464 days= calc_daynr(yearnr,1,1) + daynr - 1; 02465 /* Day number from year 0 to 9999-12-31 */ 02466 if (days >= 0 && days <= MAX_DAY_NUMBER) 02467 { 02468 null_value=0; 02469 get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day); 02470 if (str->alloc(11)) 02471 goto err; 02472 make_date((DATE_TIME_FORMAT *) 0, &l_time, str); 02473 return str; 02474 } 02475 02476 err: 02477 null_value=1; 02478 return 0; 02479 }
Here is the call graph for this function:

1.4.7

