#include <item.h>
Inheritance diagram for Item:


|
|
00135 { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
|
|
|
00127 {FIELD_ITEM, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM,
00128 INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM,
00129 COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM,
00130 PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM,
00131 FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM,
00132 SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER,
00133 PARAM_ITEM, TRIGGER_FIELD_ITEM};
|
|
|
|
|
|
00048 : 00049 name(0), orig_name(0), name_length(0), fixed(0), 00050 collation(default_charset(), DERIVATION_COERCIBLE) 00051 { 00052 marker= 0; 00053 maybe_null=null_value=with_sum_func=unsigned_flag=0; 00054 decimals= 0; max_length= 0; 00055 00056 /* Put item in free list so that we can free all items at end */ 00057 THD *thd= current_thd; 00058 next= thd->free_list; 00059 thd->free_list= this; 00060 /* 00061 Item constructor can be called during execution other then SQL_COM 00062 command => we should check thd->lex->current_select on zero (thd->lex 00063 can be uninitialised) 00064 */ 00065 if (thd->lex->current_select) 00066 { 00067 enum_parsing_place place= 00068 thd->lex->current_select->parsing_place; 00069 if (place == SELECT_LIST || 00070 place == IN_HAVING) 00071 thd->lex->current_select->select_n_having_items++; 00072 } 00073 }
|
|
||||||||||||
|
00080 : 00081 str_value(item->str_value), 00082 name(item->name), 00083 orig_name(item->orig_name), 00084 max_length(item->max_length), 00085 marker(item->marker), 00086 decimals(item->decimals), 00087 maybe_null(item->maybe_null), 00088 null_value(item->null_value), 00089 unsigned_flag(item->unsigned_flag), 00090 with_sum_func(item->with_sum_func), 00091 fixed(item->fixed), 00092 collation(item->collation) 00093 { 00094 next= thd->free_list; // Put in free list 00095 thd->free_list= this; 00096 }
|
|
|
00168 {
00169 name=0;
00170 } /*lint -e1509 */
|
|
|
Reimplemented in Item_cache_row, Item_row, and Item_singlerow_subselect. 00331 { return 0; }
|
|
|
Reimplemented in Item_null, Item_int, Item_real, Item_string, and Item_varbinary. 00247 { return 0; }
|
|
|
Reimplemented in Item_cache_row, Item_row, and Item_singlerow_subselect. 00336 {}
|
|
|
Reimplemented in Item_cache_row, Item_row, and Item_singlerow_subselect. 00253 {
00254 if (c != 1)
00255 {
00256 my_error(ER_OPERAND_COLUMNS, MYF(0), c);
00257 return 1;
00258 }
00259 return 0;
00260 }
|
|
|
Reimplemented in Item_ident, Item_field, Item_null, Item_int, Item_real, Item_string, Item_varbinary, Item_result_field, Item_ref, Item_trigger_field, Item_cache, Item_cache_row, Item_type_holder, Item_in_optimizer, Item_func_in, Item_func_match, Item_subselect, Item_singlerow_subselect, Item_sum_count, Item_sum_count_distinct, Item_sum_hybrid, and Item_func_group_concat. 00112 {
00113 DBUG_ENTER("Item::cleanup");
00114 DBUG_PRINT("info", ("Item: 0x%lx, Type: %d, name %s, original name %s",
00115 this, (int)type(), name ? name : "(null)",
00116 orig_name ? orig_name : "null"));
00117 fixed=0;
00118 marker= 0;
00119 if (orig_name)
00120 name= orig_name;
00121 DBUG_VOID_RETURN;
00122 }
|
|
|
00134 {
00135 if (fixed)
00136 cleanup();
00137 return FALSE;
00138 }
|
|
|
Reimplemented in Item_field. 00320 { return 0; }
|
|
|
Reimplemented in Item_cache_row, Item_row, and Item_singlerow_subselect. 00329 { return 1; }
|
|
|
Reimplemented in Item_bool_func2, Item_func_between, Item_func_case, Item_func_in, Item_func_isnull, Item_func_isnotnull, and Item_equal. 00305 { return NULL; }
|
|
|
00263 { return (used_tables() & ~PARAM_TABLE_BIT) == 0; }
|
|
|
Reimplemented in Item_splocal, Item_copy_string, Item_func, Item_func_rand, Item_func_get_user_var, Item_row, Item_subselect, Item_sum, Item_sum_count, and Item_sum_hybrid. 00257 { return used_tables() == 0; }
|
|
|
Reimplemented in Item_cond_and, and Item_cond_or. 00300 { return this; }
|
|
|
Reimplemented in Item_sum_sum, Item_sum_sum_distinct, Item_sum_count, Item_sum_count_distinct, Item_sum_avg, Item_sum_variance, Item_sum_std, Item_sum_min, Item_sum_max, Item_sum_or, Item_sum_and, Item_sum_xor, Item_func_group_concat, and Item_sum_unique_users. 00299 { return this; }
|
|
|
00394 {
00395 return current_thd->variables.collation_connection;
00396 }
|
|
|
00344 {
00345 cleanup();
00346 delete this;
00347 }
|
|
|
Reimplemented in Item_cache_row, Item_row, and Item_singlerow_subselect. 00330 { return this; }
|
|
||||||||||||
|
Reimplemented in Item_field, Item_null, Item_param, Item_string, Item_ref, Item_default_value, Item_insert_value, Item_trigger_field, Item_func, Item_func_get_user_var, Item_func_match, Item_func_set_collation, Item_extract, and Item_char_typecast. 00303 {
00304 return type() == item->type() && name && item->name &&
00305 !my_strcasecmp(system_charset_info,name,item->name);
00306 }
|
|
|
Reimplemented in Item_func_eq, Item_func_equal, Item_func_ge, Item_func_gt, Item_func_le, Item_func_lt, Item_func_ne, and Item_func_like. 00250 { return COND_OK; }
|
|
|
Reimplemented in Item_field. 00321 { return this; }
|
|
|
Reimplemented in Item_field, Item_null, Item_param, Item_int, Item_real, Item_string, Item_datetime, Item_return_int, Item_varbinary, Item_ref, Item_copy_string, Item_func_ifnull, Item_func_get_user_var, Item_func_sp, Item_avg_field, Item_variance_field, Item_sum_hybrid, Item_date, Item_date_func, Item_func_curtime, Item_func_sec_to_time, Item_date_add_interval, Item_date_typecast, Item_time_typecast, Item_datetime_typecast, Item_func_makedate, Item_func_add_time, Item_func_timediff, Item_func_maketime, Item_func_str_to_date, Item_proc, Item_proc_real, Item_proc_int, and Item_proc_string. 02243 {
02244 return ((result_type() == STRING_RESULT) ? FIELD_TYPE_VAR_STRING :
02245 (result_type() == INT_RESULT) ? FIELD_TYPE_LONGLONG :
02246 FIELD_TYPE_DOUBLE);
02247 }
|
|
|
Reimplemented in Item_field, and Item_func_set_collation. 00339 { return 0; }
|
|
||||||||||||||||
|
Reimplemented in Item_field, Item_ref, Item_default_value, Item_insert_value, Item_trigger_field, Item_in_optimizer, Item_func_if, Item_func_like, Item_cond, Item_func, Item_func_rand, Item_func_set_user_var, Item_func_match, and Item_func_convert_tz. 01519 {
01520
01521 // We do not check fields which are fixed during construction
01522 DBUG_ASSERT(fixed == 0 || basic_const_item());
01523 fixed= 1;
01524 return FALSE;
01525 }
|
|
|
00252 { return decimals != NOT_FIXED_DEC ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;}
|
|
|
Reimplemented in Item_ident.
|
|
||||||||||||
|
Reimplemented in Item_field, Item_param, Item_ref, Item_ref_null_helper, Item_func_curdate, Item_func_now, Item_func_from_days, Item_func_from_unixtime, Item_func_convert_tz, Item_date_add_interval, Item_date_typecast, Item_func_str_to_date, and Item_func_last_day. 00362 {
00363 char buff[40];
00364 String tmp(buff,sizeof(buff), &my_charset_bin),*res;
00365 if (!(res=val_str(&tmp)) ||
00366 str_to_datetime_with_warn(res->ptr(), res->length(),
00367 ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR)
00368 {
00369 bzero((char*) ltime,sizeof(*ltime));
00370 return 1;
00371 }
00372 return 0;
00373 }
|
|
||||||||||||
|
Reimplemented in Item_field. 00272 { return get_date(ltime,fuzzydate); }
|
|
|
Reimplemented in Item_field, Item_param, and Item_time_typecast. 00381 {
00382 char buff[40];
00383 String tmp(buff,sizeof(buff),&my_charset_bin),*res;
00384 if (!(res=val_str(&tmp)) ||
00385 str_to_time_with_warn(res->ptr(), res->length(), ltime))
00386 {
00387 bzero((char*) ltime,sizeof(*ltime));
00388 return 1;
00389 }
00390 return 0;
00391 }
|
|
|
Reimplemented in Item_field, Item_result_field, and Item_ref. 00223 { return 0; }
|
|
|
Reimplemented in Item_field, Item_func, Item_subselect, and Item_sum. 00302 { return copy_or_same(thd); }
|
|
||||||||||||
|
02212 {
02213 char *empty_name= (char*) "";
02214 tmp_field->db_name= empty_name;
02215 tmp_field->org_table_name= empty_name;
02216 tmp_field->org_col_name= empty_name;
02217 tmp_field->table_name= empty_name;
02218 tmp_field->col_name= name;
02219 tmp_field->charsetnr= collation.collation->number;
02220 tmp_field->flags= (maybe_null ? 0 : NOT_NULL_FLAG) |
02221 (my_binary_compare(collation.collation) ?
02222 BINARY_FLAG : 0);
02223 tmp_field->type=field_type;
02224 tmp_field->length=max_length;
02225 tmp_field->decimals=decimals;
02226 if (unsigned_flag)
02227 tmp_field->flags |= UNSIGNED_FLAG;
02228 }
|
|
|
Reimplemented in Item_bool_func, Item_bool_func2, and Item_func_in. 00293 { return 0; }
|
|
|
Reimplemented in Item_splocal, Item_field, Item_null, Item_param, Item_ref, Item_copy_string, Item_in_optimizer, Item_bool_func2, Item_func_nullif, Item_func, Item_num_func, Item_num_op, Item_row, Item_subselect, Item_sum, Item_avg_field, and Item_variance_field. 00281 { return 0; }
|
|
|
Reimplemented in Item_result_field, and Item_ref. 00292 { return 0; }
|
|
|
Reimplemented in Item_splocal, Item_field, Item_empty_string, Item_ref, Item_copy_string, Item_cache_row, Item_row, Item_sum, and Item_proc. 02231 {
02232 init_make_field(tmp_field, field_type());
02233 }
|
|
|
Reimplemented in Item_bool_rowready_func2, Item_func_not, Item_func_equal, Item_func_isnull, Item_func_isnotnull, Item_cond_and, and Item_cond_or. 00341 { return NULL; }
|
|
|
Reimplemented in Item_null, Item_param, Item_int, Item_uint, Item_real, and Item_string. 00249 { return 0; }
|
|
|
Reimplemented in Item_sum, Item_sum_sum, Item_sum_sum_distinct, Item_sum_count, Item_sum_count_distinct, Item_sum_avg, Item_sum_variance, and Item_func_group_concat. 00298 {}
|
|
|
Reimplemented in Item_func_ifnull, Item_func_if, Item_func_nullif, Item_func_coalesce, Item_func_case, Item_func_isnull, Item_func_isnotnull, Item_cond_or, Item_func, Item_func_min_max, and Item_func_match. 00242 { return used_tables(); }
|
|
|
Reimplemented in Item_cache_row, Item_row, and Item_singlerow_subselect. 00334 { return 0; }
|
|
||||||||||||||||
|
00125 { TRASH(ptr, size); }
|
|
||||||||||||
|
00123 { TRASH(ptr, size); }
|
|
||||||||||||
|
00122 { return (void*) alloc_root(mem_root, (uint) size); }
|
|
|
00120 {return (void*) sql_alloc((uint) size); }
|
|
|
|
|