summaryrefslogtreecommitdiff
path: root/storage/maria/ha_maria.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-02-01 21:55:30 +0100
committerSergei Golubchik <serg@mariadb.org>2018-02-02 10:09:44 +0100
commitd4df7bc9b1fbdfb5c98134091a9ff998af60954f (patch)
treedfd2f5128ccf94b6e86d2475aee23acf53fa868c /storage/maria/ha_maria.cc
parent80d3eee072025f34984e474ea160651eac9e11e5 (diff)
parent96cb428b350ba48ee17ad9968d08f5318e48258c (diff)
downloadmariadb-git-d4df7bc9b1fbdfb5c98134091a9ff998af60954f.tar.gz
Merge branch 'github/10.0' into 10.1
Diffstat (limited to 'storage/maria/ha_maria.cc')
-rw-r--r--storage/maria/ha_maria.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 47f759e0c05..47b24e1030b 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2134,11 +2134,16 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
safety net for now, we don't remove the test of
file->state->records, because there is uncertainty on what will
happen during repair if the two states disagree.
+
+ We also have to check in case of transactional tables that the
+ user has not used LOCK TABLE on the table twice.
*/
if ((file->state->records == 0) &&
(share->state.state.records == 0) && can_enable_indexes &&
(!rows || rows >= MARIA_MIN_ROWS_TO_DISABLE_INDEXES) &&
- (file->lock.type == TL_WRITE || file->lock.type == TL_UNLOCK))
+ (file->lock.type == TL_WRITE || file->lock.type == TL_UNLOCK) &&
+ (!share->have_versioning || !share->now_transactional ||
+ file->used_tables->use_count == 1))
{
/**
@todo for a single-row INSERT SELECT, we will go into repair, which