List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:November 5 2010 3:08pm
Subject:bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:3957)
View as plain text  
#At file:///home/msvensson/mysql/tmp/_XTTuBfWW8/7.1/ based on revid:magnus.blaudd@stripped0t6noie

 3957 Magnus Blåudd	2010-11-05 [merge]
      Merge 7.0 -> 7.1

    modified:
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_glue.h
      sql/table.cc
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2010-11-05 09:06:56 +0000
+++ b/sql/ha_ndbcluster.cc	2010-11-05 15:04:12 +0000
@@ -7209,6 +7209,7 @@ static int create_ndb_column(THD *thd,
   else
     col.setAutoIncrement(FALSE);
  
+#ifndef NDB_WITHOUT_COLUMN_FORMAT
   switch (field->field_storage_type()) {
   case(HA_SM_DEFAULT):
   default:
@@ -7240,6 +7241,7 @@ static int create_ndb_column(THD *thd,
       dynamic= (create_info->row_type == ROW_TYPE_DYNAMIC);
     break;
   }
+#endif
   DBUG_PRINT("info", ("Column %s is declared %s", field->field_name,
                       (dynamic) ? "dynamic" : "static"));
   if (type == NDBCOL::StorageTypeDisk)
@@ -7250,6 +7252,8 @@ static int create_ndb_column(THD *thd,
                           field->field_name));
       dynamic= false;
     }
+
+#ifndef NDB_WITHOUT_COLUMN_FORMAT
     if (thd && field->column_format() == COLUMN_FORMAT_TYPE_DYNAMIC)
     {
       push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -7259,6 +7263,7 @@ static int create_ndb_column(THD *thd,
                           "column will become FIXED",
                           field->field_name);
     }
+#endif
   }
 
   switch (create_info->row_type) {
@@ -7292,7 +7297,6 @@ void ha_ndbcluster::update_create_info(H
 {
   DBUG_ENTER("update_create_info");
   THD *thd= current_thd;
-  TABLE_SHARE *share= table->s;
   const NDBTAB *ndbtab= m_table;
   Ndb *ndb= check_ndb_in_thd(thd);
 
@@ -7336,6 +7340,8 @@ void ha_ndbcluster::update_create_info(H
     }
   }
 
+#ifndef NDB_WITHOUT_TABLESPACE_IN_FRM
+  TABLE_SHARE *share= table->s;
   if (share->mysql_version < MYSQL_VERSION_TABLESPACE_IN_FRM)
   {
      DBUG_PRINT("info", ("Restored an old table %s, pre-frm_version 7", 
@@ -7373,6 +7379,7 @@ err:
        my_errno= ndb_to_mysql_error(&ndberr);
     }
   }
+#endif
 
   DBUG_VOID_RETURN;
 }
@@ -7644,6 +7651,7 @@ int ha_ndbcluster::create(const char *na
     KEY_PART_INFO *end= key_part + key_info->key_parts;
     for (; key_part != end; key_part++)
     {
+#ifndef NDB_WITHOUT_COLUMN_FORMAT
       if (key_part->field->field_storage_type() == HA_SM_DISK)
       {
         push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
@@ -7656,6 +7664,7 @@ int ha_ndbcluster::create(const char *na
         result= HA_ERR_UNSUPPORTED;
         goto abort_return;
       }
+#endif
       tab.getColumn(key_part->fieldnr-1)->setStorageType(
                              NdbDictionary::Column::StorageTypeMemory);
     }
@@ -8105,6 +8114,7 @@ int ha_ndbcluster::create_ndb_index(THD 
   for (; key_part != end; key_part++) 
   {
     Field *field= key_part->field;
+#ifndef NDB_WITHOUT_COLUMN_FORMAT
     if (field->field_storage_type() == HA_SM_DISK)
     {
       push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
@@ -8116,6 +8126,7 @@ int ha_ndbcluster::create_ndb_index(THD 
                           "STORAGE DISK is not supported");
       DBUG_RETURN(HA_ERR_UNSUPPORTED);
     }
+#endif
     DBUG_PRINT("info", ("attr: %s", field->field_name));
     if (ndb_index.addColumnName(field->field_name))
     {
@@ -8839,28 +8850,12 @@ ha_ndbcluster::~ha_ndbcluster() 
 void
 ha_ndbcluster::column_bitmaps_signal(uint sig_type)
 {
-  THD *thd= table->in_use;
-  bool write_query= (thd->lex->sql_command == SQLCOM_UPDATE ||
-                     thd->lex->sql_command == SQLCOM_DELETE);
   DBUG_ENTER("column_bitmaps_signal");
   DBUG_PRINT("enter", ("read_set: 0x%lx  write_set: 0x%lx",
              (long) table->read_set->bitmap[0],
              (long) table->write_set->bitmap[0]));
   if (sig_type & HA_COMPLETE_TABLE_READ_BITMAP)
     bitmap_copy(&m_save_read_set, table->read_set);
-  if (!write_query || (sig_type & HA_COMPLETE_TABLE_READ_BITMAP))
-  {
-    /*
-      We need to make sure we always read all of the primary key.
-      Otherwise we cannot support position() and rnd_pos().
-  
-      Alternatively, we could just set a flag, and in the reader methods set
-      the extra bits as required if the flag is set, followed by clearing the
-      flag.  This to save doing the work of setting bits twice or more.
-      On the other hand this is quite fast in itself.
-    */
-    bitmap_union(table->read_set, m_pk_bitmap_p);
-  }
   DBUG_VOID_RETURN;
 }
 

=== modified file 'sql/ha_ndbcluster_glue.h'
--- a/sql/ha_ndbcluster_glue.h	2010-11-05 09:06:56 +0000
+++ b/sql/ha_ndbcluster_glue.h	2010-11-05 14:07:25 +0000
@@ -66,6 +66,19 @@ bool close_cached_tables(THD *thd, TABLE
 /* Online alter table not supported */
 #define NDB_WITHOUT_ONLINE_ALTER
 
+/* Column format not supported */
+#define NDB_WITHOUT_COLUMN_FORMAT
+
+enum column_format_type {
+  COLUMN_FORMAT_TYPE_NOT_USED= -1,
+  COLUMN_FORMAT_TYPE_DEFAULT=   0,
+  COLUMN_FORMAT_TYPE_FIXED=     1,
+  COLUMN_FORMAT_TYPE_DYNAMIC=   2
+};
+
+/* Tablespace in .frm and TABLE_SHARE->tablespace not supported */
+#define NDB_WITHOUT_TABLESPACE_IN_FRM
+
 #endif
 
 

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2010-10-12 14:53:28 +0000
+++ b/sql/table.cc	2010-11-05 15:04:12 +0000
@@ -4403,15 +4403,17 @@ void st_table::prepare_for_position()
 {
   DBUG_ENTER("st_table::prepare_for_position");
   
-  if (s->primary_key < MAX_KEY)
+#ifndef MCP_BUG58017
+  if ((file->ha_table_flags() & (HA_PRIMARY_KEY_IN_READ_INDEX |
+                                 HA_PRIMARY_KEY_REQUIRED_FOR_POSITION)) &&
+#else
+  if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
+#endif
+      s->primary_key < MAX_KEY)
   {
-    if (file->ha_table_flags() & (HA_PRIMARY_KEY_IN_READ_INDEX |
-                                  HA_PRIMARY_KEY_REQUIRED_FOR_POSITION))
-    {
-      mark_columns_used_by_index_no_reset(s->primary_key, read_set);
-      /* signal change */
-      file->column_bitmaps_signal(HA_CHANGE_TABLE_READ_BITMAP);
-    }
+    mark_columns_used_by_index_no_reset(s->primary_key, read_set);
+    /* signal change */
+    file->column_bitmaps_signal(HA_CHANGE_TABLE_READ_BITMAP);
   }
   DBUG_VOID_RETURN;
 }

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:3957) Magnus Blåudd5 Nov