summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-29 21:27:34 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-30 11:43:02 +0200
commitf93a2a3b3b5c781c164805f352e9dea948500628 (patch)
treee5a6cda5f361102c4f086594100c4d4301d4999b /sql/ha_partition.cc
parent047d762d515524a6cd572b53179ff50aeb25b0d0 (diff)
downloadmariadb-git-f93a2a3b3b5c781c164805f352e9dea948500628.tar.gz
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
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 09f7deb805b..400ca6129d6 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3793,6 +3793,8 @@ int ha_partition::external_lock(THD *thd, int lock_type)
(void) (*file)->ha_external_lock(thd, lock_type);
} while (*(++file));
}
+ if (lock_type == F_WRLCK && m_part_info->part_expr)
+ m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0);
DBUG_RETURN(0);
err_handler:
@@ -3927,6 +3929,8 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
/* Add partition to be called in reset(). */
bitmap_set_bit(&m_partitions_to_reset, i);
}
+ if (lock_type == F_WRLCK && m_part_info->part_expr)
+ m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0);
DBUG_RETURN(error);
}
@@ -8459,17 +8463,6 @@ uint ha_partition::min_record_length(uint options) const
return max;
}
-/*
- Register that we want to read partition columns. This is needed to ensure
- that virtual columns are properly updated before we access them.
-*/
-
-void ha_partition::register_columns_for_write()
-{
- if (m_part_info->part_expr)
- m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0);
-}
-
/****************************************************************************
MODULE compare records
****************************************************************************/