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


Public Member Functions | |
| Item_func_get_format (timestamp_type type_arg, Item *a) | |
| String * | val_str (String *str) |
| const char * | func_name () const |
| void | fix_length_and_dec () |
| void | print (String *str) |
Public Attributes | |
| const timestamp_type | type |
Definition at line 936 of file item_timefunc.h.
| Item_func_get_format::Item_func_get_format | ( | timestamp_type | type_arg, | |
| Item * | a | |||
| ) | [inline] |
| void Item_func_get_format::fix_length_and_dec | ( | ) | [inline, virtual] |
Implements Item_result_field.
Definition at line 945 of file item_timefunc.h.
References Item::decimals, Item::max_length, Item::maybe_null, and MY_CHARSET_BIN_MB_MAXLEN.
00946 { 00947 maybe_null= 1; 00948 decimals=0; 00949 max_length=17*MY_CHARSET_BIN_MB_MAXLEN; 00950 }
| const char* Item_func_get_format::func_name | ( | ) | const [inline, virtual] |
Implements Item_func.
Definition at line 944 of file item_timefunc.h.
Referenced by print().
Here is the caller graph for this function:

| void Item_func_get_format::print | ( | String * | str | ) | [virtual] |
Reimplemented from Item_func.
Definition at line 2923 of file item_timefunc.cc.
References String::append(), Item_func::args, DBUG_ASSERT, func_name(), MYSQL_TIMESTAMP_DATE, MYSQL_TIMESTAMP_DATETIME, MYSQL_TIMESTAMP_TIME, Item::print(), STRING_WITH_LEN, and Item_func::type().
02924 { 02925 str->append(func_name()); 02926 str->append('('); 02927 02928 switch (type) { 02929 case MYSQL_TIMESTAMP_DATE: 02930 str->append(STRING_WITH_LEN("DATE, ")); 02931 break; 02932 case MYSQL_TIMESTAMP_DATETIME: 02933 str->append(STRING_WITH_LEN("DATETIME, ")); 02934 break; 02935 case MYSQL_TIMESTAMP_TIME: 02936 str->append(STRING_WITH_LEN("TIME, ")); 02937 break; 02938 default: 02939 DBUG_ASSERT(0); 02940 } 02941 args[0]->print(str); 02942 str->append(')'); 02943 }
Here is the call graph for this function:

Implements Item.
Definition at line 2889 of file item_timefunc.cc.
References Item_func::args, DBUG_ASSERT, Item::fixed, format(), get_date_time_format_str(), known_date_time_formats, String::length(), my_charset_bin, my_charset_latin1, my_strnncoll, Item::null_value, String::ptr(), String::set(), strlen(), Item_func::type(), and Item::val_str().
02890 { 02891 DBUG_ASSERT(fixed == 1); 02892 const char *format_name; 02893 KNOWN_DATE_TIME_FORMAT *format; 02894 String *val= args[0]->val_str(str); 02895 ulong val_len; 02896 02897 if ((null_value= args[0]->null_value)) 02898 return 0; 02899 02900 val_len= val->length(); 02901 for (format= &known_date_time_formats[0]; 02902 (format_name= format->format_name); 02903 format++) 02904 { 02905 uint format_name_len; 02906 format_name_len= strlen(format_name); 02907 if (val_len == format_name_len && 02908 !my_strnncoll(&my_charset_latin1, 02909 (const uchar *) val->ptr(), val_len, 02910 (const uchar *) format_name, val_len)) 02911 { 02912 const char *format_str= get_date_time_format_str(format, type); 02913 str->set(format_str, strlen(format_str), &my_charset_bin); 02914 return str; 02915 } 02916 } 02917 02918 null_value= 1; 02919 return 0; 02920 }
Here is the call graph for this function:

Definition at line 939 of file item_timefunc.h.
1.4.7

