Commit 06b1f15d authored by unknown's avatar unknown
Browse files

ndb - post-merge fix 5.0 to 5.0-ndb: number of frags if --without-big-tables


sql/ha_ndbcluster.cc:
  calculate frags with (ulonglong)max_rows in case --without-big-tables
parent 1c031c9b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -4175,10 +4175,15 @@ static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length)
      acc_row_size+= 4 + /*safety margin*/ 4;
#endif
    ulonglong acc_fragment_size= 512*1024*1024;
    /*
     * if not --with-big-tables then max_rows is ulong
     * the warning in this case is misleading though
     */
    ulonglong big_max_rows = (ulonglong)max_rows;
#if MYSQL_VERSION_ID >= 50100
    no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1;
    no_fragments= (big_max_rows*acc_row_size)/acc_fragment_size+1;
#else
    no_fragments= ((max_rows*acc_row_size)/acc_fragment_size+1
    no_fragments= ((big_max_rows*acc_row_size)/acc_fragment_size+1
                   +1/*correct rounding*/)/2;
#endif
  }