List:Commits« Previous MessageNext Message »
From:Tomas Ulin Date:October 15 2008 12:25pm
Subject:bzr commit into mysql-5.1 branch (tomas.ulin:2695)
View as plain text  
#At file:///home/tomas/mysql_src/cge-6.2-global-schema-lock/

 2695 Tomas Ulin	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-15 12:24:10 +0000
+++ b/sql/ha_ndbcluster.cc	2008-10-15 12:25:16 +0000
@@ -158,9 +158,11 @@ static
 NdbRecord *
 ndb_get_table_statistics_ndbrecord(NDBDICT *, const NDBTAB *);
 static int ndb_get_table_statistics(THD *thd, ha_ndbcluster*, bool, Ndb*, const NDBTAB *, 
-                                    struct Ndb_statistics *);
+                                    struct Ndb_statistics *,
+                                    bool have_lock= FALSE);
 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;
 
@@ -490,7 +492,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;
@@ -509,7 +512,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:
@@ -6711,7 +6714,7 @@ int ha_ndbcluster::open(const char *name
     m_share= 0;
     DBUG_RETURN(res);
   }
-  if ((res= update_stats(thd, 1)) ||
+  if ((res= update_stats(thd, 1, true)) ||
       (res= info(HA_STATUS_CONST)))
   {
     free_share(&m_share);
@@ -8763,7 +8766,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);
@@ -8845,7 +8850,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)
 {
   NdbTransaction* pTrans;
   NdbError error;
@@ -8958,7 +8964,7 @@ retry:
     {
       if (file && pTrans)
       {
-        reterr= file->ndb_err(pTrans);
+        reterr= file->ndb_err(pTrans, have_lock);
       }
       else
       {
@@ -8995,7 +9001,8 @@ static 
 int
 ndb_get_table_statistics(THD *thd, ha_ndbcluster* file, bool report_error, Ndb* ndb,
                          const NDBTAB *ndbtab,
-                         struct Ndb_statistics *ndbstat)
+                         struct Ndb_statistics *ndbstat,
+                         bool have_lock)
 {
   NDBDICT *dict= ndb->getDictionary();
   NdbRecord *rec= ndb_get_table_statistics_ndbrecord(dict, ndbtab);

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2008-10-02 06:39:01 +0000
+++ b/sql/ha_ndbcluster.h	2008-10-14 14:06:02 +0000
@@ -454,7 +454,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,
@@ -722,7 +722,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 (tomas.ulin:2695) Tomas Ulin15 Oct