List:Commits« Previous MessageNext Message »
From:jonas oreland Date:June 7 2011 11:45am
Subject:bzr push into mysql-5.1-telco-7.0-wl4124-new0 branch (jonas:4392 to 4394)
View as plain text  
 4394 jonas oreland	2011-06-07 [merge]
      ndb - merge 70 into wl4124-new0

    modified:
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
 4393 jonas oreland	2011-06-07
      wl4124-new0
      
      1) don't include ndb_global.h in public header-files (since it's not installed)
      2) this leads to move BoundBufWords into impl-class
      3) change testIndexStat to create/drop stat-tables if they're not already there
      4) add testIndexStat to daily-basic

    modified:
      storage/ndb/include/ndbapi/NdbIndexStat.hpp
      storage/ndb/src/ndbapi/NdbIndexStat.cpp
      storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp
      storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp
      storage/ndb/test/ndbapi/testIndexStat.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
 4392 Pekka Nousiainen	2011-06-06
      wl#4124 x06_fix.diff
      some warnings (mainly int sizes)

    modified:
      storage/ndb/src/ndbapi/NdbIndexStat.cpp
      storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp
      storage/ndb/test/ndbapi/testIndexStat.cpp
=== modified file 'storage/ndb/include/ndbapi/NdbIndexStat.hpp'
--- a/storage/ndb/include/ndbapi/NdbIndexStat.hpp	2011-06-06 12:18:27 +0000
+++ b/storage/ndb/include/ndbapi/NdbIndexStat.hpp	2011-06-07 10:03:02 +0000
@@ -19,7 +19,7 @@
 #ifndef NdbIndexStat_H
 #define NdbIndexStat_H
 
-#include <ndb_global.h>
+#include <ndb_types.h>
 #include "NdbDictionary.hpp"
 #include "NdbError.hpp"
 #include "NdbIndexScanOperation.hpp"
@@ -348,12 +348,6 @@ public:
   NdbIndexStatImpl& getImpl();
 
 private:
-  /* Need 2 words per column in a bound plus space for the
-   * bound data.
-   * Worst case is 32 cols in key and max key size used.
-   */
-  STATIC_CONST( BoundBufWords = (2 * NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY)
-                + NDB_MAX_KEYSIZE_IN_WORDS );
   int addKeyPartInfo(const NdbRecord* record,
                      const char* keyRecordData,
                      Uint32 keyPartNum,

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-05-31 08:28:58 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-06-07 07:30:36 +0000
@@ -2748,10 +2748,12 @@ void Dbdict::execREAD_CONFIG_REQ(Signal*
 					&c_maxNoOfTriggers));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_ATTRIBUTE,&attributesize));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &tablerecSize));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_AUTO_CREATE,
-                                        &c_indexStatAutoCreate));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_AUTO_UPDATE,
-                                        &c_indexStatAutoUpdate));
+  c_indexStatAutoCreate = 0;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_AUTO_CREATE,
+                            &c_indexStatAutoCreate);
+  c_indexStatAutoUpdate = 0;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_AUTO_UPDATE,
+                            &c_indexStatAutoUpdate);
 
   c_attributeRecordPool.setSize(attributesize);
   c_attributeRecordHash.setSize(64);

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp	2011-05-31 08:28:58 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp	2011-06-07 06:34:14 +0000
@@ -229,18 +229,30 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signa
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_ATTRIBUTE, &nAttribute));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_BATCH_SIZE, &nScanBatch));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_AUTO_UPDATE,
-                                        &nStatAutoUpdate));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_SAVE_SIZE,
-                                        &nStatSaveSize));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_SAVE_SCALE,
-                                        &nStatSaveScale));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_TRIGGER_PCT,
-                                        &nStatTriggerPct));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_TRIGGER_SCALE,
-                                        &nStatTriggerScale));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_UPDATE_DELAY,
-                                        &nStatUpdateDelay));
+
+  nStatAutoUpdate = 0;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_AUTO_UPDATE,
+                            &nStatAutoUpdate);
+
+  nStatSaveSize = 32768;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_SAVE_SIZE,
+                            &nStatSaveSize);
+
+  nStatSaveScale = 100;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_SAVE_SCALE,
+                            &nStatSaveScale);
+
+  nStatTriggerPct = 100;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_TRIGGER_PCT,
+                            &nStatTriggerPct);
+
+  nStatTriggerScale = 100;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_TRIGGER_SCALE,
+                            &nStatTriggerScale);
+
+  nStatUpdateDelay = 60;
+  ndb_mgm_get_int_parameter(p, CFG_DB_INDEX_STAT_UPDATE_DELAY,
+                            &nStatUpdateDelay);
 
   const Uint32 nDescPage = (nIndex * DescHeadSize + nAttribute * KeyTypeSize + nAttribute * AttributeHeaderSize + DescPageSize - 1) / DescPageSize;
   const Uint32 nScanBoundWords = nScanOp * ScanBoundSegmentSize * 4;

=== modified file 'storage/ndb/src/ndbapi/NdbIndexStat.cpp'
--- a/storage/ndb/src/ndbapi/NdbIndexStat.cpp	2011-06-06 18:23:15 +0000
+++ b/storage/ndb/src/ndbapi/NdbIndexStat.cpp	2011-06-07 10:03:02 +0000
@@ -101,7 +101,7 @@ NdbIndexStat::addKeyPartInfo(const NdbRe
   AttributeHeader ah(tIndexAttrId, sizeInWords << 2);
   const Uint32 ahValue= ah.m_value;
 
-  if (keyLength + (2 + len) > BoundBufWords )
+  if (keyLength + (2 + len) > NdbIndexStatImpl::BoundBufWords )
   {
     /* Something wrong, key data would be too big */
     /* Key size is limited to 4092 bytes */
@@ -133,8 +133,8 @@ NdbIndexStat::records_in_range(const Ndb
 {
   DBUG_ENTER("NdbIndexStat::records_in_range");
   Uint64 rows;
-  Uint32 key1[BoundBufWords], keylen1;
-  Uint32 key2[BoundBufWords], keylen2;
+  Uint32 key1[NdbIndexStatImpl::BoundBufWords], keylen1;
+  Uint32 key2[NdbIndexStatImpl::BoundBufWords], keylen2;
 
   if (true)
   {

=== modified file 'storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp	2011-06-06 12:18:27 +0000
+++ b/storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp	2011-06-07 10:03:02 +0000
@@ -29,9 +29,9 @@
 #define min(a, b) ((a) <= (b) ? (a) : (b))
 #define max(a, b) ((a) >= (b) ? (a) : (b))
 
-static const char* const g_headtable_name = "NDB$IS_HEAD";
-static const char* const g_sampletable_name = "NDB$IS_SAMPLE";
-static const char* const g_sampleindex1_name = "NDB$IS_SAMPLE_X1";
+static const char* const g_headtable_name = NDB_INDEX_STAT_HEAD_TABLE;
+static const char* const g_sampletable_name = NDB_INDEX_STAT_SAMPLE_TABLE;
+static const char* const g_sampleindex1_name = NDB_INDEX_STAT_SAMPLE_INDEX1;
 
 const int ERR_NoSuchObject[] = { 709, 723, 4243, 0 };
 const int ERR_TupleNotFound[] = { 626, 0 };
@@ -1034,7 +1034,7 @@ NdbIndexStatImpl::read_stat(Ndb* ndb, He
 int
 NdbIndexStatImpl::read_start(Con& con)
 {
-  Head& head = con.m_head;
+  //UNUSED Head& head = con.m_head;
   if (!m_indexSet)
   {
     setError(UsageError, __LINE__);

=== modified file 'storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp	2011-06-06 18:23:15 +0000
+++ b/storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp	2011-06-07 10:03:02 +0000
@@ -296,6 +296,15 @@ public:
   void setError(int code, int line, int extra = 0);
   void setError(const Con& con, int line);
   void mapError(const int* map, int code);
+
+// moved from NdbIndexStat.hpp by jonas
+
+  /* Need 2 words per column in a bound plus space for the
+   * bound data.
+   * Worst case is 32 cols in key and max key size used.
+   */
+  STATIC_CONST( BoundBufWords = (2 * NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY)
+                + NDB_MAX_KEYSIZE_IN_WORDS );
 };
 
 inline

=== modified file 'storage/ndb/test/ndbapi/testIndexStat.cpp'
--- a/storage/ndb/test/ndbapi/testIndexStat.cpp	2011-06-06 18:23:15 +0000
+++ b/storage/ndb/test/ndbapi/testIndexStat.cpp	2011-06-07 10:03:02 +0000
@@ -132,6 +132,7 @@ static NdbScanOperation* g_scan_op = 0;
 static NdbIndexScanOperation* g_rangescan_op = 0;
 
 static NdbIndexStat* g_is = 0;
+static bool g_has_created_stat_tables = false;
 
 static uint
 urandom()
@@ -2106,6 +2107,30 @@ checkoptions()
   return 0;
 }
 
+static
+int
+docreate_stat_tables()
+{
+  if (g_is->check_systables(g_ndb_sys) == 0)
+    return 0;
+
+  if (g_is->create_systables(g_ndb_sys) == 0)
+  {
+    g_has_created_stat_tables = true;
+    return 0;
+  }
+  return -1;
+}
+
+static
+void
+dodrop_stat_tables()
+{
+  if (g_has_created_stat_tables == false)
+    return;
+  g_is->drop_systables(g_ndb_sys);
+}
+
 int
 main(int argc, char** argv)
 {
@@ -2131,11 +2156,17 @@ main(int argc, char** argv)
     ll0("connect failed");
     return NDBT_ProgramExit(NDBT_FAILED);
   }
+  if (docreate_stat_tables() == -1){
+    ll0("failed to create stat tables");
+    return NDBT_ProgramExit(NDBT_FAILED);
+  }
   if (runtest() == -1) {
     ll0("test failed");
+    dodrop_stat_tables();
     dodisconnect();
     return NDBT_ProgramExit(NDBT_FAILED);
   }
+  dodrop_stat_tables();
   dodisconnect();
   return NDBT_ProgramExit(NDBT_OK);
 }

=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt	2011-05-27 07:53:31 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt	2011-06-07 10:03:02 +0000
@@ -1732,3 +1732,7 @@ max-time: 300
 cmd: testBasic
 args: -n RefreshLocking D1
 
+max-time: 300
+cmd: testIndexStat
+args:
+

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-wl4124-new0 branch (jonas:4392 to 4394) jonas oreland7 Jun