~clint-fewbar/ubuntu/natty/mysql-5.1/merge-5.1.49-2

« back to all changes in this revision

Viewing changes to sql/table.cc

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-08-04 13:18:27 UTC
  • mfrom: (1.2.2 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100804131827-4tjg88vr9dd49s3k
Tags: 5.1.49-1ubuntu1
* Merge from debian unstable:
  + debian/control:
     * Update maintainer according to spec.
     * Move section from "misc" to "database".
     * Added libmysqlclient16-dev an empty transitional package. 
     * Added mysql-client-core-5.1 package.
     * Suggest mailx for mysql-server-5.1
     * Add mysql-testsuite package so you can run the testsuite seperately.
  + debian/additions/my.cnf:
    * Remove language options. Error message files are located in a different directory in Mysql
      5.0. Setting the language option to use /usr/share/mysql/english breaks Mysql 5.0. Both 5.0
      and 5.1 use a different value that works. (LP: #316974)
  + Add apparmor profile:
    + debian/apparmor-profile: apparmor-profile
    + debian/rules, debian/mysql-server-5.1.files: install apparmor profile
    + debian/mysql-server-5.1.dirs: add etc/apparmor.d/fore-complain
    + debian/mysql-server-5.1.postrm: remove symlink in force-complain/ on purge.
    + debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    + debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    + debian/mysql-server-5.1.postinst: reload apparmor profiles
  * Convert the package from sysvinit to upstart:
    + debian/mysql-server-5.1.mysql.upstart: Add upstart script.
    + debian/mysql-server-5.1.mysql.init: Dropped, unused now with upstart.
    + debian/additions/mysqld_safe_syslog.cnf: Dropped, unused now with upstart.
    + debian/additons/my.cnf: Remove pid declaration and setup error logging to /var/log/mysql since
      we're not piping anything around logger anymore.
    + debian/rules, debian/mysql-server-5.1.logcheck.ignore.{paranoid,worstation},
      debian/mysql-server-5.1.logcheck.ignore.server: : Remove references to mysqld_safe
    + debian/patches/38_scripts_mysqld_safe.sh_signals.dpatch: Dropped
  * Added -fno-strict-aliasing to CFLAGS to get around mysql testsuite build failures.
  * Add Apport hook (LP: #354188):
    + debian/mysql-server-5.1.py: apport package hook
    + debian/rules: Make it installable
  * debian/mysql-server-5.1.mysql-server.logrotate: Check to see if mysql is running before
    running logrotate. (LP: #513135)
  * Make the testsuite installable. (LP: #530752)
    + debian/mysql-server-5.1.files, debian/rules: install apport package hook
  * debian/mysql-server-5.1.preinst: Set mysql user's home directory
    to /nonexistent to protect against having the /var/lib/mysql
    user-writeable. If an attacker can trick mysqld into creating
    dot files in the home directory, he could do .rhost-like attacks
    on the system. (LP: #293258)
  * debian/control: mysql-client-5.1 should depend on mysql-core-client-5.1.
    (LP: #590952) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
inline bool is_system_table_name(const char *name, uint length);
47
47
 
 
48
static ulong get_form_pos(File file, uchar *head);
 
49
 
48
50
/**************************************************************************
49
51
  Object_creation_ctx implementation.
50
52
**************************************************************************/
693
695
  disk_buff= 0;
694
696
 
695
697
  error= 3;
696
 
  if (!(pos=get_form_pos(file,head,(TYPELIB*) 0)))
 
698
  /* Position of the form in the form file. */
 
699
  if (!(pos= get_form_pos(file, head)))
697
700
    goto err;                                   /* purecov: inspected */
698
701
 
699
702
  share->frm_version= head[2];
2047
2050
  }
2048
2051
}
2049
2052
 
2050
 
        /* Find where a form starts */
2051
 
        /* if formname is NullS then only formnames is read */
2052
 
 
2053
 
ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
 
2053
/**
 
2054
  Find where a form starts.
 
2055
 
 
2056
  @param head The start of the form file.
 
2057
 
 
2058
  @remark If formname is NULL then only formnames is read.
 
2059
 
 
2060
  @retval The form position.
 
2061
*/
 
2062
 
 
2063
static ulong get_form_pos(File file, uchar *head)
2054
2064
{
2055
 
  uint a_length,names,length;
2056
 
  uchar *pos,*buf;
 
2065
  uchar *pos, *buf;
 
2066
  uint names, length;
2057
2067
  ulong ret_value=0;
2058
2068
  DBUG_ENTER("get_form_pos");
2059
2069
 
2060
 
  names=uint2korr(head+8);
2061
 
  a_length=(names+2)*sizeof(char *);            /* Room for two extra */
2062
 
 
2063
 
  if (!save_names)
2064
 
    a_length=0;
2065
 
  else
2066
 
    save_names->type_names=0;                   /* Clear if error */
2067
 
 
2068
 
  if (names)
2069
 
  {
2070
 
    length=uint2korr(head+4);
2071
 
    VOID(my_seek(file,64L,MY_SEEK_SET,MYF(0)));
2072
 
    if (!(buf= (uchar*) my_malloc((size_t) length+a_length+names*4,
2073
 
                                  MYF(MY_WME))) ||
2074
 
        my_read(file, buf+a_length, (size_t) (length+names*4),
2075
 
                MYF(MY_NABP)))
2076
 
    {                                           /* purecov: inspected */
2077
 
      x_free((uchar*) buf);                     /* purecov: inspected */
2078
 
      DBUG_RETURN(0L);                          /* purecov: inspected */
2079
 
    }
2080
 
    pos= buf+a_length+length;
2081
 
    ret_value=uint4korr(pos);
2082
 
  }
2083
 
  if (! save_names)
2084
 
  {
2085
 
    if (names)
2086
 
      my_free((uchar*) buf,MYF(0));
2087
 
  }
2088
 
  else if (!names)
2089
 
    bzero((char*) save_names,sizeof(save_names));
2090
 
  else
2091
 
  {
2092
 
    char *str;
2093
 
    str=(char *) (buf+a_length);
2094
 
    fix_type_pointers((const char ***) &buf,save_names,1,&str);
2095
 
  }
 
2070
  names= uint2korr(head+8);
 
2071
 
 
2072
  if (!(names= uint2korr(head+8)))
 
2073
    DBUG_RETURN(0);
 
2074
 
 
2075
  length= uint2korr(head+4);
 
2076
 
 
2077
  my_seek(file, 64L, MY_SEEK_SET, MYF(0));
 
2078
 
 
2079
  if (!(buf= (uchar*) my_malloc(length+names*4, MYF(MY_WME))))
 
2080
    DBUG_RETURN(0);
 
2081
 
 
2082
  if (my_read(file, buf, length+names*4, MYF(MY_NABP)))
 
2083
  {
 
2084
    x_free(buf);
 
2085
    DBUG_RETURN(0);
 
2086
  }
 
2087
 
 
2088
  pos= buf+length;
 
2089
  ret_value= uint4korr(pos);
 
2090
 
 
2091
  my_free(buf, MYF(0));
 
2092
 
2096
2093
  DBUG_RETURN(ret_value);
2097
2094
}
2098
2095