Commit 33e636cb authored by unknown's avatar unknown

Added missing include file to sql_acl.cc (bug in last changeset)


Docs/manual.texi:
  Updated Table is full section.
client/mysql.cc:
  Applied patch for fixing tee()
sql/sql_acl.cc:
  Added include file
parent e91d0d89
...@@ -46661,12 +46661,16 @@ than you have alloacated for @code{mysqld}. @xref{Packet too large}. ...@@ -46661,12 +46661,16 @@ than you have alloacated for @code{mysqld}. @xref{Packet too large}.
@cindex table is full @cindex table is full
This error occurs in older MySQL versions when an in-memory temporary There is a couple of different cases when you can get this error:
table becomes larger than @code{tmp_table_size} bytes. To avoid this
problem, you can use the @code{-O tmp_table_size=#} option to @itemize @bullet
@code{mysqld} to increase the temporary table size or use the SQL @item
option @code{SQL_BIG_TABLES} before you issue the problematic You are using an older MySQL versions ( < 3.23.0) when an in-memory
query. @xref{SET OPTION, , @code{SET OPTION}}. temporary table becomes larger than @code{tmp_table_size} bytes. To
avoid this problem, you can use the @code{-O tmp_table_size=#} option to
@code{mysqld} to increase the temporary table size or use the SQL option
@code{SQL_BIG_TABLES} before you issue the problematic query. @xref{SET
OPTION, , @code{SET OPTION}}.
You can also start @code{mysqld} with the @code{--big-tables} option. You can also start @code{mysqld} with the @code{--big-tables} option.
This is exactly the same as using @code{SQL_BIG_TABLES} for all queries. This is exactly the same as using @code{SQL_BIG_TABLES} for all queries.
...@@ -46674,6 +46678,30 @@ This is exactly the same as using @code{SQL_BIG_TABLES} for all queries. ...@@ -46674,6 +46678,30 @@ This is exactly the same as using @code{SQL_BIG_TABLES} for all queries.
In MySQL Version 3.23, in-memory temporary tables will automatically be In MySQL Version 3.23, in-memory temporary tables will automatically be
converted to a disk-based @code{MyISAM} table after the table size gets converted to a disk-based @code{MyISAM} table after the table size gets
bigger than @code{tmp_table_size}. bigger than @code{tmp_table_size}.
@item
You are using InnoDB tables and run out of room in the InnoDB tablespace.
In this case the solution is to add extend the InnoDB table space.
@item
You are using ISAM/MyISAM tables on a OS that only supports 2G files
and you have hit this limit for the data or index file.
@item
You are using MyISAM tables and the needed data or index size is bigger
than what MySQL has allocated pointers for. (If you don't specify
@code{MAX_ROWS} to @code{CREATE TABLE} MySQL will only allocate pointers
to hold 4G of data).
One can check the maximum data/index sizes by doing @code{SHOW TABLE
STATUS FROM database LIKE 'table_name} or using @code{myisamchk -dv
database/table_name}.
If this is the problem, you can fix it by doing something like:
@code{ALTER TABLE table_name MAX_ROWS=1000000000 AVG_ROW_LENGTH=XXX}.
You only have to specify @code{AVG_ROW_LENGTH} for tables with BLOB/TEXT
fields as in this case MySQL can't optimise the needed space just based
on the number of rows.
@end itemize
@node Cannot create, Commands out of sync, Full table, Common errors @node Cannot create, Commands out of sync, Full table, Common errors
...@@ -51432,7 +51460,7 @@ now can be specified in octal by beginning the value with a zero. ...@@ -51432,7 +51460,7 @@ now can be specified in octal by beginning the value with a zero.
Added @code{RIGHT JOIN}. This makes @code{RIGHT} a reserved word. Added @code{RIGHT JOIN}. This makes @code{RIGHT} a reserved word.
@item @item
Added @code{@@@@IDENTITY} as a synonym for @code{LAST_INSERT_ID()}. Added @code{@@@@IDENTITY} as a synonym for @code{LAST_INSERT_ID()}.
(This is for Visual Basic compatibility.) (This is for MSSQL compatibility.)
@item @item
Fixed a bug in @code{myisamchk} and @code{REPAIR} when using @code{FULLTEXT} Fixed a bug in @code{myisamchk} and @code{REPAIR} when using @code{FULLTEXT}
index. index.
...@@ -186,7 +186,7 @@ static void safe_put_field(const char *pos,ulong length); ...@@ -186,7 +186,7 @@ static void safe_put_field(const char *pos,ulong length);
static void xmlencode_print(const char *src, uint length); static void xmlencode_print(const char *src, uint length);
static void init_pager(); static void init_pager();
static void end_pager(); static void end_pager();
static void init_tee(); static int init_tee(char *);
static void end_tee(); static void end_tee();
static const char* construct_prompt(); static const char* construct_prompt();
static void init_username(); static void init_username();
...@@ -619,11 +619,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -619,11 +619,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
end_tee(); end_tee();
} }
else else
if (!opt_outfile) opt_outfile= init_tee(argument);
{
strmov(outfile, argument);
init_tee();
}
break; break;
case OPT_NOTEE: case OPT_NOTEE:
printf("WARNING: option deprecated; use --disable-tee instead.\n"); printf("WARNING: option deprecated; use --disable-tee instead.\n");
...@@ -1517,19 +1513,21 @@ static void end_pager() ...@@ -1517,19 +1513,21 @@ static void end_pager()
#endif #endif
} }
static void init_tee()
static int init_tee(char* newfile)
{ {
FILE* new_outfile;
if (!(new_outfile= my_fopen(newfile, O_APPEND | O_WRONLY, MYF(MY_WME))))
return 0;
if (opt_outfile) if (opt_outfile)
end_tee(); // This resets opt_outfile end_tee();
if (!(OUTFILE= my_fopen(outfile, O_APPEND | O_WRONLY, MYF(MY_WME)))) OUTFILE = new_outfile;
{ strmake(outfile,newfile,FN_REFLEN-1);
init_pager();
return;
}
opt_outfile= 1;
tee_fprintf(stdout, "Logging to file '%s'\n", outfile); tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
return 1;
} }
static void end_tee() static void end_tee()
{ {
my_fclose(OUTFILE, MYF(0)); my_fclose(OUTFILE, MYF(0));
...@@ -1841,29 +1839,39 @@ com_tee(String *buffer, char *line __attribute__((unused))) ...@@ -1841,29 +1839,39 @@ com_tee(String *buffer, char *line __attribute__((unused)))
if (!strlen(outfile)) if (!strlen(outfile))
{ {
printf("No previous outfile available, you must give a filename!\n"); printf("No previous outfile available, you must give a filename!\n");
opt_outfile= 0;
return 0; return 0;
} }
else if (opt_outfile)
{
tee_fprintf(stdout, "Currently logging to file '%s'\n", outfile);
return 0;
} }
else else
{ param = outfile; //resume using the old outfile
}
/* eliminate the spaces before the parameters */
while (isspace(*param)) while (isspace(*param))
param++; param++;
end= strmake(file_name, param, sizeof(file_name) - 1); end= strmake(file_name, param, sizeof(file_name) - 1);
/* remove end space from command line */
while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1]))) while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1])))
end--; end--;
end[0]= 0; end[0]= 0;
strmov(outfile, file_name);
}
if (!strlen(outfile)) if (!strlen(outfile))
{ {
printf("No outfile specified!\n"); printf("No outfile specified!\n");
return 0; return 0;
} }
init_tee(); opt_outfile= init_tee(file_name);
if (opt_outfile)
tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
else
tee_fprintf(stdout, "Error logging to file '%s'\n",file_name);
return 0; return 0;
} }
static int static int
com_notee(String *buffer __attribute__((unused)), com_notee(String *buffer __attribute__((unused)),
char *line __attribute__((unused))) char *line __attribute__((unused)))
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "sql_acl.h" #include "sql_acl.h"
#include "hash_filo.h" #include "hash_filo.h"
#include <m_ctype.h> #include <m_ctype.h>
#include <assert.h>
#include <stdarg.h> #include <stdarg.h>
struct acl_host_and_ip struct acl_host_and_ip
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment