26 #include "sql_class.h"
41 DBUG_ENTER(
"allocate_column_bitmap");
42 const uint number_bits= table->s->fields;
44 my_bitmap_map *the_bits;
46 DBUG_ASSERT(current_thd == table->in_use);
47 if (multi_alloc_root(table->in_use->mem_root,
49 &the_bits, bitmap_buffer_size(number_bits),
53 if (bitmap_init(the_struct, the_bits, number_bits, FALSE) != 0)
64 DBUG_ENTER(
"COPY_INFO::get_function_default_columns");
66 if (m_function_default_columns != NULL)
69 if (allocate_column_bitmap(table, &m_function_default_columns))
72 if (!m_manage_defaults)
79 for (uint
i= 0;
i < table->s->fields; ++
i)
82 if ((m_optype == INSERT_OPERATION && f->has_insert_default_function()) ||
83 (m_optype == UPDATE_OPERATION && f->has_update_default_function()))
84 bitmap_set_bit(m_function_default_columns, f->field_index);
87 if (bitmap_is_clear_all(m_function_default_columns))
100 { m_changed_columns, m_changed_columns2 };
101 for (uint
i= 0;
i < 2;
i++)
103 if (all_changed_columns[
i] != NULL)
107 while ((lvalue_item= lvalue_it++) != NULL)
110 reinterpret_cast<uchar*>(m_function_default_columns));
120 DBUG_ENTER(
"COPY_INFO::set_function_defaults");
122 DBUG_ASSERT(m_function_default_columns != NULL);
125 if (bitmap_is_clear_all(m_function_default_columns))
128 for (uint
i= 0;
i < table->s->fields; ++
i)
129 if (bitmap_is_set(m_function_default_columns,
i))
131 DBUG_ASSERT(bitmap_is_set(table->write_set,
i));
134 case INSERT_OPERATION:
137 case UPDATE_OPERATION:
150 for (uint
i= 0;
i < count;
i++)
151 bitmap_clear_bit(m_function_default_columns,
152 table->s->fields - 1 -
i);