Commit de87e317 authored by svoj@april.(none)'s avatar svoj@april.(none)

Merge mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines

into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.1-engines
parents 9d106f7a bcbb50c1
...@@ -121,6 +121,7 @@ typedef struct st_thr_lock { ...@@ -121,6 +121,7 @@ typedef struct st_thr_lock {
void (*get_status)(void*, int); /* When one gets a lock */ void (*get_status)(void*, int); /* When one gets a lock */
void (*copy_status)(void*,void*); void (*copy_status)(void*,void*);
void (*update_status)(void*); /* Before release of write */ void (*update_status)(void*); /* Before release of write */
void (*restore_status)(void*); /* Before release of read */
my_bool (*check_status)(void *); my_bool (*check_status)(void *);
} THR_LOCK; } THR_LOCK;
......
...@@ -757,8 +757,16 @@ void thr_unlock(THR_LOCK_DATA *data) ...@@ -757,8 +757,16 @@ void thr_unlock(THR_LOCK_DATA *data)
} }
else else
lock->write.last=data->prev; lock->write.last=data->prev;
if (lock_type >= TL_WRITE_CONCURRENT_INSERT && lock->update_status) if (lock_type >= TL_WRITE_CONCURRENT_INSERT)
(*lock->update_status)(data->status_param); {
if (lock->update_status)
(*lock->update_status)(data->status_param);
}
else
{
if (lock->restore_status)
(*lock->restore_status)(data->status_param);
}
if (lock_type == TL_READ_NO_INSERT) if (lock_type == TL_READ_NO_INSERT)
lock->read_no_write_count--; lock->read_no_write_count--;
data->type=TL_UNLOCK; /* Mark unlocked */ data->type=TL_UNLOCK; /* Mark unlocked */
......
...@@ -254,7 +254,7 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) ...@@ -254,7 +254,7 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
#endif #endif
if (!(rec_buff=(byte*) my_alloca(reclength))) if (!(rec_buff=(byte*) my_alloca(reclength)))
{ {
my_errno=ENOMEM; my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
return(-1); return(-1);
} }
reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
...@@ -288,7 +288,7 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record) ...@@ -288,7 +288,7 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
#endif #endif
if (!(rec_buff=(byte*) my_alloca(reclength))) if (!(rec_buff=(byte*) my_alloca(reclength)))
{ {
my_errno=ENOMEM; my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
return(-1); return(-1);
} }
reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
......
...@@ -338,6 +338,15 @@ void mi_update_status(void* param) ...@@ -338,6 +338,15 @@ void mi_update_status(void* param)
} }
} }
void mi_restore_status(void *param)
{
MI_INFO *info= (MI_INFO*) param;
info->state= &info->s->state.state;
info->append_insert_at_end= 0;
}
void mi_copy_status(void* to,void *from) void mi_copy_status(void* to,void *from)
{ {
((MI_INFO*) to)->state= &((MI_INFO*) from)->save_state; ((MI_INFO*) to)->state= &((MI_INFO*) from)->save_state;
......
...@@ -518,6 +518,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -518,6 +518,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->lock.get_status=mi_get_status; share->lock.get_status=mi_get_status;
share->lock.copy_status=mi_copy_status; share->lock.copy_status=mi_copy_status;
share->lock.update_status=mi_update_status; share->lock.update_status=mi_update_status;
share->lock.restore_status= mi_restore_status;
share->lock.check_status=mi_check_status; share->lock.check_status=mi_check_status;
} }
} }
......
...@@ -196,7 +196,8 @@ err: ...@@ -196,7 +196,8 @@ err:
save_errno=my_errno; save_errno=my_errno;
if (changed) if (changed)
key_changed|= HA_STATE_CHANGED; key_changed|= HA_STATE_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_OUT_OF_MEM ||
my_errno == HA_ERR_RECORD_FILE_FULL)
{ {
info->errkey= (int) i; info->errkey= (int) i;
flag=0; flag=0;
......
...@@ -180,7 +180,7 @@ int mi_write(MI_INFO *info, byte *record) ...@@ -180,7 +180,7 @@ int mi_write(MI_INFO *info, byte *record)
err: err:
save_errno=my_errno; save_errno=my_errno;
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 ||
my_errno == HA_ERR_NULL_IN_SPATIAL) my_errno == HA_ERR_NULL_IN_SPATIAL || my_errno == HA_ERR_OUT_OF_MEM)
{ {
if (info->bulk_insert) if (info->bulk_insert)
{ {
......
...@@ -753,6 +753,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b, ...@@ -753,6 +753,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
my_bool null_are_equal); my_bool null_are_equal);
void mi_get_status(void* param, int concurrent_insert); void mi_get_status(void* param, int concurrent_insert);
void mi_update_status(void* param); void mi_update_status(void* param);
void mi_restore_status(void* param);
void mi_copy_status(void* to,void *from); void mi_copy_status(void* to,void *from);
my_bool mi_check_status(void* param); my_bool mi_check_status(void* param);
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
......
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