From 22f8f391af89c644bd82d8e8898808620c356883 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 12:42:13 +0100 Subject: [PATCH] Bug #27320 ndb handler does not reset extra flags on reset() - make sure all extra flags are reset --- sql/ha_ndbcluster.cc | 18 ++++++++++++++++-- sql/ha_ndbcluster.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 877005039e2..71ab1e24f4d 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3282,8 +3282,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) break; case HA_EXTRA_RESET: /* Reset database to after open */ DBUG_PRINT("info", ("HA_EXTRA_RESET")); - DBUG_PRINT("info", ("Clearing condition stack")); - cond_clear(); + reset(); break; case HA_EXTRA_CACHE: /* Cash record in HA_rrnd() */ DBUG_PRINT("info", ("HA_EXTRA_CACHE")); @@ -3405,6 +3404,21 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) DBUG_RETURN(0); } + +int ha_ndbcluster::reset() +{ + DBUG_ENTER("ha_ndbcluster::reset"); + cond_clear(); + + /* reset flags set by extra calls */ + m_retrieve_all_fields= FALSE; + m_retrieve_primary_key= FALSE; + m_ignore_dup_key= FALSE; + m_use_write= FALSE; + DBUG_RETURN(0); +} + + /* Start of an insert, remember number of rows to be inserted, it will be used in write_row and get_autoincrement to send an optimal number diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 274dc53e547..6b49b0e3c70 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -553,6 +553,7 @@ class ha_ndbcluster: public handler int info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); + int reset(); int external_lock(THD *thd, int lock_type); void unlock_row(); int start_stmt(THD *thd, thr_lock_type lock_type);