MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:September 21 2006 1:09pm
Subject:bk commit into 4.1 tree (svoj:1.2549) BUG#457
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-21 18:09:31+05:00, svoj@stripped +1 -0
  BUG#457 - No error message on MERGE definition type mismatch
  
  This is a preview patch. Will not be pushed.

  sql/ha_myisammrg.cc@stripped, 2006-09-21 18:09:29+05:00, svoj@stripped +100 -1
    preview.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	svoj
# Host:	april.(none)
# Root:	/home/svoj/devel/mysql/BUG457/mysql-4.1-engines

--- 1.62/sql/ha_myisammrg.cc	2006-09-21 18:09:34 +05:00
+++ 1.63/sql/ha_myisammrg.cc	2006-09-21 18:09:34 +05:00
@@ -50,7 +50,8 @@ const char *ha_myisammrg::index_type(uin
 int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
 {
   char name_buff[FN_REFLEN];
-
+  MYRG_TABLE *u_table;
+  uint null_field= test(table->null_fields);
   DBUG_PRINT("info", ("ha_myisammrg::open"));
   if (!(file=myrg_open(fn_format(name_buff,name,"","",2 | 4), mode,
 		       test_if_locked)))
@@ -72,6 +73,104 @@ int ha_myisammrg::open(const char *name,
     DBUG_PRINT("error",("reclength: %d  mean_rec_length: %d",
 			table->reclength, mean_rec_length));
     goto err;
+  }
+  for (u_table= file->open_tables; u_table < file->end_table; u_table++)
+  {
+    uint keys= table->keys;
+    KEY *keyinfo= table->key_info;
+    uint u_keys= u_table->table->s->base.keys;
+    MI_KEYDEF *u_keyinfo= u_table->table->s->keyinfo;
+    uint i, j;
+    if (u_keys < keys)
+    {
+      DBUG_PRINT("info", ("keys=%d, u_keys=%d", keys, u_keys));
+      goto err;
+    }
+    for (i= 0; i < keys; i++)
+    {
+      KEY_PART_INFO *keyparts= keyinfo[i].key_part;
+      HA_KEYSEG *u_keyparts= u_keyinfo[i].seg;
+#if 0
+      /*
+        merge.test fails with this check at line 15:
+        key_length= 4, u_keylength= 8
+      */
+      if (keyinfo[i].key_length != u_keyinfo[i].keylength)
+      {
+        DBUG_PRINT("info", ("key_length=%d, u_keylength=%d",
+                            keyinfo[i].key_length, u_keyinfo[i].keylength));
+        goto err;
+      }
+#endif
+      if (keyinfo[i].key_parts != u_keyinfo[i].keysegs)
+      {
+        DBUG_PRINT("info", ("keyparts=%d, u_keyparts=%d",
+                            keyinfo[i].key_parts, u_keyinfo[i].keysegs));
+        goto err;
+      }
+      for (j=  keyinfo[i].key_parts; j--;)
+      {
+        if (keyparts[j].length != u_keyparts[j].length)
+        {
+          DBUG_PRINT("info", ("keypart length=%d, u_keypart length=%d",
+                             keyparts[j].length, u_keyparts[j].length));
+          goto err;
+        }
+#if 0
+        /*
+          merge.test fails with this check at line 15:
+          keyparts type= 0, u_keyparts type= 4
+        */
+        if (keyparts[j].type != u_keyparts[j].type)
+        {
+          DBUG_PRINT("info", ("keypart type=%d, u_keypart type=%d",
+                              keyparts[j].type, u_keyparts[j].type));
+          goto err;
+        }
+#endif
+      }
+    }
+#if 0
+    /*
+      merge.test fails with this check at line 94:
+      fields= 2, u_fields= 3
+     */
+    if (u_table->table->s->base.fields != table->fields + null_field)
+    {
+      DBUG_PRINT("info", ("fields=%d, u_fields=%d", table->fields,
+                          u_table->table->s->base.fields));
+      goto err;
+    }
+#endif
+    if (u_table->table->s->base.fields < table->fields)
+    {
+      DBUG_PRINT("info", ("fields=%d, u_fields=%d", table->fields,
+                          u_table->table->s->base.fields));
+      goto err;
+    }
+    for (i= 0; i < table->fields; i++)
+    {
+      Field *m_field= table->field[i];
+      MI_COLUMNDEF *u_field= &u_table->table->s->rec[i + null_field];
+#if 0
+      /*
+        merge.test fails with this check at line 15:
+        m_field length= 11, u_field length= 4 (first field)
+      */
+      if (m_field->field_length != u_field->length)
+      {
+        DBUG_PRINT("info", ("m_field length=%d, u_field length=%d",
+                            m_field->field_length, u_field->length));
+        goto err;
+      }
+#endif
+      if (m_field->null_bit != u_field->null_bit)
+      {
+        DBUG_PRINT("info", ("m_null_bit=%d, u_null_bit=%d", m_field->null_bit,
+                            u_field->null_bit));
+        goto err;
+      }
+    }
   }
 #if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
   /* Merge table has more than 2G rows */
Thread
bk commit into 4.1 tree (svoj:1.2549) BUG#457Sergey Vojtovich21 Sep