Commit 056175a1 authored by monty@tik.mysql.fi's avatar monty@tik.mysql.fi
Browse files

Update for BTREE keys in HEAP tables

Split handler->option_flag() to handler->table_flags() and handler->index_flags()
parent e857f561
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6184,6 +6184,9 @@ and are configured with the following compilers and options:
@item SunOS 5.6 i86pc with @code{gcc} 2.8.1
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item Solaris 2.8 sparc with @code{gcc 2.95.3}
@code{CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql "--with-comment=Official MySQL binary" --with-extra-charsets=complex "--with-server-suffix=" --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared}
@item Linux 2.0.33 i386 with @code{pgcc} 2.90.29 (@code{egcs} 1.0.3a)
@code{CFLAGS="-O3 -mpentium -mstack-align-double" CXX=gcc CXXFLAGS="-O3 -mpentium -mstack-align-double -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-extra-charsets=complex}
+5 −3
Original line number Diff line number Diff line
@@ -67,9 +67,11 @@ enum ha_rkey_function {
	/* Key algorithm types */

enum ha_key_alg {			
  HA_KEY_ALG_BTREE=0,			/* B-tree, default one          */
  HA_KEY_ALG_RTREE=1,			/* R-tree, for spatial searches */
  HA_KEY_ALG_HASH=2			/* HASH keys (HEAP tables) */
  HA_KEY_ALG_UNDEF=	0,		/* Not specified (old file) */
  HA_KEY_ALG_BTREE=	1,		/* B-tree, default one          */
  HA_KEY_ALG_RTREE=	2,		/* R-tree, for spatial searches */
  HA_KEY_ALG_HASH=	3,		/* HASH keys (HEAP tables) */
  HA_KEY_ALG_FULLTEXT=	4		/* FULLTEXT (MyISAM tables) */
};

	/* The following is parameter to ha_extra() */
+31 −21
Original line number Diff line number Diff line
@@ -54,32 +54,32 @@
ulong max_allowed_packet=65536;
extern ulong net_read_timeout,net_write_timeout;
extern uint test_flags;
#define USE_QUERY_CACHE
extern void query_cache_insert(NET *net, const char *packet, ulong length);
#else
ulong max_allowed_packet=16*1024*1024L;
ulong net_read_timeout=  NET_READ_TIMEOUT;
ulong net_write_timeout= NET_WRITE_TIMEOUT;
#endif

#ifdef __WIN__
#if defined(__WIN__) || !defined(MYSQL_SERVER)
  /* The following is because alarms doesn't work on windows. */
#undef MYSQL_SERVER
#define NO_ALARM
#endif
  
#ifdef MYSQL_SERVER
#ifndef NO_ALARM
#include "my_pthread.h"
void sql_print_error(const char *format,...);
#define RETRY_COUNT mysqld_net_retry_count
extern ulong mysqld_net_retry_count;
extern ulong bytes_sent, bytes_received;
extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;

extern void query_cache_insert(NET *net, const char *packet, ulong length);
#else
#undef statistic_add
#define statistic_add(A,B,C)
#define DONT_USE_THR_ALARM
#define RETRY_COUNT 1
#endif /* MYSQL_SERVER */
#endif /* NO_ALARM */

#include "thr_alarm.h"

@@ -167,7 +167,7 @@ static my_bool net_realloc(NET *net, ulong length)

void net_clear(NET *net)
{
#ifndef EXTRA_DEBUG
#if !defined(EXTRA_DEBUG) && !defined(EMBEDDED_LIBRARY)
  int count;					/* One may get 'unused' warn */
  bool is_blocking=vio_is_blocking(net->vio);
  if (is_blocking)
@@ -322,14 +322,15 @@ net_real_write(NET *net,const char *packet,ulong len)
  long int length;
  char *pos,*end;
  thr_alarm_t alarmed;
#if defined(MYSQL_SERVER)
#ifndef NO_ALARM
  ALARM alarm_buff;
#endif
  uint retry_count=0;
  my_bool net_blocking = vio_is_blocking(net->vio);
  DBUG_ENTER("net_real_write");

#ifdef MYSQL_SERVER
#if defined(MYSQL_SERVER) && defined(HAVE_QUERY_CACHE)
  if (net->query_cache_query != 0)
    query_cache_insert(net, packet, len);
#endif

@@ -370,13 +371,13 @@ net_real_write(NET *net,const char *packet,ulong len)
#endif /* HAVE_COMPRESS */

  /* DBUG_DUMP("net",packet,len); */
#ifdef MYSQL_SERVER
#ifndef NO_ALARM
  thr_alarm_init(&alarmed);
  if (net_blocking)
    thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff);
#else
  alarmed=0;
#endif /* MYSQL_SERVER */
#endif /* NO_ALARM */

  pos=(char*) packet; end=pos+len;
  while (pos != end)
@@ -458,8 +459,7 @@ net_real_write(NET *net,const char *packet,ulong len)
** Read something from server/clinet
*****************************************************************************/

#ifdef MYSQL_SERVER

#ifndef NO_ALARM
/*
  Help function to clear the commuication buffer when we get a too
  big packet
@@ -492,7 +492,7 @@ static void my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed)
    statistic_add(bytes_received,length,&LOCK_bytes_received);
  }
}
#endif /* MYSQL_SERVER */
#endif /* NO_ALARM */


/*
@@ -509,7 +509,7 @@ my_real_read(NET *net, ulong *complen)
  uint i,retry_count=0;
  ulong len=packet_error;
  thr_alarm_t alarmed;
#if defined(MYSQL_SERVER)
#ifndef NO_ALARM
  ALARM alarm_buff;
#endif
  my_bool net_blocking=vio_is_blocking(net->vio);
@@ -519,10 +519,10 @@ my_real_read(NET *net, ulong *complen)

  net->reading_or_writing=1;
  thr_alarm_init(&alarmed);
#ifdef MYSQL_SERVER
#ifndef NO_ALARM
  if (net_blocking)
    thr_alarm(&alarmed,net->timeout,&alarm_buff);
#endif /* MYSQL_SERVER */
#endif /* NO_ALARM */

    pos = net->buff + net->where_b;		/* net->packet -4 */
    for (i=0 ; i < 2 ; i++)
@@ -645,7 +645,7 @@ my_real_read(NET *net, ulong *complen)
	{
	  if (net_realloc(net,helping))
	  {
#ifdef MYSQL_SERVER
#ifndef NO_ALARM
	    if (i == 1)
	      my_net_skip_rest(net, (uint32) len, &alarmed);
#endif
@@ -814,3 +814,13 @@ my_net_read(NET *net)
#endif /* HAVE_COMPRESS */
  return len;
}

int net_request_file(NET* net, const char* fname)
{
  char tmp [FN_REFLEN+1],*end;
  DBUG_ENTER("net_request_file");
  tmp[0] = (char) 251;				/* NULL_LENGTH */
  end=strnmov(tmp+1,fname,sizeof(tmp)-2);
  DBUG_RETURN(my_net_write(net,tmp,(uint) (end-tmp)) ||
	      net_flush(net));
}
+2 −2
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@ format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) for
2	123.6	1,234.56	12,345.556	123,456.5555	1,234,567.55550	12,345.24
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"))
255.255.255.255.255.255.255.255
NULL
select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255");
inet_aton("255.255.255.255.255")	inet_aton("255.255.1.255")	inet_aton("0.1.255")
1099511627775	4294902271	511
select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
inet_ntoa(1099511627775)	inet_ntoa(4294902271)	inet_ntoa(511)
255.255.255.255.255	255.255.1.255	0.0.1.255
NULL	255.255.1.255	0.0.1.255
+2 −2
Original line number Diff line number Diff line
@@ -362,9 +362,9 @@ void Field::store_time(TIME *ltime,timestamp_type type)
}


bool Field::optimize_range()
bool Field::optimize_range(uint idx)
{
  return test(table->file->option_flag() & HA_READ_NEXT);
  return test(table->file->index_flags(idx) & HA_READ_NEXT);
}

/****************************************************************************
Loading