1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Portability fixes for 4.0.3 build.

Don't update MyISAM index file on UPDATE if index is not changed
This commit is contained in:
monty@hundin.mysql.fi
2002-08-17 18:02:56 +03:00
parent ca2e3aacff
commit f7c8bd0e47
8 changed files with 56 additions and 24 deletions

View File

@ -491,3 +491,5 @@ sql-bench/innotest1b
sql-bench/innotest2 sql-bench/innotest2
sql-bench/innotest2a sql-bench/innotest2a
sql-bench/innotest2b sql-bench/innotest2b
myisam/test2.MYD
myisam/test2.MYI

View File

@ -75,6 +75,19 @@ $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl";
$slave_port=$mysql_tcp_port+16; $slave_port=$mysql_tcp_port+16;
$manager_port=$mysql_tcp_port+1; $manager_port=$mysql_tcp_port+1;
if ($opt_stage == 0)
{
system("mkdir Logs") if (! -d "Logs");
system("mv $log ${log}-old") if (-f $log);
unlink($log);
}
open(LOG,">>$log") || abort("Can't open log file, error $?");
select LOG;
$|=1;
select STDOUT;
$|=1;
if (-x "$host/bin/mysqladmin") if (-x "$host/bin/mysqladmin")
{ {
log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown"); log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown");
@ -97,17 +110,8 @@ if ($opt_stage == 0)
} }
rm_all("$host/test"); rm_all("$host/test");
system("mkdir $host/test") if (! -d "$host/test"); system("mkdir $host/test") if (! -d "$host/test");
system("mkdir Logs") if (! -d "Logs");
system("mv $log ${log}-old") if (-f $log);
unlink($log);
} }
open(LOG,">>$log") || abort("Can't open log file, error $?");
select LOG;
$|=1;
select STDOUT;
$|=1;
safe_cd($host); safe_cd($host);
if ($opt_stage == 0 && ! $opt_use_old_distribution) if ($opt_stage == 0 && ! $opt_use_old_distribution)
{ {
@ -553,13 +557,17 @@ sub rm_all
sub kill_all sub kill_all
{ {
my ($pattern) = @_; my ($pattern) = @_;
my ($USER,$BSD,$LINUX,$pscmd, $user, $pid); my ($USER,$BSD,$LINUX, $pscmd, $user, $pid);
$user=$ENV{'USER'}; $user=$ENV{'USER'};
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; $BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin';
$LINUX = $^O eq 'linux'; $LINUX = $^O eq 'linux';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; $pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
open(PS, "$pscmd|") || die "can't run $pscmd: $!"; if (!open(PS, "$pscmd|"))
{
print "Warning: Can't run $pscmd: $!\n";
exit;
}
# Catch any errors with eval. A bad pattern, for instance. # Catch any errors with eval. A bad pattern, for instance.
process: process:

View File

@ -8828,7 +8828,7 @@ To get a core dump on Linux if @code{mysqld} dies with a @code{SIGSEGV} signal,
you can start @code{mysqld} with the @code{--core-file} option. Note you can start @code{mysqld} with the @code{--core-file} option. Note
that you also probably need to raise the @code{core file size} by adding that you also probably need to raise the @code{core file size} by adding
@code{ulimit -c 1000000} to @code{safe_mysqld} or starting @code{ulimit -c 1000000} to @code{safe_mysqld} or starting
@code{safe_mysqld} with @code{--core-file-sizes=1000000}. @code{safe_mysqld} with @code{--core-file-size=1000000}.
@xref{safe_mysqld, , @code{safe_mysqld}}. @xref{safe_mysqld, , @code{safe_mysqld}}.
If you are linking your own MySQL client and get the error: If you are linking your own MySQL client and get the error:
@ -50261,6 +50261,8 @@ each individual 4.0.x release.
@itemize @bullet @itemize @bullet
@item @item
Don't update MyISAM index file on update if not strictly necessary.
@item
Fixed bug in @code{SELECT DISTINCT ... FROM many_tables ORDER BY Fixed bug in @code{SELECT DISTINCT ... FROM many_tables ORDER BY
not-used-column}. not-used-column}.
@item @item

View File

@ -34,7 +34,7 @@
C_MODE_START C_MODE_START
#ifdef HAVE_SEMAPHORE_H #ifdef HAVE_SEMAPHORE_H
#include <semaphore.h> #include <semaphore.h>
#elif defined(__bsdi__) #elif !defined(__bsdi__)
#ifdef __WIN__ #ifdef __WIN__
typedef HANDLE sem_t; typedef HANDLE sem_t;
#else #else

View File

@ -97,6 +97,8 @@ case "$target_os" in
sysv5uw7*) sysv5uw7*)
# Problem when linking on SCO # Problem when linking on SCO
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
*-openbsd*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
esac esac
case "$target" in case "$target" in

View File

@ -83,8 +83,6 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
/* Check which keys changed from the original row */ /* Check which keys changed from the original row */
new_key=info->lastkey2; new_key=info->lastkey2;
key_changed=HA_STATE_KEY_CHANGED; /* We changed current database */
/* Remove key that didn't change */
changed=0; changed=0;
for (i=0 ; i < share->base.keys ; i++) for (i=0 ; i < share->base.keys ; i++)
{ {
@ -93,7 +91,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
/* The following code block is for text searching by SerG */ /* The following code block is for text searching by SerG */
if (share->keyinfo[i].flag & HA_FULLTEXT ) if (share->keyinfo[i].flag & HA_FULLTEXT )
{ {
if(_mi_ft_cmp(info,i,oldrec, newrec)) if (_mi_ft_cmp(info,i,oldrec, newrec))
{ {
if ((int) i == info->lastinx) if ((int) i == info->lastinx)
key_changed|=HA_STATE_WRITTEN; key_changed|=HA_STATE_WRITTEN;
@ -121,11 +119,24 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
} }
} }
} }
if (changed)
key_changed|= HA_STATE_KEY_CHANGED;
if (share->calc_checksum) if (share->calc_checksum)
{
info->checksum=(*share->calc_checksum)(info,newrec); info->checksum=(*share->calc_checksum)(info,newrec);
if ((*share->update_record)(info,pos,newrec)) key_changed|= HA_STATE_KEY_CHANGED; /* Must update index file */
goto err; }
{
/* Don't update index file if data file is not extended */
MI_STATUS_INFO state;
memcpy((char*) &state, (char*) info->state, sizeof(state));
if ((*share->update_record)(info,pos,newrec))
goto err;
if (!key_changed &&
memcmp((char*) &state, (char*) info->state, sizeof(state)))
key_changed|= HA_STATE_KEY_CHANGED; /* Must update index file */
}
if (auto_key_changed) if (auto_key_changed)
update_auto_increment(info,newrec); update_auto_increment(info,newrec);
if (share->calc_checksum) if (share->calc_checksum)
@ -147,6 +158,8 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
err: err:
DBUG_PRINT("error",("key: %d errno: %d",i,my_errno)); DBUG_PRINT("error",("key: %d errno: %d",i,my_errno));
save_errno=my_errno; save_errno=my_errno;
if (changed)
key_changed|= HA_STATE_KEY_CHANGED;
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL) if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
{ {
info->errkey= (int) i; info->errkey= (int) i;

View File

@ -387,14 +387,13 @@ int pthread_signal(int sig, void (*func)())
#undef pthread_mutex_destroy #undef pthread_mutex_destroy
#undef pthread_mutex_wait #undef pthread_mutex_wait
#undef pthread_mutex_timedwait #undef pthread_mutex_timedwait
#undef pthread_mutex_t
#undef pthread_cond_wait
#undef pthread_cond_timedwait
#undef pthread_mutex_trylock #undef pthread_mutex_trylock
#undef pthread_mutex_t #undef pthread_mutex_t
#undef pthread_cond_init
#undef pthread_cond_wait
#undef pthread_cond_timedwait
#undef pthread_cond_t #undef pthread_cond_t
/***************************************************************************** /*****************************************************************************
** Patches for AIX and DEC OSF/1 3.2 ** Patches for AIX and DEC OSF/1 3.2
*****************************************************************************/ *****************************************************************************/

View File

@ -37,10 +37,16 @@ longlong Item_func_not::val_int()
return !null_value && value == 0 ? 1 : 0; return !null_value && value == 0 ? 1 : 0;
} }
/*
Convert a constant expression or string to an integer.
This is done when comparing DATE's of different formats and
also when comparing bigint to strings (in which case the string
is converted once to a bigint).
*/
static bool convert_constant_item(Field *field, Item **item) static bool convert_constant_item(Field *field, Item **item)
{ {
if ((*item)->const_item()) if ((*item)->const_item() && (*item)->type() != Item::INT_ITEM)
{ {
if (!(*item)->save_in_field(field) && if (!(*item)->save_in_field(field) &&
!((*item)->null_value)) !((*item)->null_value))