mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed new bug in BDB tables
This commit is contained in:
@ -57,7 +57,6 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
|
|||||||
x->index_file_length=info->state->key_file_length;
|
x->index_file_length=info->state->key_file_length;
|
||||||
|
|
||||||
x->keys = share->state.header.keys;
|
x->keys = share->state.header.keys;
|
||||||
x->key_map = share->state.key_map;
|
|
||||||
x->check_time = share->state.check_time;
|
x->check_time = share->state.check_time;
|
||||||
x->mean_reclength = info->state->records ?
|
x->mean_reclength = info->state->records ?
|
||||||
(ulong) (info->state->data_file_length-info->state->empty)/
|
(ulong) (info->state->data_file_length-info->state->empty)/
|
||||||
@ -87,6 +86,7 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
|
|||||||
x->raid_type= share->base.raid_type;
|
x->raid_type= share->base.raid_type;
|
||||||
x->raid_chunks= share->base.raid_chunks;
|
x->raid_chunks= share->base.raid_chunks;
|
||||||
x->raid_chunksize= share->base.raid_chunksize;
|
x->raid_chunksize= share->base.raid_chunksize;
|
||||||
|
x->key_map = share->state.key_map;
|
||||||
}
|
}
|
||||||
if ((flag & HA_STATUS_TIME) && !my_fstat(info->dfile,&state,MYF(0)))
|
if ((flag & HA_STATUS_TIME) && !my_fstat(info->dfile,&state,MYF(0)))
|
||||||
x->update_time=state.st_mtime;
|
x->update_time=state.st_mtime;
|
||||||
|
@ -149,8 +149,10 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
USER=""
|
||||||
if test -w /
|
if test -w /
|
||||||
then
|
then
|
||||||
|
USER_OPTION="--user=$user"
|
||||||
# If we are root, change the err log to the right user.
|
# If we are root, change the err log to the right user.
|
||||||
touch $err_log; chown $user $err_log
|
touch $err_log; chown $user $err_log
|
||||||
if test -n "$open_files"
|
if test -n "$open_files"
|
||||||
@ -211,9 +213,9 @@ do
|
|||||||
rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
|
rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
|
||||||
if test -z "$args"
|
if test -z "$args"
|
||||||
then
|
then
|
||||||
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1
|
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1
|
||||||
else
|
else
|
||||||
eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1"
|
eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1"
|
||||||
fi
|
fi
|
||||||
if test ! -f $pid_file # This is removed if normal shutdown
|
if test ! -f $pid_file # This is removed if normal shutdown
|
||||||
then
|
then
|
||||||
|
@ -796,7 +796,8 @@ int ha_berkeley::write_row(byte * record)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
DB_TXN *sub_trans = transaction;
|
DB_TXN *sub_trans = transaction;
|
||||||
ulong thd_options = table->in_use->options;
|
/* Don't use sub transactions in temporary tables (in_use == 0) */
|
||||||
|
ulong thd_options = table->in_use ? table->in_use->options : 0;
|
||||||
for (uint retry=0 ; retry < berkeley_trans_retry ; retry++)
|
for (uint retry=0 ; retry < berkeley_trans_retry ; retry++)
|
||||||
{
|
{
|
||||||
key_map changed_keys = 0;
|
key_map changed_keys = 0;
|
||||||
@ -1014,7 +1015,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
|
|||||||
DBT prim_key, key, old_prim_key;
|
DBT prim_key, key, old_prim_key;
|
||||||
int error;
|
int error;
|
||||||
DB_TXN *sub_trans;
|
DB_TXN *sub_trans;
|
||||||
ulong thd_options = table->in_use->options;
|
ulong thd_options = table->in_use ? table->in_use->options : 0;
|
||||||
bool primary_key_changed;
|
bool primary_key_changed;
|
||||||
DBUG_ENTER("update_row");
|
DBUG_ENTER("update_row");
|
||||||
|
|
||||||
@ -1112,23 +1113,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef BROKEN_CODE_HERE
|
|
||||||
int new_error;
|
|
||||||
DBUG_PRINT("error",("Got error %d",error));
|
|
||||||
if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS))
|
|
||||||
{
|
|
||||||
DBUG_PRINT("trans",("aborting subtransaction"));
|
|
||||||
new_error=txn_abort(sub_trans);
|
|
||||||
}
|
|
||||||
else if (changed_keys)
|
|
||||||
new_error=restore_keys(changed_keys, primary_key,
|
|
||||||
old_row, old_prim_key, new_row, prim_key);
|
|
||||||
if (new_error)
|
|
||||||
{
|
|
||||||
error=new_error; // This shouldn't happen
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS))
|
else if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS))
|
||||||
{
|
{
|
||||||
@ -1227,7 +1211,7 @@ int ha_berkeley::delete_row(const byte * record)
|
|||||||
int error;
|
int error;
|
||||||
DBT row, prim_key;
|
DBT row, prim_key;
|
||||||
key_map keys=table->keys_in_use;
|
key_map keys=table->keys_in_use;
|
||||||
ulong thd_options = table->in_use->options;
|
ulong thd_options = table->in_use ? table->in_use->options : 0;
|
||||||
DBUG_ENTER("delete_row");
|
DBUG_ENTER("delete_row");
|
||||||
statistic_increment(ha_delete_count,&LOCK_status);
|
statistic_increment(ha_delete_count,&LOCK_status);
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void kill_one_thread(THD *thd, ulong id);
|
|||||||
#define OPTION_INTERNAL_SUBTRANSACTIONS OPTION_QUOTE_SHOW_CREATE*2
|
#define OPTION_INTERNAL_SUBTRANSACTIONS OPTION_QUOTE_SHOW_CREATE*2
|
||||||
|
|
||||||
/* Set if we are updating a non-transaction safe table */
|
/* Set if we are updating a non-transaction safe table */
|
||||||
#define OPTION_STATUS_NO_TRANS_UPDATE OPTION_QUOTE_SHOW_CREATE*2
|
#define OPTION_STATUS_NO_TRANS_UPDATE OPTION_INTERNAL_SUBTRANSACTIONS*2
|
||||||
|
|
||||||
/* The following is set when parsing the query */
|
/* The following is set when parsing the query */
|
||||||
#define QUERY_NO_INDEX_USED OPTION_STATUS_NO_TRANS_UPDATE*2
|
#define QUERY_NO_INDEX_USED OPTION_STATUS_NO_TRANS_UPDATE*2
|
||||||
|
@ -1120,8 +1120,8 @@ terribly wrong\n");
|
|||||||
*(ebp+17) : *(ebp+1));
|
*(ebp+17) : *(ebp+1));
|
||||||
if (new_ebp <= ebp )
|
if (new_ebp <= ebp )
|
||||||
{
|
{
|
||||||
fprintf(stderr, "New value of ebp failed sanity check\
|
fprintf(stderr, "\
|
||||||
terminating backtrace\n");
|
New value of ebp failed sanity check terminating backtrace\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ebp = new_ebp;
|
ebp = new_ebp;
|
||||||
|
Reference in New Issue
Block a user