1 #ifndef SQL_DATA_CHANGE_INCLUDED
2 #define SQL_DATA_CHANGE_INCLUDED
28 #include "my_bitmap.h"
31 enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
75 enum operation_type { INSERT_OPERATION, UPDATE_OPERATION };
82 const operation_type m_optype;
99 const bool m_manage_defaults;
149 int escape_char, last_errno;
190 bool manage_defaults,
191 enum_duplicates duplicate_handling,
192 bool ignore_errors) :
194 m_changed_columns(inserted_columns),
195 m_changed_columns2(NULL),
196 m_manage_defaults(manage_defaults),
197 m_function_default_columns(NULL),
205 DBUG_ASSERT(optype == INSERT_OPERATION);
234 bool manage_defaults,
235 enum_duplicates duplicates_handling,
236 bool ignore_duplicates,
237 int escape_character) :
239 m_changed_columns(inserted_columns),
240 m_changed_columns2(inserted_columns2),
241 m_manage_defaults(manage_defaults),
242 m_function_default_columns(NULL),
244 ignore(ignore_duplicates),
246 escape_char(escape_character),
250 DBUG_ASSERT(optype == INSERT_OPERATION);
264 m_changed_columns(fields),
265 m_changed_columns2(NULL),
266 m_manage_defaults(true),
267 m_function_default_columns(NULL),
275 DBUG_ASSERT(optype == UPDATE_OPERATION);
278 operation_type get_operation_type()
const {
return m_optype; }
280 List<Item> *get_changed_columns()
const {
return m_changed_columns; }
282 const List<Item> *get_changed_columns2()
const {
return m_changed_columns2; }
284 bool get_manage_defaults()
const {
return m_manage_defaults; }
288 bool get_ignore_errors()
const {
return ignore; }
320 bitmap_union(columns, m_function_default_columns);
333 DBUG_ASSERT(m_function_default_columns != NULL);
334 return !bitmap_is_clear_all(m_function_default_columns);
343 DBUG_ASSERT(m_function_default_columns != NULL);
344 return bitmap_is_overlapping(m_function_default_columns, map);
362 #endif // SQL_DATA_CHANGE_INCLUDED