Public Member Functions |
| COPY_INFO (operation_type optype, List< Item > *inserted_columns, bool manage_defaults, enum_duplicates duplicate_handling, bool ignore_errors) |
| COPY_INFO (operation_type optype, List< Item > *inserted_columns, List< Item > *inserted_columns2, bool manage_defaults, enum_duplicates duplicates_handling, bool ignore_duplicates, int escape_character) |
| COPY_INFO (operation_type optype, List< Item > *fields, List< Item > *values) |
operation_type | get_operation_type () const |
List< Item > * | get_changed_columns () const |
const List< Item > * | get_changed_columns2 () const |
bool | get_manage_defaults () const |
enum_duplicates | get_duplicate_handling () const |
bool | get_ignore_errors () const |
virtual void | set_function_defaults (TABLE *table) |
bool | add_function_default_columns (TABLE *table, MY_BITMAP *columns) |
bool | function_defaults_apply (const TABLE *table) const |
bool | function_defaults_apply_on_columns (MY_BITMAP *map) |
bool | ignore_last_columns (TABLE *table, uint count) |
virtual | ~COPY_INFO () |
Additional Inherited Members |
static void * | operator new (size_t size) throw () |
static void * | operator new[] (size_t size) throw () |
static void * | operator new[] (size_t size, MEM_ROOT *mem_root) throw () |
static void * | operator new (size_t size, MEM_ROOT *mem_root) throw () |
static void | operator delete (void *ptr, size_t size) |
static void | operator delete (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, size_t size) |
This class encapsulates a data change operation. There are three such operations.
- Insert statements, i.e. INSERT INTO .. VALUES
- Update statements. UPDATE
...
- Delete statements. Currently this class is not used for delete statements and thus has not yet been adapted to handle it.
- Todo:
- Rename this class.
The COPY_INFO structure is used by INSERT/REPLACE code. The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY UPDATE code: If a row is inserted then the copied variable is incremented. If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the new data differs from the old one then the copied and the updated variables are incremented. The touched variable is incremented if a row was touched by the update part of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row was actually changed or not.
Definition at line 57 of file sql_data_change.h.
COPY_INFO::COPY_INFO |
( |
operation_type |
optype, |
|
|
List< Item > * |
inserted_columns, |
|
|
List< Item > * |
inserted_columns2, |
|
|
bool |
manage_defaults, |
|
|
enum_duplicates |
duplicates_handling, |
|
|
bool |
ignore_duplicates, |
|
|
int |
escape_character |
|
) |
| |
|
inline |
Initializes this data change operation as an SQL @c LOAD @c DATA @c
INFILE.
Note that this statement has its inserted columns spread over two
lists:
LOAD DATA INFILE a_file
INTO TABLE a_table (col1, col2) < first list (col1, col2)
SET col3=val; < second list (col3)
@param optype The data change operation type.
@param inserted_columns List of columns of the target table which
the statement will explicitely fill; COPY_INFO
must not set a function default for them. NULL
means "empty list".
@param inserted_columns2 A second list like inserted_columns
@param manage_defaults Whether this object should manage function
defaults.
@param ignore_duplicates Whether duplicate rows are ignored.
@param duplicates_handling How to handle duplicates.
@param escape_character The escape character.
Definition at line 231 of file sql_data_change.h.
bool COPY_INFO::get_function_default_columns |
( |
TABLE * |
table | ) |
|
|
protected |
This function will, unless done already, calculate and keep the set of function default columns.
Function default columns are those columns declared DEFAULT <function> and/or ON UPDATE <function>. These will store the return value of <function> when the relevant operation is applied on the table.
Calling this function, without error, is a prerequisite for calling COPY_INFO::set_function_defaults().
- Parameters
-
table | The table to be used for instantiating the column set. |
- Return values
-
false | Success. |
true | Memory allocation error. |
Definition at line 62 of file sql_data_change.cc.