#include <field.h>
Inheritance diagram for Copy_field:


Public Member Functions | |
| Copy_field () | |
| ~Copy_field () | |
| void | set (Field *to, Field *from, bool save) |
| void | set (char *to, Field *from) |
Public Attributes | |
| char * | from_ptr |
| char * | to_ptr |
| uchar * | from_null_ptr |
| uchar * | to_null_ptr |
| my_bool * | null_row |
| uint | from_bit |
| uint | to_bit |
| uint | from_length |
| uint | to_length |
| Field * | from_field |
| Field * | to_field |
| String | tmp |
| void(* | do_copy )(Copy_field *) |
| void(* | do_copy2 )(Copy_field *) |
Private Member Functions | |
| void(* | get_copy_func (Field *to, Field *from))(Copy_field *) |
Definition at line 1523 of file field.h.
| void Copy_field::set | ( | char * | to, | |
| Field * | from | |||
| ) |
Definition at line 442 of file field_conv.cc.
References do_copy, do_field_eq(), do_field_to_null_str(), do_outer_field_to_null_str(), from, from_bit, from_length, from_null_ptr, from_ptr, null_row, to_bit, to_null_ptr, and to_ptr.
00443 { 00444 from_ptr=from->ptr; 00445 to_ptr=to; 00446 from_length=from->pack_length(); 00447 if (from->maybe_null()) 00448 { 00449 from_null_ptr=from->null_ptr; 00450 from_bit= from->null_bit; 00451 to_ptr[0]= 1; // Null as default value 00452 to_null_ptr= (uchar*) to_ptr++; 00453 to_bit= 1; 00454 if (from->table->maybe_null) 00455 { 00456 null_row= &from->table->null_row; 00457 do_copy= do_outer_field_to_null_str; 00458 } 00459 else 00460 do_copy= do_field_to_null_str; 00461 } 00462 else 00463 { 00464 to_null_ptr= 0; // For easy debugging 00465 do_copy= do_field_eq; 00466 } 00467 }
Here is the call graph for this function:

Definition at line 471 of file field_conv.cc.
References BLOB_FLAG, do_copy, do_copy2, do_copy_maybe_null(), do_copy_next_number(), do_copy_not_null(), do_copy_null(), do_copy_timestamp(), do_outer_field_null(), do_save_blob(), do_skip(), FIELD_TYPE_NULL, FIELD_TYPE_TIMESTAMP, from, from_bit, from_field, from_length, from_null_ptr, from_ptr, get_copy_func(), st_table::next_number_field, null_row, Field::pack_length(), Field::real_maybe_null(), Field::table, to, to_bit, to_field, to_length, to_null_ptr, to_ptr, and Field::type().
Referenced by store_key_field::store_key_field().
00472 { 00473 if (to->type() == FIELD_TYPE_NULL) 00474 { 00475 to_null_ptr=0; // For easy debugging 00476 to_ptr=0; 00477 do_copy=do_skip; 00478 return; 00479 } 00480 from_field=from; 00481 to_field=to; 00482 from_ptr=from->ptr; 00483 from_length=from->pack_length(); 00484 to_ptr= to->ptr; 00485 to_length=to_field->pack_length(); 00486 00487 // set up null handling 00488 from_null_ptr=to_null_ptr=0; 00489 if (from->maybe_null()) 00490 { 00491 from_null_ptr= from->null_ptr; 00492 from_bit= from->null_bit; 00493 if (to_field->real_maybe_null()) 00494 { 00495 to_null_ptr= to->null_ptr; 00496 to_bit= to->null_bit; 00497 if (from_null_ptr) 00498 do_copy= do_copy_null; 00499 else 00500 { 00501 null_row= &from->table->null_row; 00502 do_copy= do_outer_field_null; 00503 } 00504 } 00505 else 00506 { 00507 if (to_field->type() == FIELD_TYPE_TIMESTAMP) 00508 do_copy= do_copy_timestamp; // Automatic timestamp 00509 else if (to_field == to_field->table->next_number_field) 00510 do_copy= do_copy_next_number; 00511 else 00512 do_copy= do_copy_not_null; 00513 } 00514 } 00515 else if (to_field->real_maybe_null()) 00516 { 00517 to_null_ptr= to->null_ptr; 00518 to_bit= to->null_bit; 00519 do_copy= do_copy_maybe_null; 00520 } 00521 else 00522 do_copy=0; 00523 00524 if ((to->flags & BLOB_FLAG) && save) 00525 do_copy2= do_save_blob; 00526 else 00527 do_copy2= get_copy_func(to,from); 00528 if (!do_copy) // Not null 00529 do_copy=do_copy2; 00530 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void(* Copy_field::do_copy)(Copy_field *) |
Referenced by store_key_field::copy(), copy_fields(), and set().
| void(* Copy_field::do_copy2)(Copy_field *) |
Referenced by set().
| char* Copy_field::from_ptr |
| char * Copy_field::to_ptr |
1.4.7

