~vkolesnikov/pbxt/pbxt-preload-test-bug

« back to all changes in this revision

Viewing changes to src/table_xt.cc

  • Committer: Paul McCullagh
  • Date: 2010-02-02 10:06:03 UTC
  • Revision ID: paul.mccullagh@primebase.org-20100202100603-3l4xe7gc5yvo9tds
Fixed bug #513012: On a table with a trigger the same record is updated more than once in one statement

Show diffs side-by-side

added added

removed removed

Lines of Context:
2873
2873
                                /* This is a record written by this transaction. */
2874
2874
                                if (thread->st_is_update) {
2875
2875
                                        /* Check that it was not written by the current update statement: */
2876
 
                                        if (XT_STAT_ID_MASK(thread->st_update_id) == rec_head->tr_stat_id_1) {
 
2876
                                        if (XT_STAT_ID_MASK(ot->ot_update_id) == rec_head->tr_stat_id_1) {
2877
2877
#ifdef TRACE_VARIATIONS
2878
2878
                                                if (len <= 450)
2879
2879
                                                        len += sprintf(t_buf+len, "MY UPDATE IN THIS STATEMENT T%d\n", (int) xn_id);
3154
3154
                }
3155
3155
                if (lw.lw_curr_lock != XT_NO_LOCK) {
3156
3156
#ifdef TRACE_VARIATIONS
3157
 
                        xt_ttracef(thread, "T%d WAIT FOR LOCK(%D) T%d\n", (int) thread->st_xact_data->xd_start_xn_id, (int) lock_type, (int) xn_id);
 
3157
                        xt_ttracef(thread, "T%d WAIT FOR LOCK(%s) T%d\n", (int) thread->st_xact_data->xd_start_xn_id, (int) lw.lw_curr_lock == XT_TEMP_LOCK ? "temp" : "perm", (int) xn_id);
3158
3158
#endif
3159
3159
                        if (!xt_xn_wait_for_xact(thread, NULL, &lw)) {
3160
3160
#ifdef DEBUG_LOCK_QUEUE
4384
4384
        if (!(row_id = tab_new_row(ot, tab)))
4385
4385
                goto failed_0;
4386
4386
 
4387
 
        rec_info.ri_fix_rec_buf->tr_stat_id_1 = self->st_update_id;
 
4387
        rec_info.ri_fix_rec_buf->tr_stat_id_1 = ot->ot_update_id;
4388
4388
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_row_id_4, row_id);
4389
4389
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_prev_rec_id_4, 0);
4390
4390
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_xact_id_4, self->st_xact_data->xd_start_xn_id);
4549
4549
                XT_SET_LOG_REF(rec_info.ri_ext_rec, log_id, log_offset);
4550
4550
        }
4551
4551
 
4552
 
        rec_info.ri_fix_rec_buf->tr_stat_id_1 = self->st_update_id;
 
4552
        rec_info.ri_fix_rec_buf->tr_stat_id_1 = ot->ot_update_id;
4553
4553
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_row_id_4, row_id);
4554
4554
        XT_COPY_DISK_4(rec_info.ri_fix_rec_buf->tr_prev_rec_id_4, prev_rec_head.tr_prev_rec_id_4);
4555
4555
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_xact_id_4, self->st_xact_data->xd_start_xn_id);
4693
4693
        if (!myxt_store_row(ot, &rec_info, (char *) after_buf))
4694
4694
                goto failed_0;
4695
4695
 
4696
 
        rec_info.ri_fix_rec_buf->tr_stat_id_1 = self->st_update_id;
 
4696
        rec_info.ri_fix_rec_buf->tr_stat_id_1 = ot->ot_update_id;
4697
4697
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_row_id_4, row_id);
4698
4698
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_prev_rec_id_4, ot->ot_curr_rec_id);
4699
4699
        XT_SET_DISK_4(rec_info.ri_fix_rec_buf->tr_xact_id_4, self->st_xact_data->xd_start_xn_id);