List:Commits« Previous MessageNext Message »
From:Martin Skold Date:October 15 2008 4:27pm
Subject:bzr commit into mysql-5.1 branch (Martin.Skold:2711)
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-6.3/

 2711 Martin Skold	2008-10-15 [merge]
      Merge
modified:
  sql/ha_ndbcluster.cc
  sql/ha_ndbcluster.h

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2008-10-06 11:03:32 +0000
+++ b/sql/ha_ndbcluster.cc	2008-10-15 14:27:13 +0000
@@ -166,7 +166,8 @@ static uchar *ndbcluster_get_key(NDB_SHA
                                 my_bool not_used __attribute__((unused)));
 
 static int ndb_get_table_statistics(THD *thd, ha_ndbcluster*, bool, Ndb*,
-                                    const NdbRecord *, struct Ndb_statistics *);
+                                    const NdbRecord *, struct Ndb_statistics *,
+                                    bool have_lock= FALSE);
 
 THD *injector_thd= 0;
 
@@ -756,7 +757,8 @@ static void set_ndb_err(THD *thd, const 
   DBUG_VOID_RETURN;
 }
 
-int ha_ndbcluster::ndb_err(NdbTransaction *trans)
+int ha_ndbcluster::ndb_err(NdbTransaction *trans,
+                           bool have_lock)
 {
   THD *thd= current_thd;
   int res;
@@ -775,7 +777,7 @@ int ha_ndbcluster::ndb_err(NdbTransactio
     bzero((char*) &table_list,sizeof(table_list));
     table_list.db= m_dbname;
     table_list.alias= table_list.table_name= m_tabname;
-    close_cached_tables(thd, &table_list, FALSE, FALSE, FALSE);
+    close_cached_tables(thd, &table_list, have_lock, FALSE, FALSE);
     break;
   }
   default:
@@ -7708,7 +7710,7 @@ int ha_ndbcluster::open(const char *name
     local_close(thd, FALSE);
     DBUG_RETURN(res);
   }
-  if ((res= update_stats(thd, 1)) ||
+  if ((res= update_stats(thd, 1, true)) ||
       (res= info(HA_STATUS_CONST)))
   {
     local_close(thd, TRUE);
@@ -9870,7 +9872,9 @@ struct ndb_table_statistics_row {
   Uint64 var_mem;
 };
 
-int ha_ndbcluster::update_stats(THD *thd, bool do_read_stat)
+int ha_ndbcluster::update_stats(THD *thd,
+                                bool do_read_stat,
+                                bool have_lock)
 {
   struct Ndb_statistics stat;
   Thd_ndb *thd_ndb= get_thd_ndb(thd);
@@ -9883,7 +9887,8 @@ int ha_ndbcluster::update_stats(THD *thd
       DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM);
     }
     if (int err= ndb_get_table_statistics(thd, this, TRUE, ndb,
-                                          m_ndb_record, &stat))
+                                          m_ndb_record, &stat,
+                                          have_lock))
     {
       DBUG_RETURN(err);
     }
@@ -9922,7 +9927,8 @@ static 
 int
 ndb_get_table_statistics(THD *thd, ha_ndbcluster* file, bool report_error, Ndb* ndb,
                          const NdbRecord *record,
-                         struct Ndb_statistics * ndbstat)
+                         struct Ndb_statistics * ndbstat,
+                         bool have_lock)
 {
   Thd_ndb *thd_ndb= get_thd_ndb(current_thd);
   NdbTransaction* pTrans;
@@ -10058,7 +10064,7 @@ retry:
     {
       if (file && pTrans)
       {
-        reterr= file->ndb_err(pTrans);
+        reterr= file->ndb_err(pTrans, have_lock);
       }
       else
       {

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2008-10-02 08:19:14 +0000
+++ b/sql/ha_ndbcluster.h	2008-10-15 14:27:13 +0000
@@ -510,7 +510,7 @@ static void set_tabname(const char *path
   /*
    * Internal to ha_ndbcluster, used by C functions
    */
-  int ndb_err(NdbTransaction*);
+  int ndb_err(NdbTransaction*, bool have_lock= FALSE);
 
   my_bool register_query_cache_table(THD *thd, char *table_key,
                                      uint key_length,
@@ -816,7 +816,7 @@ private:
   NdbIndexScanOperation *m_multi_cursor;
   Ndb *get_ndb(THD *thd);
 
-  int update_stats(THD *thd, bool do_read_stat);
+  int update_stats(THD *thd, bool do_read_stat, bool have_lock= FALSE);
 };
 
 extern SHOW_VAR ndb_status_variables[];

Thread
bzr commit into mysql-5.1 branch (Martin.Skold:2711) Martin Skold15 Oct