various cleanups

* remove a confusing method name - Field::set_default_expression()
* remove handler::register_columns_for_write()
* rename stuff
* add asserts
* remove unlikely unlikely
* remove redundant if() conditions
* fix mark_unsupported_function() to report the most important violation
* don't scan vfield list for default values (vfields don't have defaults)
* move handling for DROP CONSTRAINT IF EXIST where it belongs
* don't protect engines from Alter_inplace_info::ALTER_ADD_CONSTRAINT
* comments
This commit is contained in:
Sergei Golubchik 2016-06-29 21:27:34 +02:00
commit f93a2a3b3b
20 changed files with 145 additions and 183 deletions

View file

@ -7817,15 +7817,17 @@ void switch_to_nullable_trigger_fields(List<Item> &items, TABLE *table)
table->field_to_fill(), if needed.
*/
void switch_to_nullable_trigger_fields(Field **info, TABLE *table)
void switch_defaults_to_nullable_trigger_fields(TABLE *table)
{
if (!table->default_field)
return; // no defaults
Field **trigger_field= table->field_to_fill();
/* True if we have virtual fields and non_null fields and before triggers */
if (info && trigger_field != table->field)
/* True if we have NOT NULL fields and BEFORE triggers */
if (trigger_field != table->field)
{
Field **field_ptr;
for (field_ptr= info; *field_ptr ; field_ptr++)
for (Field **field_ptr= table->default_field; *field_ptr ; field_ptr++)
{
Field *field= (*field_ptr);
field->default_value->expr_item->walk(&Item::switch_to_nullable_fields_processor, 1, trigger_field);