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


Public Member Functions | |
| Item_default_value (Name_resolution_context *context_arg) | |
| Item_default_value (Name_resolution_context *context_arg, Item *a) | |
| enum Type | type () const |
| bool | eq (const Item *item, bool binary_cmp) const |
| bool | fix_fields (THD *, Item **) |
| void | print (String *str) |
| int | save_in_field (Field *field_arg, bool no_conversions) |
| table_map | used_tables () const |
| bool | walk (Item_processor processor, bool walk_subquery, byte *args) |
| Item * | transform (Item_transformer transformer, byte *args) |
Public Attributes | |
| Item * | arg |
Definition at line 2175 of file item.h.
| Item_default_value::Item_default_value | ( | Name_resolution_context * | context_arg | ) | [inline] |
Definition at line 2179 of file item.h.
02180 :Item_field(context_arg, (const char *)NULL, (const char *)NULL, 02181 (const char *)NULL), 02182 arg(NULL) {}
| Item_default_value::Item_default_value | ( | Name_resolution_context * | context_arg, | |
| Item * | a | |||
| ) | [inline] |
Definition at line 2183 of file item.h.
02184 :Item_field(context_arg, (const char *)NULL, (const char *)NULL, 02185 (const char *)NULL), 02186 arg(a) {}
Reimplemented from Item_field.
Definition at line 5282 of file item.cc.
References arg, Item::DEFAULT_VALUE_ITEM, and Item::type().
05283 { 05284 return item->type() == DEFAULT_VALUE_ITEM && 05285 ((Item_default_value *)item)->arg->eq(arg, binary_cmp); 05286 }
Here is the call graph for this function:

Reimplemented from Item_field.
Definition at line 5289 of file item.cc.
References arg, Item_ident::context, DBUG_ASSERT, ER_NO_DEFAULT_FOR_FIELD, error, FALSE, Item_field::field, Item::FIELD_ITEM, Field::field_name, Item::fix_fields(), Item::fixed, Field::flags, memcpy, my_error(), MYF, Item::name, NO_DEFAULT_VALUE_FLAG, Name_resolution_context::process_error(), Item::real_item(), Item_field::set_field(), Field::size_of(), sql_alloc(), TRUE, and Item::type().
05290 { 05291 Item *real_arg; 05292 Item_field *field_arg; 05293 Field *def_field; 05294 DBUG_ASSERT(fixed == 0); 05295 05296 if (!arg) 05297 { 05298 fixed= 1; 05299 return FALSE; 05300 } 05301 if (!arg->fixed && arg->fix_fields(thd, &arg)) 05302 goto error; 05303 05304 05305 real_arg= arg->real_item(); 05306 if (real_arg->type() != FIELD_ITEM) 05307 { 05308 my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), arg->name); 05309 goto error; 05310 } 05311 05312 field_arg= (Item_field *)real_arg; 05313 if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG) 05314 { 05315 my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), field_arg->field->field_name); 05316 goto error; 05317 } 05318 if (!(def_field= (Field*) sql_alloc(field_arg->field->size_of()))) 05319 goto error; 05320 memcpy(def_field, field_arg->field, field_arg->field->size_of()); 05321 def_field->move_field_offset((my_ptrdiff_t) 05322 (def_field->table->s->default_values - 05323 def_field->table->record[0])); 05324 set_field(def_field); 05325 return FALSE; 05326 05327 error: 05328 context->process_error(thd); 05329 return TRUE; 05330 }
Here is the call graph for this function:

| void Item_default_value::print | ( | String * | str | ) | [virtual] |
Reimplemented from Item_ident.
Definition at line 5333 of file item.cc.
References String::append(), arg, Item::print(), and STRING_WITH_LEN.
05334 { 05335 if (!arg) 05336 { 05337 str->append(STRING_WITH_LEN("default")); 05338 return; 05339 } 05340 str->append(STRING_WITH_LEN("default(")); 05341 arg->print(str); 05342 str->append(')'); 05343 }
Here is the call graph for this function:

Reimplemented from Item_field.
Definition at line 5346 of file item.cc.
References arg, Item_ident::cached_table, Item_ident::context, ER, ER_NO_DEFAULT_FOR_FIELD, ER_NO_DEFAULT_FOR_VIEW_FIELD, Name_resolution_context::error_processor, Field::field_name, Field::flags, st_table::in_use, NO_DEFAULT_VALUE_FLAG, push_warning_printf(), Item_field::save_in_field(), Field::set_default(), LEX_STRING::str, Field::table, st_table_list::top_table(), st_table_list::view_db, view_error_processor(), st_table_list::view_name, and MYSQL_ERROR::WARN_LEVEL_WARN.
05347 { 05348 if (!arg) 05349 { 05350 if (field_arg->flags & NO_DEFAULT_VALUE_FLAG) 05351 { 05352 if (context->error_processor == &view_error_processor) 05353 { 05354 TABLE_LIST *view= cached_table->top_table(); 05355 push_warning_printf(field_arg->table->in_use, 05356 MYSQL_ERROR::WARN_LEVEL_WARN, 05357 ER_NO_DEFAULT_FOR_VIEW_FIELD, 05358 ER(ER_NO_DEFAULT_FOR_VIEW_FIELD), 05359 view->view_db.str, 05360 view->view_name.str); 05361 } 05362 else 05363 { 05364 push_warning_printf(field_arg->table->in_use, 05365 MYSQL_ERROR::WARN_LEVEL_WARN, 05366 ER_NO_DEFAULT_FOR_FIELD, 05367 ER(ER_NO_DEFAULT_FOR_FIELD), 05368 field_arg->field_name); 05369 } 05370 return 1; 05371 } 05372 field_arg->set_default(); 05373 return 0; 05374 } 05375 return Item_field::save_in_field(field_arg, no_conversions); 05376 }
Here is the call graph for this function:

| Item* Item_default_value::transform | ( | Item_transformer | transformer, | |
| byte * | args | |||
| ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 2204 of file item.h.
References arg, Item::new_item(), and Item::transform().
02205 { 02206 Item *new_item= arg->transform(transformer, args); 02207 if (!new_item) 02208 return 0; 02209 arg= new_item; 02210 return (this->*transformer)(args); 02211 }
Here is the call graph for this function:

| enum Type Item_default_value::type | ( | ) | const [inline, virtual] |
Reimplemented from Item_field.
Definition at line 2187 of file item.h.
References Item::DEFAULT_VALUE_ITEM.
02187 { return DEFAULT_VALUE_ITEM; }
| table_map Item_default_value::used_tables | ( | ) | const [inline, virtual] |
Reimplemented from Item_field.
Definition at line 2192 of file item.h.
02192 { return (table_map)0L; }
| bool Item_default_value::walk | ( | Item_processor | processor, | |
| bool | walk_subquery, | |||
| byte * | args | |||
| ) | [inline, virtual] |
Definition at line 2178 of file item.h.
Referenced by eq(), fix_fields(), print(), save_in_field(), transform(), and walk().
1.4.7

