some modifications for batch_test
This commit is contained in:
parent
2eb59d9135
commit
069708205c
@ -182,13 +182,13 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
/* IF transaction_duplicate
|
IF transaction_duplicate
|
||||||
OR transaction_duplicate2
|
OR transaction_duplicate2
|
||||||
THEN
|
THEN
|
||||||
CLOSE curs_transaction_exist;
|
CLOSE curs_transaction_exist;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;*/
|
END IF;
|
||||||
CLOSE curs_transaction_exist;
|
CLOSE curs_transaction_exist;
|
||||||
RETURN;
|
RETURN;
|
||||||
END $$;
|
END $$;
|
||||||
|
@ -249,16 +249,17 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
k=k+1;
|
k=k+1;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
/* IF transaction_duplicate
|
|
||||||
|
IF transaction_duplicate
|
||||||
OR transaction_duplicate2
|
OR transaction_duplicate2
|
||||||
OR transaction_duplicate3
|
OR transaction_duplicate3
|
||||||
OR transaction_duplicate4
|
OR transaction_duplicate4
|
||||||
THEN
|
THEN
|
||||||
RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
|
RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
|
||||||
|
ROLLBACK;
|
||||||
CLOSE curs_transaction_exist;
|
CLOSE curs_transaction_exist;
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;*/
|
END IF;
|
||||||
CLOSE curs_transaction_exist;
|
CLOSE curs_transaction_exist;
|
||||||
RETURN;
|
RETURN;
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
k=k+1;
|
k=k+1;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
/* IF transaction_duplicate
|
IF transaction_duplicate
|
||||||
OR transaction_duplicate2
|
OR transaction_duplicate2
|
||||||
OR transaction_duplicate3
|
OR transaction_duplicate3
|
||||||
OR transaction_duplicate4
|
OR transaction_duplicate4
|
||||||
@ -433,7 +433,7 @@ BEGIN
|
|||||||
CLOSE curs_transaction_existed;
|
CLOSE curs_transaction_existed;
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;*/
|
END IF;
|
||||||
CLOSE curs_transaction_existed;
|
CLOSE curs_transaction_existed;
|
||||||
RETURN;
|
RETURN;
|
||||||
END $$;
|
END $$;
|
||||||
|
@ -94,9 +94,9 @@ transaction_duplicate= TRUE;
|
|||||||
RETURN;
|
RETURN;
|
||||||
ELSE
|
ELSE
|
||||||
-- Unhappy...
|
-- Unhappy...
|
||||||
-- RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
|
RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
|
||||||
transaction_duplicate = TRUE;
|
transaction_duplicate = TRUE;
|
||||||
-- ROLLBACK;
|
ROLLBACK;
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
RETURN;
|
RETURN;
|
||||||
|
@ -764,6 +764,8 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
|
|||||||
t_duplicate |= transaction_duplicate[i+1];
|
t_duplicate |= transaction_duplicate[i+1];
|
||||||
t_duplicate |= transaction_duplicate[i+2];
|
t_duplicate |= transaction_duplicate[i+2];
|
||||||
t_duplicate |= transaction_duplicate[i+3];
|
t_duplicate |= transaction_duplicate[i+3];
|
||||||
|
// fprintf(stdout, "%ld %ld c:%d t:%d %d %d %d\n", reserve_uuid[i], reserve_uuid[i+1], conflicts[i], t_duplicate, t_duplicate, transaction_duplicate[i+2], transaction_duplicate[i+3]);
|
||||||
|
|
||||||
i += 4;
|
i += 4;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
@ -791,7 +793,6 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
|
|||||||
t_duplicate |= transaction_duplicate[i];
|
t_duplicate |= transaction_duplicate[i];
|
||||||
t_duplicate |= transaction_duplicate[i+1];
|
t_duplicate |= transaction_duplicate[i+1];
|
||||||
|
|
||||||
//fprintf(stdout, "%ld %ld c:%d t:%d\n", reserve_uuid[i], reserve_uuid[i+1], conflicts[i], transaction_duplicate[i]);
|
|
||||||
i += 2;
|
i += 2;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -835,13 +836,19 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
|
|||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! need_update)
|
if (! need_update)
|
||||||
{
|
{
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
/* fprintf(stdout, "t : %d", t_duplicate);
|
||||||
if (t_duplicate)
|
if (t_duplicate)
|
||||||
goto exit;
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
|
TEH_PG_rollback (pg);
|
||||||
|
return GNUNET_DB_STATUS_HARD_ERROR;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// begin serializable
|
// begin serializable
|
||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -864,7 +871,6 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
|
|||||||
{
|
{
|
||||||
if (! conflicts[i])
|
if (! conflicts[i])
|
||||||
continue;
|
continue;
|
||||||
// fprintf(stdout, "%d\n", conflicts[i]);
|
|
||||||
{
|
{
|
||||||
bool duplicate;
|
bool duplicate;
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
@ -889,7 +895,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
|
|||||||
if (qs3<0)
|
if (qs3<0)
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"Failed to update (%d)\n",
|
"Failed to update reserves (%d)\n",
|
||||||
qs3);
|
qs3);
|
||||||
results[i] = qs3;
|
results[i] = qs3;
|
||||||
return qs3;
|
return qs3;
|
||||||
|
@ -538,7 +538,6 @@ run (void *cls)
|
|||||||
plugin->insert_refund (plugin->cls,
|
plugin->insert_refund (plugin->cls,
|
||||||
&ref));
|
&ref));
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result = 0;
|
result = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user