Commit fe591c50 authored by unknown's avatar unknown
Browse files

Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/Users/kent/mysql/bk/mysql-4.1

parents 5aecf16a 0559f1e0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -993,13 +993,13 @@ static int read_lines(bool execute_commands)
      unsigned long clen;
      do
      {
        line= my_cgets(tmpbuf.c_ptr(), tmpbuf.alloced_length(), &clen);
        line= my_cgets(tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
        buffer.append(line, clen);
        /* 
           if we got buffer fully filled than there is a chance that
           something else is still in console input buffer
        */
      } while (tmpbuf.alloced_length() <= clen + 1);
      } while (tmpbuf.alloced_length() <= clen);
      line= buffer.c_ptr();
#else /* OS2 */
      buffer.length(0);
+2 −2
Original line number Diff line number Diff line
@@ -427,9 +427,9 @@ int init_embedded_server(int argc, char **argv, char **groups)

  acl_error= 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
  if (!(acl_error= acl_init((THD *)0, opt_noacl)) &&
  if (!(acl_error= acl_init(opt_noacl)) &&
      !opt_noacl)
    (void) grant_init((THD *)0);
    (void) grant_init();
#endif
  if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap))
  {
+2 −2
Original line number Diff line number Diff line
@@ -40,12 +40,12 @@ void _mi_print_key(FILE *stream, register HA_KEYSEG *keyseg,
    end= key+ keyseg->length;
    if (keyseg->flag & HA_NULL_PART)
    {
      if (!*key)
      /* A NULL value is encoded by a 1-byte flag. Zero means NULL. */
      if (! *(key++))
      {
	fprintf(stream,"NULL");
	continue;
      }
      key++;
    }

    switch (keyseg->type) {
+5 −2
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
  HA_KEYSEG *last_used_keyseg;
  uint pack_key_length, use_key_length, nextflag;
  DBUG_ENTER("mi_rkey");
  DBUG_PRINT("enter",("base: %lx  inx: %d  search_flag: %d",
		      info,inx,search_flag));
  DBUG_PRINT("enter", ("base: %p  buf: %p  inx: %d  search_flag: %d",
                       info, buf, inx, search_flag));

  if ((inx = _mi_check_index(info,inx)) < 0)
    DBUG_RETURN(my_errno);
@@ -56,9 +56,12 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
  {
    if (key_len == 0)
      key_len=USE_WHOLE_KEY;
    /* Save the packed key for later use in the second buffer of lastkey. */
    key_buff=info->lastkey+info->s->base.max_key_length;
    pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (uchar*) key,
				 key_len, &last_used_keyseg);
    /* Save packed_key_length for use by the MERGE engine. */
    info->pack_key_length= pack_key_length;
    DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg,
				     key_buff, pack_key_length););
  }
+13 −3
Original line number Diff line number Diff line
@@ -908,11 +908,21 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
  reg1 HA_KEYSEG *keyseg;
  uchar *start_key,*page,*page_end,*from,*from_end;
  uint length,tmp;
  DBUG_ENTER("_mi_get_binary_pack_key");

  page= *page_pos;
  page_end=page+MI_MAX_KEY_BUFF+1;
  start_key=key;

  /*
    Keys are compressed the following way:

    prefix length    Packed length of prefix for the prev key. (1 or 3 bytes)
    for each key segment:
      [is null]        Null indicator if can be null (1 byte, zero means null)
      [length]         Packed length if varlength (1 or 3 bytes)
    pointer          Reference to the data file (last_keyseg->length).
  */
  get_key_length(length,page);
  if (length)
  {
@@ -922,7 +932,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
                          length, keyinfo->maxlength, *page_pos));
      DBUG_DUMP("key",(char*) *page_pos,16);
      my_errno=HA_ERR_CRASHED;
      return 0;                                 /* Wrong key */
      DBUG_RETURN(0);                                 /* Wrong key */
    }
    from=key;  from_end=key+length;
  }
@@ -983,12 +993,12 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
    {
      DBUG_PRINT("error",("Error when unpacking key"));
      my_errno=HA_ERR_CRASHED;
      return 0;                                 /* Error */
      DBUG_RETURN(0);                                 /* Error */
    }
    memcpy((byte*) key,(byte*) from,(size_t) length);
    *page_pos= from+length;
  }
  return((uint) (key-start_key)+keyseg->length);
  DBUG_RETURN((uint) (key-start_key)+keyseg->length);
}


Loading