Fixes for bugs in the usage of IO_CACHE
Docs/manual.texi: Fixed the TRUNCATE syntax + Changelog include/my_sys.h: Added my_b_vprintf mysys/mf_iocache2.c: Added my_b_vprintf mysys/my_vsnprintf.c: Fixed fatal (new) bug mysys/thr_lock.c: Cleanup readline/bind.c: cleanup scripts/Makefile.am: Added mysqldumpslow sql-bench/crash-me.sh: Fixed TRUNCATE sql/log.cc: bug fix sql/log_event.cc: Removed compiler warnings sql/log_event.h: Fixed non portable header in binary dump sql/mf_iocache.cc: cleanup sql/mysqld.cc: Fixed loop problem on NT sql/slave.cc: cleanup sql/sql_class.cc: Fixed typos sql/sql_parse.cc: cleanup sql/sql_select.cc: bugfix sql/sql_table.cc: cleanup sql/sql_yacc.yy: Changed ALTER TABLE ... ORDER BY to get fewer warnings sql/unireg.cc: cleanup sql/unireg.h: Added missing define
This commit is contained in:
parent
24137ef261
commit
8f906f7790
@ -374,7 +374,7 @@ MySQL Language Reference
|
|||||||
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
|
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
|
||||||
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
|
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
|
||||||
* DELETE:: @code{DELETE} syntax
|
* DELETE:: @code{DELETE} syntax
|
||||||
* TRUNCATE::
|
* TRUNCATE:: @code{TRUNCATE} syntax
|
||||||
* SELECT:: @code{SELECT} syntax
|
* SELECT:: @code{SELECT} syntax
|
||||||
* JOIN:: @code{JOIN} syntax
|
* JOIN:: @code{JOIN} syntax
|
||||||
* INSERT:: @code{INSERT} syntax
|
* INSERT:: @code{INSERT} syntax
|
||||||
@ -1011,8 +1011,7 @@ The following list describes some useful sections of the manual:
|
|||||||
For a discussion of @strong{MySQL}'s capabilities, see @ref{Features}.
|
For a discussion of @strong{MySQL}'s capabilities, see @ref{Features}.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
For installation instructions, see @ref{Installing}. For tips on porting
|
For installation instructions, see @ref{Installing}.
|
||||||
@strong{MySQL} to new architectures or operating systems, see @ref{Porting}.
|
|
||||||
|
|
||||||
@item
|
@item
|
||||||
For tips on porting @strong{MySQL} to new architectures or operating
|
For tips on porting @strong{MySQL} to new architectures or operating
|
||||||
@ -3581,7 +3580,9 @@ We will provide hints on optimizing your system and your queries.
|
|||||||
|
|
||||||
@item
|
@item
|
||||||
You are allowed to call a @strong{MySQL} developer (in moderation) and
|
You are allowed to call a @strong{MySQL} developer (in moderation) and
|
||||||
discuss your @strong{MySQL}-related problems.
|
discuss your @strong{MySQL}-related problems. This option is however
|
||||||
|
only to be used as a last result during an emergency after we have
|
||||||
|
failed to grasp the total problem with email.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@node Extended login support, , Login support, Support
|
@node Extended login support, , Login support, Support
|
||||||
@ -12590,7 +12591,7 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run
|
|||||||
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
|
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
|
||||||
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
|
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
|
||||||
* DELETE:: @code{DELETE} syntax
|
* DELETE:: @code{DELETE} syntax
|
||||||
* TRUNCATE::
|
* TRUNCATE:: @code{TRUNCATE} syntax
|
||||||
* SELECT:: @code{SELECT} syntax
|
* SELECT:: @code{SELECT} syntax
|
||||||
* JOIN:: @code{JOIN} syntax
|
* JOIN:: @code{JOIN} syntax
|
||||||
* INSERT:: @code{INSERT} syntax
|
* INSERT:: @code{INSERT} syntax
|
||||||
@ -18264,7 +18265,7 @@ the @code{LIMIT} value.
|
|||||||
@section @code{TRUNCATE} syntax
|
@section @code{TRUNCATE} syntax
|
||||||
|
|
||||||
@example
|
@example
|
||||||
TRUNCATE TABLE table_name
|
TRUNCATE table_name
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Is in 3.23 and the same thing as @code{DELETE FROM table_name}. @xref{DELETE}.
|
Is in 3.23 and the same thing as @code{DELETE FROM table_name}. @xref{DELETE}.
|
||||||
@ -19528,7 +19529,7 @@ the @code{mysql} database.
|
|||||||
|
|
||||||
@item @code{TABLES} @tab Closes all open tables and force all tables in use to be closed.
|
@item @code{TABLES} @tab Closes all open tables and force all tables in use to be closed.
|
||||||
|
|
||||||
@item @code{TABLES table_name [,table_name...]} @tab Flush only the given tables
|
@item @code{[TABLE | TABLES] table_name [,table_name...]} @tab Flush only the given tables
|
||||||
|
|
||||||
@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convinient way to get backups if you have a file system, like Veritas,that can take snapshots in time.
|
@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convinient way to get backups if you have a file system, like Veritas,that can take snapshots in time.
|
||||||
|
|
||||||
@ -21551,13 +21552,19 @@ while other threads are reading from the table.
|
|||||||
Support for big files (63-bit) on filesystems/operating systems that
|
Support for big files (63-bit) on filesystems/operating systems that
|
||||||
support big files.
|
support big files.
|
||||||
@item
|
@item
|
||||||
All data is stored with the low byte first. This makes the data machine and
|
All data is stored with the low byte first. This makes the data machine
|
||||||
OS independent. The only requirement is that the machine uses two's-complement
|
and OS independent. The only requirement is that the machine uses
|
||||||
signed integers (as every machine for the last 20 years has)
|
two's-complement signed integers (as every machine for the last 20 years
|
||||||
and IEEE floating-point format (also totally dominant among mainstream
|
has) and IEEE floating-point format (also totally dominant among
|
||||||
machines). The only area of machines that may not support binary
|
mainstream machines). The only area of machines that may not support
|
||||||
compatibility are embedded systems (because they sometimes have peculiar
|
binary compatibility are embedded systems (because they sometimes have
|
||||||
processors).
|
peculiar processors).
|
||||||
|
|
||||||
|
There is no big speed penalty in storing data low byte first; The bytes
|
||||||
|
in a table row is normally unaligned and it doesn't take that much more
|
||||||
|
power to read an unaligned byte in order than in reverse order. The
|
||||||
|
actual fetch-column-value code is also not time critical compared to
|
||||||
|
other code.
|
||||||
@item
|
@item
|
||||||
All number keys are stored with high byte first to give better index
|
All number keys are stored with high byte first to give better index
|
||||||
compression.
|
compression.
|
||||||
@ -22094,7 +22101,7 @@ You need enough extra memory for all HEAP tables that you want to use at
|
|||||||
the same time.
|
the same time.
|
||||||
@item
|
@item
|
||||||
To free memory, you should execute @code{DELETE FROM heap_table},
|
To free memory, you should execute @code{DELETE FROM heap_table},
|
||||||
@code{TRUNCATE TABLE heap_table} or @code{DROP TABLE heap_table}.
|
@code{TRUNCATE heap_table} or @code{DROP TABLE heap_table}.
|
||||||
@item
|
@item
|
||||||
@strong{MySQL} cannot find out how approximately many rows there
|
@strong{MySQL} cannot find out how approximately many rows there
|
||||||
are between two values (this is used by the range optimizer to decide which
|
are between two values (this is used by the range optimizer to decide which
|
||||||
@ -26255,7 +26262,7 @@ This can be done with the following code:
|
|||||||
@example
|
@example
|
||||||
mysql> LOCK TABLES real_table WRITE, insert_table WRITE;
|
mysql> LOCK TABLES real_table WRITE, insert_table WRITE;
|
||||||
mysql> insert into real_table select * from insert_table;
|
mysql> insert into real_table select * from insert_table;
|
||||||
mysql> TRUNCATE TABLE insert_table;
|
mysql> TRUNCATE insert_table;
|
||||||
mysql> UNLOCK TABLES;
|
mysql> UNLOCK TABLES;
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@ -27110,7 +27117,7 @@ it is very important to @code{OPTIMIZE TABLE} sometimes.
|
|||||||
@subsection Speed of @code{DELETE} queries
|
@subsection Speed of @code{DELETE} queries
|
||||||
|
|
||||||
If you want to delete all rows in the table, you should use
|
If you want to delete all rows in the table, you should use
|
||||||
@code{TRUNCATE TABLE table_name}. @xref{TRUNCATE}.
|
@code{TRUNCATE table_name}. @xref{TRUNCATE}.
|
||||||
|
|
||||||
The time to delete a record is exactly proportional to the number of
|
The time to delete a record is exactly proportional to the number of
|
||||||
indexes. To delete records more quickly, you can increase the size of
|
indexes. To delete records more quickly, you can increase the size of
|
||||||
@ -29825,7 +29832,7 @@ Use the table description file to create new (empty) data and index files:
|
|||||||
@example
|
@example
|
||||||
shell> mysql db_name
|
shell> mysql db_name
|
||||||
mysql> SET AUTOCOMMIT=1;
|
mysql> SET AUTOCOMMIT=1;
|
||||||
mysql> TRUNCATE TABLE table_name;
|
mysql> TRUNCATE table_name;
|
||||||
mysql> quit
|
mysql> quit
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@ -38485,6 +38492,13 @@ though, so Version 3.23 is not released as a stable version yet.
|
|||||||
@appendixsubsec Changes in release 3.23.28
|
@appendixsubsec Changes in release 3.23.28
|
||||||
@itemize @bullet
|
@itemize @bullet
|
||||||
@item
|
@item
|
||||||
|
Fixed the @code{--skip-networking} works properly on NT.
|
||||||
|
@item
|
||||||
|
Fixed bug in @code{MyISAM} when running multiple updating processes on
|
||||||
|
the same table.
|
||||||
|
@item
|
||||||
|
Allow one to use @code{FLUSH TABLE tablename}.
|
||||||
|
@item
|
||||||
Changed all log files to use our own IO_CACHE mechanism instead of
|
Changed all log files to use our own IO_CACHE mechanism instead of
|
||||||
FILE:s to avoid OS problems when there is many files open.
|
FILE:s to avoid OS problems when there is many files open.
|
||||||
@item
|
@item
|
||||||
@ -38500,7 +38514,7 @@ Added status variables @code{large_file_support},@code{net_read_timeout},
|
|||||||
Fixed bug where we didn't allow an index name after the
|
Fixed bug where we didn't allow an index name after the
|
||||||
@code{FOREIGN KEY} definition.
|
@code{FOREIGN KEY} definition.
|
||||||
@item
|
@item
|
||||||
Added @code{TRUNCATE TABLE table_name} as a synonym for
|
Added @code{TRUNCATE table_name} as a synonym for
|
||||||
@code{DELETE FROM table_name}.
|
@code{DELETE FROM table_name}.
|
||||||
@item
|
@item
|
||||||
Fixed bug in a BDB key compare function when comparing part keys.
|
Fixed bug in a BDB key compare function when comparing part keys.
|
||||||
|
@ -511,6 +511,7 @@ extern uint my_b_fill(IO_CACHE *info);
|
|||||||
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
|
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
|
||||||
extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length);
|
extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length);
|
||||||
extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...);
|
extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...);
|
||||||
|
extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
|
||||||
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
|
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
|
||||||
const char *prefix, uint cache_size,
|
const char *prefix, uint cache_size,
|
||||||
myf cache_myflags);
|
myf cache_myflags);
|
||||||
|
@ -128,30 +128,38 @@ uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
|
|||||||
|
|
||||||
uint my_b_printf(IO_CACHE *info, const char* fmt, ...)
|
uint my_b_printf(IO_CACHE *info, const char* fmt, ...)
|
||||||
{
|
{
|
||||||
|
int result;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
va_start(args,fmt);
|
||||||
|
result=my_b_vprintf(info, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
|
||||||
|
{
|
||||||
reg1 char *to= info->rc_pos;
|
reg1 char *to= info->rc_pos;
|
||||||
char *end=info->rc_end;
|
char *end=info->rc_end;
|
||||||
uint out_length=0;
|
uint out_length=0;
|
||||||
|
|
||||||
va_start(args,fmt);
|
|
||||||
|
|
||||||
for (; *fmt ; fmt++)
|
for (; *fmt ; fmt++)
|
||||||
{
|
{
|
||||||
if (fmt[0] != '%')
|
if (*fmt++ != '%')
|
||||||
{
|
{
|
||||||
/* Copy everything until '%' or end of string */
|
/* Copy everything until '%' or end of string */
|
||||||
const char *start=fmt;
|
const char *start=fmt-1;
|
||||||
uint length;
|
uint length;
|
||||||
for (fmt++ ; *fmt && *fmt != '%' ; fmt++ ) ;
|
for (; *fmt && *fmt != '%' ; fmt++ ) ;
|
||||||
length= (uint) (fmt - start);
|
length= (uint) (fmt - start);
|
||||||
out_length+=length;
|
out_length+=length;
|
||||||
if (my_b_write(info, start, length))
|
if (my_b_write(info, start, length))
|
||||||
goto err;
|
goto err;
|
||||||
if (!*fmt) /* End of format */
|
if (!*fmt) /* End of format */
|
||||||
{
|
{
|
||||||
va_end(args);
|
|
||||||
return out_length;
|
return out_length;
|
||||||
}
|
}
|
||||||
|
fmt++;
|
||||||
/* Found one '%' */
|
/* Found one '%' */
|
||||||
}
|
}
|
||||||
/* Skipp if max size is used (to be compatible with printf) */
|
/* Skipp if max size is used (to be compatible with printf) */
|
||||||
@ -203,10 +211,8 @@ uint my_b_printf(IO_CACHE *info, const char* fmt, ...)
|
|||||||
out_length++;
|
out_length++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
va_end(args);
|
|
||||||
return out_length;
|
return out_length;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
return (uint) -1;
|
return (uint) -1;
|
||||||
va_end(args);
|
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Skipp if max size is used (to be compatible with printf) */
|
/* Skipp if max size is used (to be compatible with printf) */
|
||||||
|
fmt++;
|
||||||
while (isdigit(*fmt) || *fmt == '.' || *fmt == '-')
|
while (isdigit(*fmt) || *fmt == '.' || *fmt == '-')
|
||||||
fmt++;
|
fmt++;
|
||||||
if (*fmt == 's') /* String parameter */
|
if (*fmt == 's') /* String parameter */
|
||||||
|
@ -422,8 +422,8 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type)
|
|||||||
/* Request for READ lock */
|
/* Request for READ lock */
|
||||||
if (lock->write.data)
|
if (lock->write.data)
|
||||||
{
|
{
|
||||||
/* We can get allow a read lock even if there is already a write lock
|
/* We can allow a read lock even if there is already a write lock
|
||||||
one the table in one the following cases:
|
on the table in one the following cases:
|
||||||
- This thread alread have a write lock on the table
|
- This thread alread have a write lock on the table
|
||||||
- The write lock is TL_WRITE_ALLOW_READ or TL_WRITE_DELAYED
|
- The write lock is TL_WRITE_ALLOW_READ or TL_WRITE_DELAYED
|
||||||
and the read lock is TL_READ_HIGH_PRIORITY or TL_READ
|
and the read lock is TL_READ_HIGH_PRIORITY or TL_READ
|
||||||
|
@ -1210,7 +1210,7 @@ rl_parse_and_bind (string)
|
|||||||
if (fl && funname[fl - 1] == *funname)
|
if (fl && funname[fl - 1] == *funname)
|
||||||
funname[fl - 1] = '\0';
|
funname[fl - 1] = '\0';
|
||||||
|
|
||||||
rl_macro_bind (useq, &funname[1], _rl_keymap);
|
rl_macro_bind ((char*) useq, &funname[1], _rl_keymap);
|
||||||
}
|
}
|
||||||
#if defined (PREFIX_META_HACK)
|
#if defined (PREFIX_META_HACK)
|
||||||
/* Ugly, but working hack to keep prefix-meta around. */
|
/* Ugly, but working hack to keep prefix-meta around. */
|
||||||
|
@ -26,7 +26,8 @@ bin_SCRIPTS = @server_scripts@ \
|
|||||||
mysqlbug \
|
mysqlbug \
|
||||||
mysql_convert_table_format \
|
mysql_convert_table_format \
|
||||||
mysql_find_rows \
|
mysql_find_rows \
|
||||||
mysqlhotcopy
|
mysqlhotcopy \
|
||||||
|
mysqldumpslow
|
||||||
|
|
||||||
EXTRA_SCRIPTS = make_binary_distribution.sh \
|
EXTRA_SCRIPTS = make_binary_distribution.sh \
|
||||||
msql2mysql.sh \
|
msql2mysql.sh \
|
||||||
@ -40,6 +41,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
|
|||||||
mysql_convert_table_format.sh \
|
mysql_convert_table_format.sh \
|
||||||
mysql_find_rows.sh \
|
mysql_find_rows.sh \
|
||||||
mysqlhotcopy.sh \
|
mysqlhotcopy.sh \
|
||||||
|
mysqldumpslow.sh \
|
||||||
safe_mysqld.sh
|
safe_mysqld.sh
|
||||||
|
|
||||||
EXTRA_DIST = $(EXTRA_SCRIPTS) \
|
EXTRA_DIST = $(EXTRA_SCRIPTS) \
|
||||||
@ -60,7 +62,8 @@ CLEANFILES = @server_scripts@ \
|
|||||||
mysqlaccess \
|
mysqlaccess \
|
||||||
mysql_convert_table_format \
|
mysql_convert_table_format \
|
||||||
mysql_find_rows \
|
mysql_find_rows \
|
||||||
mysqlhotcopy
|
mysqlhotcopy \
|
||||||
|
mysqldumpslow
|
||||||
|
|
||||||
SUPERCLEANFILES = mysqlbug
|
SUPERCLEANFILES = mysqlbug
|
||||||
|
|
||||||
|
@ -289,9 +289,9 @@ report("rename table","rename_table",
|
|||||||
$dbh->do("drop table crash_q1");
|
$dbh->do("drop table crash_q1");
|
||||||
$dbh->do("drop table crash_q");
|
$dbh->do("drop table crash_q");
|
||||||
|
|
||||||
report("truncate table","truncate_table",
|
report("truncate","truncate_table",
|
||||||
"create table crash_q (a integer, b integer,c CHAR(10))",
|
"create table crash_q (a integer, b integer,c CHAR(10))",
|
||||||
"truncate table crash_q",
|
"truncate crash_q",
|
||||||
"drop table crash_q1");
|
"drop table crash_q1");
|
||||||
|
|
||||||
if ($dbh->do("create table crash_q (a integer, b integer,c CHAR(10))") &&
|
if ($dbh->do("create table crash_q (a integer, b integer,c CHAR(10))") &&
|
||||||
|
@ -582,7 +582,7 @@ void MYSQL_LOG::write(THD *thd,enum enum_server_command command,
|
|||||||
if (format)
|
if (format)
|
||||||
{
|
{
|
||||||
if (my_b_write(&log_file," ",1) ||
|
if (my_b_write(&log_file," ",1) ||
|
||||||
my_b_printf(&log_file,format,args) == (uint) -1)
|
my_b_vprintf(&log_file,format,args) == (uint) -1)
|
||||||
error=errno;
|
error=errno;
|
||||||
}
|
}
|
||||||
if (my_b_write(&log_file,"\n",1) ||
|
if (my_b_write(&log_file,"\n",1) ||
|
||||||
|
@ -246,11 +246,10 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len)
|
|||||||
case START_EVENT: return new Start_log_event(buf);
|
case START_EVENT: return new Start_log_event(buf);
|
||||||
case STOP_EVENT: return new Stop_log_event(buf);
|
case STOP_EVENT: return new Stop_log_event(buf);
|
||||||
case INTVAR_EVENT: return new Intvar_log_event(buf);
|
case INTVAR_EVENT: return new Intvar_log_event(buf);
|
||||||
default: return NULL;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return NULL; // default value
|
||||||
//impossible
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log_event::print_header(FILE* file)
|
void Log_event::print_header(FILE* file)
|
||||||
@ -351,6 +350,15 @@ Start_log_event::Start_log_event(const char* buf) :Log_event(buf)
|
|||||||
created = uint4korr(buf + 2 + sizeof(server_version));
|
created = uint4korr(buf + 2 + sizeof(server_version));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Start_log_event::write_data(IO_CACHE* file)
|
||||||
|
{
|
||||||
|
char buff[sizeof(server_version)+2+4];
|
||||||
|
int2store(buff,binlog_version);
|
||||||
|
memcpy(buff+2,server_version,sizeof(server_version));
|
||||||
|
int4store(buff+2+sizeof(server_version),created);
|
||||||
|
return (my_b_write(file, (byte*) buff, sizeof(buff)) ? -1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
Rotate_log_event::Rotate_log_event(const char* buf, int event_len):
|
Rotate_log_event::Rotate_log_event(const char* buf, int event_len):
|
||||||
Log_event(buf),new_log_ident(NULL),alloced(0)
|
Log_event(buf),new_log_ident(NULL),alloced(0)
|
||||||
{
|
{
|
||||||
|
@ -183,7 +183,7 @@ class Load_log_event: public Log_event
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
char* data_buf;
|
char* data_buf;
|
||||||
void Load_log_event::copy_log_event(const char *buf, ulong data_len);
|
void copy_log_event(const char *buf, ulong data_len);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int thread_id;
|
int thread_id;
|
||||||
@ -304,9 +304,9 @@ extern char server_version[50];
|
|||||||
class Start_log_event: public Log_event
|
class Start_log_event: public Log_event
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
uint32 created;
|
||||||
uint16 binlog_version;
|
uint16 binlog_version;
|
||||||
char server_version[50];
|
char server_version[50];
|
||||||
uint32 created;
|
|
||||||
|
|
||||||
Start_log_event() :Log_event(time(NULL)),binlog_version(BINLOG_VERSION)
|
Start_log_event() :Log_event(time(NULL)),binlog_version(BINLOG_VERSION)
|
||||||
{
|
{
|
||||||
@ -316,8 +316,7 @@ public:
|
|||||||
Start_log_event(IO_CACHE* file, time_t when_arg, uint32 server_id) :
|
Start_log_event(IO_CACHE* file, time_t when_arg, uint32 server_id) :
|
||||||
Log_event(when_arg, 0, 0, server_id)
|
Log_event(when_arg, 0, 0, server_id)
|
||||||
{
|
{
|
||||||
char buf[sizeof(server_version) + sizeof(binlog_version) +
|
char buf[sizeof(server_version) + 2 + 4 + 4];
|
||||||
sizeof(created)+4];
|
|
||||||
if (my_b_read(file, (byte*) buf, sizeof(buf)))
|
if (my_b_read(file, (byte*) buf, sizeof(buf)))
|
||||||
return;
|
return;
|
||||||
binlog_version = uint2korr(buf+4);
|
binlog_version = uint2korr(buf+4);
|
||||||
@ -328,18 +327,11 @@ public:
|
|||||||
|
|
||||||
~Start_log_event() {}
|
~Start_log_event() {}
|
||||||
Log_event_type get_type_code() { return START_EVENT;}
|
Log_event_type get_type_code() { return START_EVENT;}
|
||||||
int write_data(IO_CACHE* file)
|
int write_data(IO_CACHE* file);
|
||||||
{
|
|
||||||
if (my_b_write(file, (byte*) &binlog_version, sizeof(binlog_version)) ||
|
|
||||||
my_b_write(file, (byte*) server_version, sizeof(server_version)) ||
|
|
||||||
my_b_write(file, (byte*) &created, sizeof(created)))
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int get_data_size()
|
int get_data_size()
|
||||||
{
|
{
|
||||||
return sizeof(binlog_version) + sizeof(server_version) +
|
// sizeof(binlog_version) + sizeof(server_version) sizeof(created)
|
||||||
sizeof(created);
|
return 2 + sizeof(server_version) + 4;
|
||||||
}
|
}
|
||||||
void print(FILE* file, bool short_form = 0);
|
void print(FILE* file, bool short_form = 0);
|
||||||
};
|
};
|
||||||
|
@ -320,7 +320,7 @@ int _my_b_net_read(register IO_CACHE *info, byte *Buffer,
|
|||||||
read_length=my_net_read(net);
|
read_length=my_net_read(net);
|
||||||
if (read_length == (int) packet_error)
|
if (read_length == (int) packet_error)
|
||||||
{
|
{
|
||||||
info->error=(uint) -1;
|
info->error= -1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (read_length == 0)
|
if (read_length == 0)
|
||||||
|
@ -1653,7 +1653,7 @@ int main(int argc, char **argv)
|
|||||||
handler_count--;
|
handler_count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (have_tcpip)
|
if (have_tcpip && !opt_disable_networking)
|
||||||
{
|
{
|
||||||
handler_count++;
|
handler_count++;
|
||||||
if (pthread_create(&hThread,&connection_attrib,
|
if (pthread_create(&hThread,&connection_attrib,
|
||||||
|
@ -171,9 +171,6 @@ int db_ok(const char* db, I_List<i_string> &do_list,
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// impossible
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_strvar_from_file(char* var, int max_size, FILE* f,
|
static void init_strvar_from_file(char* var, int max_size, FILE* f,
|
||||||
|
@ -116,8 +116,8 @@ THD::THD()
|
|||||||
system_thread=0;
|
system_thread=0;
|
||||||
bzero((char*) &mem_root,sizeof(mem_root));
|
bzero((char*) &mem_root,sizeof(mem_root));
|
||||||
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB)
|
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB)
|
||||||
if (open_cached_file(&transactions.trans_log,
|
if (open_cached_file(&transaction.trans_log,
|
||||||
mysql_tempdir,LOG_PREFIX,0,MYF(MY_WME)))
|
mysql_tmpdir,LOG_PREFIX,0,MYF(MY_WME)))
|
||||||
killed=1;
|
killed=1;
|
||||||
transaction.bdb_lock_count=0;
|
transaction.bdb_lock_count=0;
|
||||||
#endif
|
#endif
|
||||||
@ -145,7 +145,7 @@ THD::~THD()
|
|||||||
}
|
}
|
||||||
close_temporary_tables(this);
|
close_temporary_tables(this);
|
||||||
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB)
|
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMENI_DB)
|
||||||
close_cached_file(transactions.trans_log);
|
close_cached_file(&transaction.trans_log);
|
||||||
#endif
|
#endif
|
||||||
if (global_read_lock)
|
if (global_read_lock)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ static inline bool end_active_trans(THD *thd)
|
|||||||
{
|
{
|
||||||
if (ha_commit(thd))
|
if (ha_commit(thd))
|
||||||
return 1;
|
return 1;
|
||||||
thd->options&= ~OPTION_BEGIN;
|
thd->options&= ~(ulong) (OPTION_BEGIN);
|
||||||
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -1562,7 +1562,7 @@ mysql_execute_command(void)
|
|||||||
if (!org_options & OPTION_AUTO_COMMIT)
|
if (!org_options & OPTION_AUTO_COMMIT)
|
||||||
{
|
{
|
||||||
/* We changed to auto_commit mode */
|
/* We changed to auto_commit mode */
|
||||||
thd->options&= ~OPTION_BEGIN;
|
thd->options&= ~(ulong) (OPTION_BEGIN);
|
||||||
thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
|
thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
|
||||||
if (ha_commit(thd))
|
if (ha_commit(thd))
|
||||||
{
|
{
|
||||||
@ -1747,7 +1747,7 @@ mysql_execute_command(void)
|
|||||||
even if there is a problem with the OPTION_AUTO_COMMIT flag
|
even if there is a problem with the OPTION_AUTO_COMMIT flag
|
||||||
(Which of course should never happen...)
|
(Which of course should never happen...)
|
||||||
*/
|
*/
|
||||||
thd->options&= ~OPTION_BEGIN;
|
thd->options&= ~(ulong) (OPTION_BEGIN);
|
||||||
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
||||||
if (!ha_commit(thd))
|
if (!ha_commit(thd))
|
||||||
send_ok(&thd->net);
|
send_ok(&thd->net);
|
||||||
@ -1755,7 +1755,7 @@ mysql_execute_command(void)
|
|||||||
res= -1;
|
res= -1;
|
||||||
break;
|
break;
|
||||||
case SQLCOM_ROLLBACK:
|
case SQLCOM_ROLLBACK:
|
||||||
thd->options&= ~OPTION_BEGIN;
|
thd->options&= ~(ulong) (OPTION_BEGIN);
|
||||||
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
||||||
if (!ha_rollback(thd))
|
if (!ha_rollback(thd))
|
||||||
send_ok(&thd->net);
|
send_ok(&thd->net);
|
||||||
|
@ -3718,7 +3718,8 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
|
|||||||
}
|
}
|
||||||
MI_CREATE_INFO create_info;
|
MI_CREATE_INFO create_info;
|
||||||
bzero((char*) &create_info,sizeof(create_info));
|
bzero((char*) &create_info,sizeof(create_info));
|
||||||
if (options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT) == OPTION_BIG_TABLES)
|
if ((options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) ==
|
||||||
|
OPTION_BIG_TABLES)
|
||||||
create_info.data_file_length= ~(ulonglong) 0;
|
create_info.data_file_length= ~(ulonglong) 0;
|
||||||
|
|
||||||
if ((error=mi_create(table->real_name,table->keys,&keydef,
|
if ((error=mi_create(table->real_name,table->keys,&keydef,
|
||||||
|
@ -1446,7 +1446,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||||||
mysql_bin_log.write(&qinfo);
|
mysql_bin_log.write(&qinfo);
|
||||||
}
|
}
|
||||||
goto end_temporary;
|
goto end_temporary;
|
||||||
DBUG_RETURN(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intern_close_table(new_table); /* close temporary table */
|
intern_close_table(new_table); /* close temporary table */
|
||||||
|
@ -138,7 +138,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
|||||||
%token BOTH
|
%token BOTH
|
||||||
%token BY
|
%token BY
|
||||||
%token CASCADE
|
%token CASCADE
|
||||||
%token CHANGED_FILES
|
|
||||||
%token CHECKSUM_SYM
|
%token CHECKSUM_SYM
|
||||||
%token CHECK_SYM
|
%token CHECK_SYM
|
||||||
%token COLUMNS
|
%token COLUMNS
|
||||||
@ -332,8 +331,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
|||||||
%token DATE_SUB_INTERVAL
|
%token DATE_SUB_INTERVAL
|
||||||
%token DAY_HOUR_SYM
|
%token DAY_HOUR_SYM
|
||||||
%token DAY_MINUTE_SYM
|
%token DAY_MINUTE_SYM
|
||||||
%token DAY_OF_WEEK
|
|
||||||
%token DAY_OF_YEAR
|
|
||||||
%token DAY_SECOND_SYM
|
%token DAY_SECOND_SYM
|
||||||
%token DAY_SYM
|
%token DAY_SYM
|
||||||
%token DECODE_SYM
|
%token DECODE_SYM
|
||||||
@ -372,7 +369,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
|||||||
%token RIGHT
|
%token RIGHT
|
||||||
%token ROUND
|
%token ROUND
|
||||||
%token SECOND_SYM
|
%token SECOND_SYM
|
||||||
%token SEC_TO_TIME
|
|
||||||
%token SUBSTRING
|
%token SUBSTRING
|
||||||
%token SUBSTRING_INDEX
|
%token SUBSTRING_INDEX
|
||||||
%token TRIM
|
%token TRIM
|
||||||
@ -385,8 +381,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
|||||||
%token UNIQUE_USERS
|
%token UNIQUE_USERS
|
||||||
%token UNIX_TIMESTAMP
|
%token UNIX_TIMESTAMP
|
||||||
%token USER
|
%token USER
|
||||||
%token VERSION_SYM
|
|
||||||
%token WEEKDAY
|
|
||||||
%token WEEK_SYM
|
%token WEEK_SYM
|
||||||
%token WHEN_SYM
|
%token WHEN_SYM
|
||||||
%token WORK_SYM
|
%token WORK_SYM
|
||||||
@ -1040,10 +1034,9 @@ alter:
|
|||||||
bzero((char*) &lex->create_info,sizeof(lex->create_info));
|
bzero((char*) &lex->create_info,sizeof(lex->create_info));
|
||||||
lex->create_info.db_type= DB_TYPE_DEFAULT;
|
lex->create_info.db_type= DB_TYPE_DEFAULT;
|
||||||
}
|
}
|
||||||
alter_list order_clause opt_create_table_options
|
alter_list
|
||||||
|
|
||||||
alter_list:
|
alter_list:
|
||||||
/* empty */
|
|
||||||
| alter_list_item
|
| alter_list_item
|
||||||
| alter_list ',' alter_list_item
|
| alter_list ',' alter_list_item
|
||||||
|
|
||||||
@ -1082,7 +1075,8 @@ alter_list_item:
|
|||||||
{ Lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0)); }
|
{ Lex->alter_list.push_back(new Alter_column($3.str,(Item*) 0)); }
|
||||||
| RENAME opt_to table_alias table_ident
|
| RENAME opt_to table_alias table_ident
|
||||||
{ Lex->db=$4->db.str ; Lex->name= $4->table.str; }
|
{ Lex->db=$4->db.str ; Lex->name= $4->table.str; }
|
||||||
| opt_create_table_options
|
| create_table_options
|
||||||
|
| order_clause
|
||||||
|
|
||||||
opt_column:
|
opt_column:
|
||||||
/* empty */ {}
|
/* empty */ {}
|
||||||
@ -1227,7 +1221,7 @@ select_into:
|
|||||||
| select_from opt_into
|
| select_from opt_into
|
||||||
|
|
||||||
select_from:
|
select_from:
|
||||||
FROM join_table_list where_clause group_clause having_clause order_clause limit_clause procedure_clause
|
FROM join_table_list where_clause group_clause having_clause opt_order_clause limit_clause procedure_clause
|
||||||
|
|
||||||
|
|
||||||
select_options:
|
select_options:
|
||||||
@ -1850,9 +1844,12 @@ group_list:
|
|||||||
** Order by statement in select
|
** Order by statement in select
|
||||||
*/
|
*/
|
||||||
|
|
||||||
order_clause:
|
opt_order_clause:
|
||||||
/* empty */
|
/* empty */
|
||||||
| ORDER_SYM BY { Lex->sort_default=1; } order_list
|
| order_clause
|
||||||
|
|
||||||
|
order_clause:
|
||||||
|
ORDER_SYM BY { Lex->sort_default=1; } order_list
|
||||||
|
|
||||||
order_list:
|
order_list:
|
||||||
order_list ',' order_ident order_dir
|
order_list ',' order_ident order_dir
|
||||||
@ -2136,7 +2133,7 @@ opt_delete_option:
|
|||||||
| LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
|
| LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
|
||||||
|
|
||||||
truncate:
|
truncate:
|
||||||
TRUNCATE_SYM TABLE_SYM table
|
TRUNCATE_SYM table
|
||||||
{ Lex->sql_command= SQLCOM_TRUNCATE; Lex->options=0;
|
{ Lex->sql_command= SQLCOM_TRUNCATE; Lex->options=0;
|
||||||
Lex->lock_option= current_thd->update_lock_default; }
|
Lex->lock_option= current_thd->update_lock_default; }
|
||||||
|
|
||||||
@ -2241,7 +2238,7 @@ flush_options:
|
|||||||
| flush_option
|
| flush_option
|
||||||
|
|
||||||
flush_option:
|
flush_option:
|
||||||
TABLES { Lex->type|= REFRESH_TABLES; } opt_table_list
|
table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list
|
||||||
| TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
|
| TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
|
||||||
| HOSTS_SYM { Lex->type|= REFRESH_HOSTS; }
|
| HOSTS_SYM { Lex->type|= REFRESH_HOSTS; }
|
||||||
| PRIVILEGES { Lex->type|= REFRESH_GRANT; }
|
| PRIVILEGES { Lex->type|= REFRESH_GRANT; }
|
||||||
|
@ -280,11 +280,11 @@ static uint pack_keys(uchar *keybuff,uint key_count,KEY *keyinfo)
|
|||||||
}
|
}
|
||||||
/* Save keynames */
|
/* Save keynames */
|
||||||
keyname_pos=pos;
|
keyname_pos=pos;
|
||||||
*pos++=NAMES_SEP_CHAR;
|
*pos++=(uchar) NAMES_SEP_CHAR;
|
||||||
for (key=keyinfo ; key != end ; key++)
|
for (key=keyinfo ; key != end ; key++)
|
||||||
{
|
{
|
||||||
uchar *tmp=(uchar*) strmov((char*) pos,key->name);
|
uchar *tmp=(uchar*) strmov((char*) pos,key->name);
|
||||||
*tmp++=NAMES_SEP_CHAR;
|
*tmp++= (uchar) NAMES_SEP_CHAR;
|
||||||
*tmp=0;
|
*tmp=0;
|
||||||
pos=tmp;
|
pos=tmp;
|
||||||
}
|
}
|
||||||
@ -458,7 +458,7 @@ static bool pack_fields(File file,List<create_field> &create_fields)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write fieldnames */
|
/* Write fieldnames */
|
||||||
buff[0]=NAMES_SEP_CHAR;
|
buff[0]=(uchar) NAMES_SEP_CHAR;
|
||||||
if (my_write(file,(byte*) buff,1,MYF_RW))
|
if (my_write(file,(byte*) buff,1,MYF_RW))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
i=0;
|
i=0;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#define LANGUAGE "english/"
|
#define LANGUAGE "english/"
|
||||||
#define ERRMSG_FILE "errmsg.sys"
|
#define ERRMSG_FILE "errmsg.sys"
|
||||||
#define TEMP_PREFIX "MY"
|
#define TEMP_PREFIX "MY"
|
||||||
|
#define LOG_PREFIX "ML"
|
||||||
#define PROGDIR "bin/"
|
#define PROGDIR "bin/"
|
||||||
#ifndef DATADIR
|
#ifndef DATADIR
|
||||||
#define DATADIR "data/"
|
#define DATADIR "data/"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user