List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:December 14 2006 7:24pm
Subject:bk commit into 5.0 tree (kaa:1.2348)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kaa. When kaa 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-12-14 21:24:52+03:00, kaa@stripped +3 -0
  Merge polly.local:/tmp/maint/bug24117/my50-bug24117
  into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
  MERGE: 1.2327.3.1

  mysys/typelib.c@stripped, 2006-12-14 21:24:48+03:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.13.1.1

  sql/field.cc@stripped, 2006-12-14 21:24:49+03:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.328.1.1

  sql/field.h@stripped, 2006-12-14 21:24:49+03:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.189.2.1

# 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:	kaa
# Host:	polly.local
# Root:	/home/kaa/src/maint/mysql-5.0-maint/RESYNC

--- 1.14/mysys/typelib.c	2006-12-14 21:24:58 +03:00
+++ 1.15/mysys/typelib.c	2006-12-14 21:24:58 +03:00
@@ -119,3 +119,54 @@ const char *get_type(TYPELIB *typelib, u
     return(typelib->type_names[nr]);
   return "?";
 }
+
+
+/*
+  Create a copy of a specified TYPELIB structure.
+
+  SYNOPSIS
+    copy_typelib()
+    root	pointer to a MEM_ROOT object for allocations
+    from	pointer to a source TYPELIB structure
+
+  RETURN
+    pointer to the new TYPELIB structure on successful copy, or
+    NULL otherwise
+*/
+
+TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from)
+{
+  TYPELIB *to;
+  uint i;
+
+  if (!from)
+    return NULL;
+
+  if (!(to= (TYPELIB*) alloc_root(root, sizeof(TYPELIB))))
+    return NULL;
+
+  if (!(to->type_names= (const char **)
+        alloc_root(root, (sizeof(char *) + sizeof(int)) * (from->count + 1))))
+    return NULL;
+  to->type_lengths= (unsigned int *)(to->type_names + from->count + 1);
+  to->count= from->count;
+  if (from->name)
+  {
+    if (!(to->name= strdup_root(root, from->name)))
+      return NULL;
+  }
+  else
+    to->name= NULL;
+
+  for (i= 0; i < from->count; i++)
+  {
+    if (!(to->type_names[i]= strmake_root(root, from->type_names[i],
+                                          from->type_lengths[i])))
+      return NULL;
+    to->type_lengths[i]= from->type_lengths[i];
+  }
+  to->type_names[to->count]= NULL;
+  to->type_lengths[to->count]= 0;
+
+  return to;
+}

--- 1.333/sql/field.cc	2006-12-14 21:24:58 +03:00
+++ 1.334/sql/field.cc	2006-12-14 21:24:58 +03:00
@@ -7833,6 +7833,16 @@ void Field_enum::sql_type(String &res) c
 }
 
 
+Field *Field_enum::new_field(MEM_ROOT *root, struct st_table *new_table,
+                             bool keep_type)
+{
+  Field_enum *res= (Field_enum*) Field::new_field(root, new_table, keep_type);
+  if (res)
+    res->typelib= copy_typelib(root, typelib);
+  return res;
+}
+
+
 /*
    set type.
    This is a string which can have a collection of different values.

--- 1.191/sql/field.h	2006-12-14 21:24:58 +03:00
+++ 1.192/sql/field.h	2006-12-14 21:24:58 +03:00
@@ -1285,6 +1285,7 @@ public:
   {
       flags|=ENUM_FLAG;
   }
+  Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
   enum_field_types type() const { return FIELD_TYPE_STRING; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   enum Item_result cast_to_int_type () const { return INT_RESULT; }
Thread
bk commit into 5.0 tree (kaa:1.2348)Alexey Kopytov14 Dec