From 043d6d107b1bd46e465b044fb6ee76c3b03ac8c8 Mon Sep 17 00:00:00 2001
From: unknown <stewart@willster.(none)>
Date: Tue, 24 Oct 2006 23:26:58 +1000
Subject: [PATCH] fix ndb_cache_multi2

util thread wasn't behaving correctly after 241 error due to get_table_statistics
not properly returning an error code


sql/ha_ndbcluster.cc:
  correctly call ndb_get_table_statistics in get_commitcount (don't report error)

  but also return an error code from get_table_statistics so that util thread
  gets error code
---
 sql/ha_ndbcluster.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index d0d33f4686..a7942186f2 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -5603,7 +5603,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
   pthread_mutex_unlock(&share->mutex);
 
   struct Ndb_statistics stat;
-  if (ndb_get_table_statistics(NULL, true, ndb, tabname, &stat))
+  if (ndb_get_table_statistics(NULL, false, ndb, tabname, &stat))
   {
     free_share(share);
     DBUG_RETURN(1);
@@ -6044,6 +6044,9 @@ retry:
         reterr= ndb_to_mysql_error(&tmp);
       }
     }
+    else
+      reterr= error.code;
+
     if (pTrans)
     {
       ndb->closeTransaction(pTrans);
-- 
2.30.9