diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-12-07 01:03:00 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-12-07 01:03:00 +0400 |
commit | 8e25dcfcd7bc1ccf9d65b2f12eba4543ed1bf9f4 (patch) | |
tree | 902b1c51f21914d62467f9ec550d9dab22ad1897 /sql/lock.cc | |
parent | 264aaf111d0493f0472e704ad7dda426f81376ea (diff) | |
download | mariadb-git-8e25dcfcd7bc1ccf9d65b2f12eba4543ed1bf9f4.tar.gz |
BUG#868908: Crash in check_simple_equality() with semijoin + materialization + prepared statement
- Part 1 of the fix: for semi-join merged subqueries, calling child_join->optimize() until we're done with all
PS-lifetime optimizations in the parent.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 2dc6bc357f4..9fdb30eb1a0 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -866,8 +866,10 @@ MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, for (i=tables=lock_count=0 ; i < count ; i++) { TABLE *t= table_ptr[i]; - - if (t->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE) + + + if (t->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE && + t->s->tmp_table != INTERNAL_TMP_TABLE) { tables+= t->file->lock_count(); lock_count++; @@ -895,7 +897,9 @@ MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, TABLE *table; enum thr_lock_type lock_type; THR_LOCK_DATA **locks_start; - if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) + table= table_ptr[i]; + if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE || + table->s->tmp_table == INTERNAL_TMP_TABLE) continue; lock_type= table->reginfo.lock_type; DBUG_ASSERT(lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT); |