Commit 92b65b8a authored by gshchepa/uchum@gleb.loc's avatar gshchepa/uchum@gleb.loc
Browse files

Merge gleb.loc:/home/uchum/work/bk/5.0

into  gleb.loc:/home/uchum/work/bk/5.0-opt
parents 06c80870 d6ad4e6e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1086,6 +1086,11 @@ static int read_and_execute(bool interactive)
           something else is still in console input buffer
        */
      } while (tmpbuf.alloced_length() <= clen);
      /* 
        An empty line is returned from my_cgets when there's error reading :
        Ctrl-c for example
      */
      if (line)
        line= buffer.c_ptr();
#else /* OS2 */
      buffer.length(0);
+1 −0
Original line number Diff line number Diff line
@@ -284,6 +284,7 @@ enum ha_base_keytype {
#define HA_PACK_RECORD		2	/* Request packed record format */
#define HA_CREATE_TMP_TABLE	4
#define HA_CREATE_CHECKSUM	8
#define HA_CREATE_KEEP_FILES	16      /* don't overwrite .MYD and MYI */
#define HA_CREATE_DELAY_KEY_WRITE 64

/*
+2 −2
Original line number Diff line number Diff line
@@ -586,7 +586,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
					     32 : 0));
    linkname_ptr=0;
    /* Replace the current file */
    create_flag=MY_DELETE_OLD;
    create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
  }

  /*
@@ -647,7 +647,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
      {
	fn_format(filename,name,"",MI_NAME_DEXT,4);
	linkname_ptr=0;
	create_flag=MY_DELETE_OLD;
        create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
      }
      if ((dfile=
	   my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
+29 −42
Original line number Diff line number Diff line
@@ -31,11 +31,6 @@ static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims,
                              double *mbr, int top);
static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr);

static void get_double(double *d, const byte *pos)
{
  float8get(*d, pos);
}
  
uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
		 const byte *record, my_off_t filepos)
{
@@ -62,48 +57,40 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
  
  for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++)
  {
    uint length = keyseg->length;
    uint length = keyseg->length, start= keyseg->start;
    double val;

    pos = ((byte*)mbr) + keyseg->start;
    if (keyseg->flag & HA_SWAP_KEY)
    {
    DBUG_ASSERT(length == sizeof(double));
    DBUG_ASSERT(!(start % sizeof(double)));
    DBUG_ASSERT(start < sizeof(mbr));
    DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE);
    
    val= mbr[start / sizeof (double)];
#ifdef HAVE_ISNAN
      if (keyseg->type == HA_KEYTYPE_FLOAT)
      {
	float nr;
	float4get(nr, pos);
	if (isnan(nr))
	{
	  /* Replace NAN with zero */
 	  bzero(key, length);
	  key+= length;
	  continue;
	}
      }
      else if (keyseg->type == HA_KEYTYPE_DOUBLE)
      {
	double nr;
	get_double(&nr, pos);
	if (isnan(nr))
    if (isnan(val))
    {
      bzero(key, length);
      key+= length;
      len+= length;
      continue;
    }
      }
#endif
      pos += length;
      while (length--)

    if (keyseg->flag & HA_SWAP_KEY)
    {
      char buf[sizeof(double)];

      float8store(buf, val);
      pos= &buf[length];
      while (pos > buf)
        *key++ = *--pos;
    }
    }
    else
    {
      memcpy((byte*)key, pos, length);
      key += keyseg->length;
      float8store((byte *)key, val);
      key += length;
    }
    len += keyseg->length;
    len+= length;
  }
  _mi_dpointer(info, key, filepos);
  return len;
@@ -141,13 +128,13 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
  {
    if ((*wkb) > end - 8)
      return -1;
    get_double(&ord, (const byte*) *wkb);
    float8get(ord, (const byte*) *wkb);
    (*wkb)+= 8;
    if (ord < *mbr)
      float8store((char*) mbr, ord);
      *mbr= ord;
    mbr++;
    if (ord > *mbr)
      float8store((char*) mbr, ord);
      *mbr= ord;
    mbr++;
  }
  return 0;
+8 −0
Original line number Diff line number Diff line
@@ -603,3 +603,11 @@ check table t1 extended;
Table	Op	Msg_type	Msg_text
test.t1	check	status	OK
drop table t1;
create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
insert into t1 set a=0x4c20;
insert into t1 set a=0x6c;
insert into t1 set a=0x4c98;
check table t1 extended;
Table	Op	Msg_type	Msg_text
test.t1	check	status	OK
drop table t1;
Loading