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

Fixed bug in mysqlcheck when using --fast

Fixed problem when converting bigint to double.
Fixed bug in count(distinct null)
Fixed bug with empty BDB tables.
parent 16d50ca4
Loading
Loading
Loading
Loading
+69 −14
Original line number Diff line number Diff line
@@ -990,6 +990,7 @@ Changes in release 4.0.x (Development; Alpha)
Changes in release 3.23.x  (Stable)
* News-3.23.40::                Changes in release 3.23.40
* News-3.23.39::                Changes in release 3.23.39
* News-3.23.38::                Changes in release 3.23.38
* News-3.23.37::                Changes in release 3.23.37
@@ -7551,6 +7552,40 @@ relative to the root of @code{glibc} Note that @strong{MySQL} will not be
stable with around 600-1000 connections if @code{STACK_SIZE} is the default 
of 2 MB.
If you have a problem with that @strong{MySQL} can't open enough files,
or connections, it may be that you haven't configured Linux to handle
enough files.
In Linux 2.2 and forwards, you can check the number of allocated
file handlers by doing:
@example
cat /proc/sys/fs/file-max
cat /proc/sys/fs/dquot-max 
cat /proc/sys/fs/super-max
@end example
If you have more than 16M of memory, you should add something like the
following in your boot script (@file{/etc/rc/boot.local} on SuSE):
@example
echo 65536 > /proc/sys/fs/file-max
echo 8192 > /proc/sys/fs/dquot-max
echo 1024 > /proc/sys/fs/super-max
@end example
You can also run the above from the command line as root, but in this case
your old limits will be used next time your computer reboots.
You should also add /etc/my.cnf:
@example
[safe_mysqld]
open_files_limit=8192
@end example
The above should allow @strong{MySQL} to create up to 8192 connections + files.
The @code{STACK_SIZE} constant in LinuxThreads controls the spacing of thread
stacks in the address space.  It needs to be large enough so that there will
be plenty of room for the stack of each individual thread, but small enough
@@ -9573,11 +9608,8 @@ and are configured with the following compilers and options:
@item SunOS 4.1.4 2 sun4c with @code{gcc} 2.7.2.1
@code{CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-assembler}
@item SunOS 5.5.1 sun4u with @code{egcs} 1.0.3a
@code{CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item SunOS 5.6 sun4u with @code{egcs} 2.90.27
@code{CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item SunOS 5.5.1 (and above) sun4u with @code{egcs} 1.0.3a or 2.90.27 or gcc 2.95.2 and newer
@code{CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex --enable-assembler}
@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}
@@ -19404,9 +19436,6 @@ INDEX} are @strong{MySQL} extensions to ANSI SQL92.
@item
@code{MODIFY} is an Oracle extension to @code{ALTER TABLE}.
@item
@code{TRUNCATE} is an Oracle extension. @xref{TRUNCATE}.
@item
The optional word @code{COLUMN} is a pure noise word and can be omitted.
@@ -19790,6 +19819,8 @@ minimum needed to restore it. Currenlty only works for @code{MyISAM}
tables. For @code{MyISAM} table, copies @code{.frm} (definition)  and
@code{.MYD} (data) files. The index file can be rebuilt from those two.
Before using this command, please see @xref{Backup}.
During the backup, read lock will be held for each table, one at time,
as they are being backed up. If you want to backup several tables as
a snapshot, you must first issue @code{LOCK TABLES} obtaining a read
@@ -19998,6 +20029,8 @@ valid, the table can be re-created this way, even if the data or index
files have become corrupted.
@end itemize
@code{TRUNCATE} is an Oracle SQL extension.
@findex SELECT
@node SELECT, JOIN, TRUNCATE, Reference
@section @code{SELECT} Syntax
@@ -20753,6 +20786,13 @@ In other words, you can't access the values of the old row from a
@code{REPLACE} statement.  In some old @strong{MySQL} version it looked
like you could do this, but that was a bug that has been corrected.
When one uses a @code{REPLACE} command, @code{mysql_affected_rows()}
will return 2 if the new row replaced and old row.  This is because in
this case one row was inserted and then the duplicate was deleted.
The above makes it easy to check if @code{REPLACE} added or replaced a
row.
@findex LOAD DATA INFILE
@node LOAD DATA, UPDATE, REPLACE, Reference
@section @code{LOAD DATA INFILE} Syntax
@@ -22741,8 +22781,6 @@ This statement is provided for Oracle compatibility.
The @code{SHOW} statement provides similar information.
@xref{SHOW, , @code{SHOW}}.
@findex BEGIN
@findex COMMIT
@findex ROLLBACK
@@ -38689,6 +38727,8 @@ shell> perror 23
File table overflow
shell> perror 24
Too many open files
shell> perror 11
Resource temporarily unavailable
@end example
The problem here is that @code{mysqld} is trying to keep open too many
@@ -39206,8 +39246,8 @@ database directory. The @code{FLUSH TABLE} is needed to ensure that
the all active index pages is written to disk before you start the backup.
If you want to make a SQL level backup of a table, you can use
@code{SELECT INTO OUTFILE} or @code{BACKUP
TABLE}. @xref{SELECT}. @xref{BACKUP TABLE}.
@code{SELECT INTO OUTFILE} or @code{BACKUP TABLE}. @xref{SELECT}.
@xref{BACKUP TABLE}.
Another way to back up a database is to use the @code{mysqldump} program or
the @code{mysqlhotcopy script}. @xref{mysqldump, , @code{mysqldump}}.
@@ -41736,7 +41776,7 @@ specified explicitly.
@item
The @code{passwd} parameter contains the password for @code{user}.  If
@code{passwd} is @code{NULL}, only entries in the @code{user} table for the
user that have a blank password field will be checked for a match. This
user that have a blank (empty) password field will be checked for a match. This
allows the database administrator to set up the @strong{MySQL} privilege
system in such a way that users get different privileges depending on whether
or not they have specified a password.
@@ -46309,6 +46349,7 @@ users use this code as the rest of the code and because of this we are
not yet 100% confident in this code.
@menu
* News-3.23.40::                Changes in release 3.23.40
* News-3.23.39::                Changes in release 3.23.39
* News-3.23.38::                Changes in release 3.23.38
* News-3.23.37::                Changes in release 3.23.37
@@ -46352,7 +46393,21 @@ not yet 100% confident in this code.
* News-3.23.0::                 Changes in release 3.23.0
@end menu
@node News-3.23.39, News-3.23.38, News-3.23.x, News-3.23.x
@node News-3.23.40, News-3.23.39, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.40
@itemize @bullet
@item
Fixed bug when converting @code{UNSIGNED BIGINT} to @code{DOUBLE}. This caused
a problem when doing comparisons with @code{BIGINT}'s outside of the
signed range.
@item
Fixed bug in @code{BDB} tables when querying empty tables.
@item
Fixed a bug when using @code{COUNT(DISTINCT)} with @code{LEFT JOIN} and
there wasn't any matching rows.
@end itemize
@node News-3.23.39, News-3.23.38, News-3.23.40, News-3.23.x
@appendixsubsec Changes in release 3.23.39
@itemize @bullet
@item
+30 −20
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

/* By Jani Tolonen, 2001-04-20, MySQL Development Team */

#define CHECK_VERSION "1.01"
#define CHECK_VERSION "1.02"

#include <global.h>
#include <my_sys.h>
@@ -503,14 +503,14 @@ static int use_db(char *database)

static int handle_request_for_tables(char *tables, uint length)
{
  char *query, *end, options[100];
  char *query, *end, options[100], message[100];
  const char *op = 0;

  options[0] = 0;
  end = options;
  switch (what_to_do) {
  case DO_CHECK:
    op = "CHECK";
    end = options;
    if (opt_quick)              end = strmov(end, " QUICK");
    if (opt_fast)               end = strmov(end, " FAST");
    if (opt_medium_check)       end = strmov(end, " MEDIUM"); /* Default */
@@ -519,7 +519,6 @@ static int handle_request_for_tables(char *tables, uint length)
    break;
  case DO_REPAIR:
    op = "REPAIR";
    end = options;
    if (opt_quick)              end = strmov(end, " QUICK");
    if (opt_extended)           end = strmov(end, " EXTENDED");
    break;
@@ -533,11 +532,11 @@ static int handle_request_for_tables(char *tables, uint length)

  if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
    return 1;
  sprintf(query, "%s TABLE %s %s", op, options, tables);
  sprintf(query, "%s TABLE %s %s", op, tables, options);
  if (mysql_query(sock, query))
  {
    sprintf(options, "when executing '%s TABLE'", op);
    DBerror(sock, options);
    sprintf(message, "when executing '%s TABLE ... %s", op, options);
    DBerror(sock, message);
    return 1;
  }
  print_result();
@@ -551,23 +550,34 @@ static void print_result()
  MYSQL_RES *res;
  MYSQL_ROW row;
  char prev[NAME_LEN*2+2];
  int i;
  uint i;
  my_bool found_error=0;

  res = mysql_use_result(sock);
  prev[0] = '\0';
  for (i = 0; (row = mysql_fetch_row(res)); i++)
  {
    int changed = strcmp(prev, row[0]);
    int status = !strcmp(row[2], "status");
    if (opt_silent && status)
    my_bool status = !strcmp(row[2], "status");

    if (status)
    {
      if (found_error)
      {
	if (what_to_do != DO_REPAIR && opt_auto_repair &&
	    (!opt_fast || strcmp(row[3],"OK")))
	  insert_dynamic(&tables4repair, row[0]);
      }
      found_error=0;
      if (opt_silent)
	continue;
    }
    if (status && changed)
      printf("%-50s %s", row[0], row[3]);
    else if (!status && changed)
    {
      printf("%s\n%-9s: %s", row[0], row[2], row[3]);
      if (what_to_do != DO_REPAIR && opt_auto_repair)
	insert_dynamic(&tables4repair, row[0]);
      found_error=1;
    }
    else
      printf("%-9s: %s", row[2], row[3]);
+2 −0
Original line number Diff line number Diff line
@@ -509,3 +509,5 @@ id id3
1	1
2	2
100	2
KINMU_DATE
KINMU_DATE
+6 −0
Original line number Diff line number Diff line
@@ -5,5 +5,11 @@
+9999999999999999999	-9999999999999999999
10000000000000000000	-10000000000000000000
a
18446744073709551614
18446744073709551615
a
18446744073709551615
a
18446744073709551615
a
18446744073709551614
+2 −0
Original line number Diff line number Diff line
@@ -7,3 +7,5 @@ isbn city libname a
isbn	city	libname	a
007	Berkeley	Berkeley Public1	2
000	New York	New York Public Libra	2
f1	count(distinct t2.f2)	count(distinct 1,NULL)
1	0	0
Loading