Commit ff173891 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Fix for FLUSH QUERY CACHE

Fix for new bug in CREATE TABLE when sorting keys.
parent fd81437a
Loading
Loading
Loading
Loading
+42 −8
Original line number Diff line number Diff line
@@ -5393,6 +5393,10 @@ You will need the following:
A Windows 32 bits Operational System of the family Win9x, ME,
NT and Win 2000. The NT family permits running the MySQL server
as a service. @xref{NT start}.
If you want to use tables bigger than 4G, you should install MySQL
on NTFS or newer file system. Don't forget to use @code{MAX_ROWS} and
@code{AVG_ROW_LENGTH} when you create the table. @xref{CREATE TABLE}.
@item
TCP/IP protocol support.
@item
@@ -32218,6 +32222,25 @@ returns immediately. The return value is the number of log events it had to
wait to get to the specified position, or NULL in case of error. Useful for
control of master-slave synchronisation, but was originally written to
facilitate replication testing.
@findex FOUND_ROWS()
@findex LIMIT
@item FOUND_ROWS()
Returns the number of rows that the last @code{SELECT CALC_FOUND_ROWS ...}
command would have returned, if wasn't restricted with @code{LIMIT}.
@example
SELECT CALC_FOUND_ROWS * FROM table_name WHERE id > 100 LIMIT 10;
SELECT FOUND_ROWS();
@end example
The second select will return how many rows the SELECT should have
returned if we would remove the @code{LIMIT} clause.
Note that if you are using @code{SELECT CALC_FOUND_ROWS ...} MySQL has
to calculate all rows in the result set.  This is however faster than
if you would not use @code{LIMIT} as the result set doesn't have to be sent
to the client.
@end table
@@ -32404,7 +32427,7 @@ mysql> SELECT id,FLOOR(value/100) FROM tbl_name ORDER BY RAND();
@c help SELECT
@example
SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
       [SQL_CACHE | SQL_NO_CACHE] [HIGH_PRIORITY]
       [SQL_CACHE | SQL_NO_CACHE] [CALC_FOUND_ROWS] [HIGH_PRIORITY]
       [DISTINCT | DISTINCTROW | ALL]
    select_expression,...
    [INTO @{OUTFILE | DUMPFILE@} 'file_name' export_options]
@@ -32561,6 +32584,12 @@ result set will be small. In this case, MySQL will use fast
temporary tables to store the resulting table instead of using sorting. In
MySQL Version 3.23 this shouldn't normally be needed.
@item
@code{CALC_FOUND_ROWS} tells MySQL to calculate how many rows there
would be in the result, disregarding any @code{LIMIT} clause. The number
of rows can be obtained with @code{SELECT
FOUND_ROWS()}. @xref{Miscellaneous functions}.
@item
@code{SQL_CACHE} tells MySQL to store the query result in the query cache
if you are using @code{SQL_QUERY_CACHE_TYPE=2} (@code{DEMAND}).
@@ -34493,12 +34522,14 @@ original tables, MySQL will not allow concurrent inserts during
@item
The @code{RAID_TYPE} option will help you to break the 2G/4G limit for
the MyISAM data file (not the index file) on operating systems that
don't support big files.
You can get more speed from the I/O bottleneck by putting
@code{RAID} directories on different physical disks. @code{RAID_TYPE}
will work on any OS, as long as you have configured MySQL with
@code{--with-raid}.  For now the only allowed @code{RAID_TYPE} is
@code{STRIPED} (@code{1} and @code{RAID0} are aliases for this).
don't support big files. Note that this option is not recommended for
file system that supports big files!
You can get more speed from the I/O bottleneck by putting @code{RAID}
directories on different physical disks. @code{RAID_TYPE} will work on
any OS, as long as you have configured MySQL with @code{--with-raid}.
For now the only allowed @code{RAID_TYPE} is @code{STRIPED} (@code{1}
and @code{RAID0} are aliases for this).
If you specify @code{RAID_TYPE=STRIPED} for a @code{MyISAM} table,
@code{MyISAM} will create @code{RAID_CHUNKS} subdirectories named 00,
@@ -43274,7 +43305,8 @@ No UDF functions.
@item
No stack trace on core dump.
@item
No internal RAID support.
No internal RAID support. (This is not normally needed as most OS has
nowadays support for big files).
@item
You can set this up as a server or a master (no replication).
@item
@@ -47996,6 +48028,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
Fixed bug in @code{FLUSH QUERY CACHE}.
@item
Added @code{CAST()} and @code{CONVERT()} functions.
@item
Changed order of how keys are created in tables.
+21 −1
Original line number Diff line number Diff line
@@ -56,7 +56,19 @@ enum ha_rkey_function {
  HA_READ_AFTER_KEY,			/* Find next rec. after key-record */
  HA_READ_BEFORE_KEY,			/* Find next rec. before key-record */
  HA_READ_PREFIX,			/* Key which as same prefix */
  HA_READ_PREFIX_LAST			/* Last key with the same prefix */			
  HA_READ_PREFIX_LAST,			/* Last key with the same prefix */
  HA_READ_MBR_CONTAIN,
  HA_READ_MBR_INTERSECT,
  HA_READ_MBR_WITHIN,
  HA_READ_MBR_DISJOINT,
  HA_READ_MBR_EQUAL
};

	/* 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 */
};

	/* The following is parameter to ha_extra() */
@@ -136,6 +148,8 @@ enum ha_base_keytype {
#define HA_BINARY_PACK_KEY	 32	/* Packing of all keys to prev key */
#define HA_FULLTEXT		128     /* SerG: for full-text search */
#define HA_UNIQUE_CHECK		256	/* Check the key for uniqueness */
#define HA_SPATIAL		1024    /* Alex Barkov: for spatial search */


	/* Automatic bits in key-flag */

@@ -239,6 +253,12 @@ enum ha_base_keytype {
#define SEARCH_UPDATE	64
#define SEARCH_PREFIX	128
#define SEARCH_LAST	256
#define MBR_CONTAIN     512
#define MBR_INTERSECT   1024
#define MBR_WITHIN      2048
#define MBR_DISJOINT    4096
#define MBR_EQUAL       8192
#define MBR_DATA        16384

	/* bits in opt_flag */
#define QUICK_USED	1
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */
  uint16 keysegs;			/* Number of key-segment */
  uint16 flag;				/* NOSAME, PACK_USED */

  uint8  key_alg;			/* BTREE, RTREE */
  uint16 block_length;			/* Length of keyblock (auto) */
  uint16 underflow_block_length;	/* When to execute underflow */
  uint16 keylength;			/* Tot length of keyparts (auto) */
+2 −1
Original line number Diff line number Diff line
@@ -150,7 +150,8 @@ enum enum_field_types { FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY,
			FIELD_TYPE_LONG_BLOB=251,
			FIELD_TYPE_BLOB=252,
			FIELD_TYPE_VAR_STRING=253,
			FIELD_TYPE_STRING=254
			FIELD_TYPE_STRING=254,
			FIELD_TYPE_GEOMETRY=255
};

#define FIELD_TYPE_CHAR FIELD_TYPE_TINY		/* For compability */
+4 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ static uint lengths[256];
int main(int argc,char *argv[])
{
  int error=0;
  uint keylen, keylen2, inx, doc_cnt=0;
  uint keylen, keylen2=0, inx, doc_cnt=0;
  float weight;
  double gws, min_gws=0, avg_gws=0;
  MI_INFO *info;
@@ -151,7 +151,7 @@ int main(int argc,char *argv[])
      for (inx=0;inx<256;inx++)
      {
        count+=lengths[inx];
        if (count >= total/2)
        if ((ulong) count >= total/2)
          break;
      }
      printf("Total rows: %qu\nTotal words: %lu\n"
@@ -170,7 +170,8 @@ int main(int argc,char *argv[])
        count+=lengths[inx];
        if (count && lengths[inx])
          printf("%3u: %10lu %5.2f%% %20lu %4.1f%%\n", inx,
              lengths[inx],100.0*lengths[inx]/total,count, 100.0*count/total);
		 (ulong) lengths[inx],100.0*lengths[inx]/total,(ulong) count,
		 100.0*count/total);
      }
    }
  }
Loading