List:Commits« Previous MessageNext Message »
From:jonas oreland Date:January 28 2012 10:43am
Subject:bzr push into mysql-5.5-cluster-7.2 branch (jonas.oreland:3791 to 3793)
View as plain text  
 3793 jonas oreland	2012-01-28
      ndb - fix bug13637411 testcase

    modified:
      mysql-test/suite/ndb_big/bug13637411.test
 3792 jonas oreland	2012-01-28 [merge]
      ndb - merge 71 to 72

    added:
      mysql-test/suite/ndb_big/bug13637411-master.opt
      mysql-test/suite/ndb_big/bug13637411.cnf
      mysql-test/suite/ndb_big/bug13637411.test
    modified:
      storage/ndb/include/kernel/kernel_types.h
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
      storage/ndb/src/ndbapi/ndberror.c
      storage/ndb/src/ndbjtie/NdbApiWrapper.hpp
      storage/ndb/src/ndbjtie/com/mysql/ndbjtie/ndbapi/NdbScanOperation.java
      storage/ndb/src/ndbjtie/ndbapi_jtie.hpp
 3791 jonas oreland	2012-01-26 [merge]
      ndb - merge 71 to 72

    modified:
      mysql-test/suite/ndb/r/ndb_index_stat_partitions.result
      mysql-test/suite/ndb/t/ndb_index_stat_partitions.test
=== added file 'mysql-test/suite/ndb_big/bug13637411-master.opt'
--- a/mysql-test/suite/ndb_big/bug13637411-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/bug13637411-master.opt	2012-01-28 09:09:19 +0000
@@ -0,0 +1 @@
+--testcase-timeout=60

=== added file 'mysql-test/suite/ndb_big/bug13637411.cnf'
--- a/mysql-test/suite/ndb_big/bug13637411.cnf	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/bug13637411.cnf	2012-01-28 09:09:19 +0000
@@ -0,0 +1,29 @@
+!include include/default_mysqld.cnf
+
+[cluster_config.1]
+ndbd=
+ndb_mgmd=
+mysqld=
+
+NoOfReplicas=1
+DataMemory=21G
+IndexMemory=220M
+Diskless=1
+
+[mysqld]
+# Make all mysqlds use cluster
+ndbcluster
+
+ndb-cluster-connection-pool=1
+ndb-force-send=1
+ndb-use-exact-count=0
+ndb-extra-logging=1
+ndb-autoincrement-prefetch-sz=256
+engine-condition-pushdown=1
+ndb-wait-connected=600
+ndb-wait-setup=300
+
+[ENV]
+NDB_CONNECTSTRING=             @mysql_cluster.1.ndb_connectstring
+MASTER_MYPORT=                 @mysqld.1.1.port
+

=== added file 'mysql-test/suite/ndb_big/bug13637411.test'
--- a/mysql-test/suite/ndb_big/bug13637411.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/bug13637411.test	2012-01-28 10:42:51 +0000
@@ -0,0 +1,138 @@
+source suite.inc;
+source include/have_ndb.inc;
+result_format 2;
+
+select version();
+
+CREATE TABLE t1 (
+  c0 int unsigned not null primary key,
+  c00 char(255) not null default '',
+  c01 char(255) not null default '',
+  c02 char(255) not null default '',
+  c03 char(255) not null default '',
+  c04 char(255) not null default '',
+  c05 char(255) not null default '',
+  c06 char(255) not null default '',
+  c07 char(255) not null default '',
+  c08 char(255) not null default '',
+  c09 char(255) not null default '',
+  c10 char(255) not null default '',
+  c11 char(255) not null default '',
+  c12 char(255) not null default '',
+  c13 char(255) not null default '',
+  c14 char(255) not null default '',
+  c15 char(255) not null default '',
+  c16 char(255) not null default '',
+  c17 char(255) not null default '',
+  c18 char(255) not null default '',
+  c19 char(255) not null default '',
+  c20 char(255) not null default '',
+  c21 char(255) not null default '',
+  c22 char(255) not null default '',
+  c23 char(255) not null default '',
+  c24 char(255) not null default '',
+  c25 char(255) not null default '',
+  c26 char(255) not null default '',
+  c27 char(255) not null default '',
+  c28 char(255) not null default '',
+  c29 char(255) not null default ''
+) COMMENT='NDB_TABLE=NOLOGGING' ENGINE=ndbcluster partition by key(c0) partitions 1;
+
+let $batch = 200;
+
+## Load table...
+--echo Filling table with 15Gb of data
+disable_query_log;
+let $i = 0;
+let $lastgb = 0;
+while (`select (DATA_LENGTH / 1024 / 1024 / 1024) < 15 from INFORMATION_SCHEMA.PARTITIONS where table_name = 't1'`)
+{
+  let $b = $batch; # Number of values to INSERT per batch
+  let $separator = ;
+  let $sql = INSERT t1 (c0) VALUES;
+  while($b)
+  {
+    let $sql=$sql$separator($i*$batch + $b);
+    let $separator = ,;
+    dec $b;
+  }
+
+  --error 0,1297
+  eval $sql;
+  if (!$mysql_errno)
+  {
+    inc $i;
+  }
+
+  let $gb = `select round(DATA_LENGTH / 1024 / 1024 / 1024) from INFORMATION_SCHEMA.PARTITIONS where table_name = 't1'`;
+  if ($gb != $lastgb)
+  {
+    --echo $gb gb...
+    let $lastgb = $gb;
+  }
+}
+
+--echo Filling table up to 20Gb, expect error
+let $done = 0;
+while (!$done)
+{
+  let $b = $batch; # Number of values to INSERT per batch
+  let $separator = ;
+  let $sql = INSERT t1 (c0) VALUES;
+  while($b)
+  {
+    let $sql=$sql$separator($i*$batch + $b);
+    let $separator = ,;
+    dec $b;
+  }
+
+  --error 0,1114,1297
+  eval $sql;
+  if (!$mysql_errno)
+  {
+    inc $i;
+  }
+  if ($mysql_errno == 1114)
+  {
+    show warnings;
+    inc $done;
+  }
+  if (`select (DATA_LENGTH / 1024 / 1024 / 1024) >= 20 from INFORMATION_SCHEMA.PARTITIONS where table_name = 't1'`)
+  {
+    inc $done;
+    --echo 20g loaded!
+  }
+}
+enable_query_log;
+
+select count(*),max(c0)
+from t1;
+
+select (DATA_LENGTH / 1024 / 1024 / 1024)
+from INFORMATION_SCHEMA.PARTITIONS
+where table_name = 't1';
+
+--echo Clearing table
+disable_query_log;
+while ($i > 0)
+{
+  let $b = $batch; # 
+  let $separator = ;
+  let $sql = delete from t1 where c0 in (;
+  while($b)
+  {
+    let $sql=$sql$separator($i*$batch + $b);
+    let $separator = ,;
+    dec $b;
+  }
+  let $sql=$sql);
+  source run_query_with_retry.inc;
+
+  dec $i;
+}
+enable_query_log;
+
+drop table t1;
+
+## Test suceeded
+exit;

=== modified file 'storage/ndb/include/kernel/kernel_types.h'
--- a/storage/ndb/include/kernel/kernel_types.h	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/include/kernel/kernel_types.h	2012-01-28 10:11:10 +0000
@@ -77,6 +77,13 @@ struct Local_key
   static bool isInvalid(Uint32 lk1, Uint32 lk2) {
     return ref(lk1, lk2) == ~Uint32(0);
   }
+
+  /**
+   * Can the local key be saved in one Uint32
+   */
+  static bool isShort(Uint32 pageId) {
+    return pageId < (1 << (32 - MAX_TUPLES_BITS));
+  }
 };
 
 class NdbOut&

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2011-11-16 08:17:17 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2012-01-28 10:11:10 +0000
@@ -1832,6 +1832,7 @@ int Dbtup::handleInsertReq(Signal* signa
    */
   if(mem_insert)
   {
+    terrorCode = 0;
     if (!rowid)
     {
       if (ERROR_INSERTED(4018))
@@ -1938,7 +1939,13 @@ int Dbtup::handleInsertReq(Signal* signa
       terrorCode = 1601;
       goto disk_prealloc_error;
     }
-    
+
+    if (!Local_key::isShort(frag_page_id))
+    {
+      terrorCode = 1603;
+      goto disk_prealloc_error;
+    }
+
     int ret= disk_page_prealloc(signal, fragPtr, &tmp, size);
     if (unlikely(ret < 0))
     {
@@ -2018,7 +2025,10 @@ null_check_error:
 
 mem_error:
   jam();
-  terrorCode= ZMEM_NOMEM_ERROR;
+  if (terrorCode == 0)
+  {
+    terrorCode= ZMEM_NOMEM_ERROR;
+  }
   goto update_error;
 
 log_space_error:

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp	2012-01-28 10:11:10 +0000
@@ -230,6 +230,15 @@ Dbtup::allocFragPage(Uint32 * err, Fragr
   {
     jam();
     pageId = max;
+    if (!Local_key::isShort(pageId))
+    {
+      /**
+       * TODO: remove when ACC supports 48 bit references
+       */
+      jam();
+      * err = 889;
+      return RNIL;
+    }
     Uint32 * ptr = map.set(2 * pageId);
     if (unlikely(ptr == 0))
     {

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2011-12-20 08:49:07 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2012-01-28 10:11:10 +0000
@@ -210,16 +210,21 @@ ErrorBundle ErrorCodes[] = {
   { 623,  HA_ERR_RECORD_FILE_FULL, IS, "623" },
   { 624,  HA_ERR_RECORD_FILE_FULL, IS, "624" },
   { 625,  HA_ERR_INDEX_FILE_FULL, IS, "Out of memory in Ndb Kernel, hash index part (increase IndexMemory)" },
-  { 633,  HA_ERR_INDEX_FILE_FULL, IS, "Table fragment hash index has reached maximum possible size" },
+  { 633,  HA_ERR_INDEX_FILE_FULL, IS,
+    "Table fragment hash index has reached maximum possible size" },
   { 640,  DMEC, IS, "Too many hash indexes (should not happen)" },
   { 826,  HA_ERR_RECORD_FILE_FULL, IS, "Too many tables and attributes (increase MaxNoOfAttributes or MaxNoOfTables)" },
   { 827,  HA_ERR_RECORD_FILE_FULL, IS, "Out of memory in Ndb Kernel, table data (increase DataMemory)" },
+  { 889,  HA_ERR_RECORD_FILE_FULL, IS,
+    "Table fragment fixed data reference has reached maximum possible value (specify MAXROWS or increase no of partitions)"},
   { 902,  HA_ERR_RECORD_FILE_FULL, IS, "Out of memory in Ndb Kernel, ordered index data (increase DataMemory)" },
   { 903,  HA_ERR_INDEX_FILE_FULL, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" },
   { 904,  HA_ERR_INDEX_FILE_FULL, IS, "Out of fragment records (increase MaxNoOfOrderedIndexes)" },
   { 905,  DMEC, IS, "Out of attribute records (increase MaxNoOfAttributes)" },
   { 1601, HA_ERR_RECORD_FILE_FULL, IS, "Out extents, tablespace full" },
   { 1602, DMEC, IS,"No datafile in tablespace" },
+  { 1603, HA_ERR_RECORD_FILE_FULL, IS,
+    "Table fragment fixed data reference has reached maximum possible value (specify MAXROWS or increase no of partitions)"},
 
   /**
    * TimeoutExpired 

=== modified file 'storage/ndb/src/ndbjtie/NdbApiWrapper.hpp'
--- a/storage/ndb/src/ndbjtie/NdbApiWrapper.hpp	2012-01-19 18:16:31 +0000
+++ b/storage/ndb/src/ndbjtie/NdbApiWrapper.hpp	2012-01-26 20:57:36 +0000
@@ -3192,6 +3192,13 @@ struct NdbApiWrapper {
         return obj.nextResult(p0, p1);
     }
 
+    static int
+    NdbScanOperation__nextResultCopyOut
+    ( NdbScanOperation & obj, char * p0, bool p1, bool p2 )
+    {
+        return obj.nextResultCopyOut(p0, p1, p2);
+    }
+
     static void
     NdbScanOperation__close
     ( NdbScanOperation & obj, bool p0, bool p1 )

=== modified file 'storage/ndb/src/ndbjtie/com/mysql/ndbjtie/ndbapi/NdbScanOperation.java'
--- a/storage/ndb/src/ndbjtie/com/mysql/ndbjtie/ndbapi/NdbScanOperation.java	2012-01-19 18:16:31 +0000
+++ b/storage/ndb/src/ndbjtie/com/mysql/ndbjtie/ndbapi/NdbScanOperation.java	2012-01-26 20:57:36 +0000
@@ -87,6 +87,7 @@ public class NdbScanOperation extends Nd
     public /*_virtual_*/ native int readTuples(int/*_LockMode_*/ lock_mode /*_= LM_Read_*/, int/*_Uint32_*/ scan_flags /*_= 0_*/, int/*_Uint32_*/ parallel /*_= 0_*/, int/*_Uint32_*/ batch /*_= 0_*/);
     public final native int nextResult(boolean fetchAllowed /*_= true_*/, boolean forceSend /*_= false_*/);
     // MMM! support <out:char *> or check if needed: public final native int nextResult(const char * * out_row_ptr, boolean fetchAllowed, boolean forceSend);
+    public final native int nextResultCopyOut(ByteBuffer/*_char *_*/ buffer, boolean fetchAllowed, boolean forceSend);
     public final native void close(boolean forceSend /*_= false_*/, boolean releaseOp /*_= false_*/);
     public final native NdbOperation/*_NdbOperation *_*/ lockCurrentTuple();
     public final native NdbOperation/*_NdbOperation *_*/ lockCurrentTuple(NdbTransaction/*_NdbTransaction *_*/ lockTrans);

=== modified file 'storage/ndb/src/ndbjtie/ndbapi_jtie.hpp'
--- a/storage/ndb/src/ndbjtie/ndbapi_jtie.hpp	2012-01-20 06:22:16 +0000
+++ b/storage/ndb/src/ndbjtie/ndbapi_jtie.hpp	2012-01-28 10:11:10 +0000
@@ -9114,6 +9114,22 @@ Java_com_mysql_ndbjtie_ndbapi_NdbScanOpe
 
 /*
  * Class:     com_mysql_ndbjtie_ndbapi_NdbScanOperation
+ * Method:    nextResultCopyOut
+ * Signature: (Ljava/nio/ByteBuffer;ZZ)I
+ */
+JNIEXPORT jint JNICALL
+Java_com_mysql_ndbjtie_ndbapi_NdbScanOperation_nextResultCopyOut(JNIEnv * env, jobject obj, jobject p0, jboolean p1, jboolean p2)
+{
+    TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanOperation_nextResultCopyOut(JNIEnv *, jobject, jobject, jboolean, jboolean)");
+#ifndef NDBJTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
+    return gcall_mfr< ttrait_c_m_n_n_NdbScanOperation_t, ttrait_int, ttrait_char_1p_bb, ttrait_bool, ttrait_bool, &NdbScanOperation::nextResultCopyOut >(env, obj, p0, p1, p2);
+#else
+    return gcall_fr< ttrait_int, ttrait_c_m_n_n_NdbScanOperation_r, ttrait_char_1p_bb, ttrait_bool, ttrait_bool, &NdbApiWrapper::NdbScanOperation__nextResultCopyOut >(env, NULL, obj, p0, p1, p2);
+#endif // NDBJTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
+}
+
+/*
+ * Class:     com_mysql_ndbjtie_ndbapi_NdbScanOperation
  * Method:    close
  * Signature: (ZZ)V
  */

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (jonas.oreland:3791 to 3793) jonas oreland30 Jan