8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 19:23:03 +01:00

Added specific error code for read conflicts in RC NO_REC_VER mode. Added missing conflict counting.

This commit is contained in:
dimitr 2014-08-27 12:56:36 +00:00
parent d513daa574
commit a79ff180da
9 changed files with 19 additions and 8 deletions

View File

@ -797,6 +797,7 @@ static const struct {
{"dup_attribute", 335545093}, {"dup_attribute", 335545093},
{"dyn_no_priv", 335545094}, {"dyn_no_priv", 335545094},
{"dsql_cant_grant_option", 335545095}, {"dsql_cant_grant_option", 335545095},
{"read_conflict", 335545096},
{"gfix_db_name", 335740929}, {"gfix_db_name", 335740929},
{"gfix_invalid_sw", 335740930}, {"gfix_invalid_sw", 335740930},
{"gfix_incmp_sw", 335740932}, {"gfix_incmp_sw", 335740932},

View File

@ -831,6 +831,7 @@ const ISC_STATUS isc_cursor_not_positioned = 335545092L;
const ISC_STATUS isc_dup_attribute = 335545093L; const ISC_STATUS isc_dup_attribute = 335545093L;
const ISC_STATUS isc_dyn_no_priv = 335545094L; const ISC_STATUS isc_dyn_no_priv = 335545094L;
const ISC_STATUS isc_dsql_cant_grant_option = 335545095L; const ISC_STATUS isc_dsql_cant_grant_option = 335545095L;
const ISC_STATUS isc_read_conflict = 335545096L;
const ISC_STATUS isc_gfix_db_name = 335740929L; const ISC_STATUS isc_gfix_db_name = 335740929L;
const ISC_STATUS isc_gfix_invalid_sw = 335740930L; const ISC_STATUS isc_gfix_invalid_sw = 335740930L;
const ISC_STATUS isc_gfix_incmp_sw = 335740932L; const ISC_STATUS isc_gfix_incmp_sw = 335740932L;
@ -1289,7 +1290,7 @@ const ISC_STATUS isc_trace_switch_user_only = 337182757L;
const ISC_STATUS isc_trace_switch_param_miss = 337182758L; const ISC_STATUS isc_trace_switch_param_miss = 337182758L;
const ISC_STATUS isc_trace_param_act_notcompat = 337182759L; const ISC_STATUS isc_trace_param_act_notcompat = 337182759L;
const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L; const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L;
const ISC_STATUS isc_err_max = 1233; const ISC_STATUS isc_err_max = 1234;
#else /* c definitions */ #else /* c definitions */
@ -2090,6 +2091,7 @@ const ISC_STATUS isc_err_max = 1233;
#define isc_dup_attribute 335545093L #define isc_dup_attribute 335545093L
#define isc_dyn_no_priv 335545094L #define isc_dyn_no_priv 335545094L
#define isc_dsql_cant_grant_option 335545095L #define isc_dsql_cant_grant_option 335545095L
#define isc_read_conflict 335545096L
#define isc_gfix_db_name 335740929L #define isc_gfix_db_name 335740929L
#define isc_gfix_invalid_sw 335740930L #define isc_gfix_invalid_sw 335740930L
#define isc_gfix_incmp_sw 335740932L #define isc_gfix_incmp_sw 335740932L
@ -2548,7 +2550,7 @@ const ISC_STATUS isc_err_max = 1233;
#define isc_trace_switch_param_miss 337182758L #define isc_trace_switch_param_miss 337182758L
#define isc_trace_param_act_notcompat 337182759L #define isc_trace_param_act_notcompat 337182759L
#define isc_trace_mandatory_switch_miss 337182760L #define isc_trace_mandatory_switch_miss 337182760L
#define isc_err_max 1233 #define isc_err_max 1234
#endif #endif

View File

@ -800,6 +800,7 @@ Data source : @4"}, /* eds_statement */
{335545093, "Duplicated user attribute @1"}, /* dup_attribute */ {335545093, "Duplicated user attribute @1"}, /* dup_attribute */
{335545094, "There is no privilege for this operation"}, /* dyn_no_priv */ {335545094, "There is no privilege for this operation"}, /* dyn_no_priv */
{335545095, "Using GRANT OPTION on @1 not allowed"}, /* dsql_cant_grant_option */ {335545095, "Using GRANT OPTION on @1 not allowed"}, /* dsql_cant_grant_option */
{335545096, "read conflicts with concurrent update"}, /* read_conflict */
{335740929, "data base file name (@1) already given"}, /* gfix_db_name */ {335740929, "data base file name (@1) already given"}, /* gfix_db_name */
{335740930, "invalid switch @1"}, /* gfix_invalid_sw */ {335740930, "invalid switch @1"}, /* gfix_invalid_sw */
{335740932, "incompatible switch combination"}, /* gfix_incmp_sw */ {335740932, "incompatible switch combination"}, /* gfix_incmp_sw */

View File

@ -796,6 +796,7 @@ static const struct {
{335545093, -901}, /* 773 dup_attribute */ {335545093, -901}, /* 773 dup_attribute */
{335545094, -901}, /* 774 dyn_no_priv */ {335545094, -901}, /* 774 dyn_no_priv */
{335545095, -901}, /* 775 dsql_cant_grant_option */ {335545095, -901}, /* 775 dsql_cant_grant_option */
{335545096, -904}, /* 776 read_conflict */
{335740929, -901}, /* 1 gfix_db_name */ {335740929, -901}, /* 1 gfix_db_name */
{335740930, -901}, /* 2 gfix_invalid_sw */ {335740930, -901}, /* 2 gfix_invalid_sw */
{335740932, -901}, /* 4 gfix_incmp_sw */ {335740932, -901}, /* 4 gfix_incmp_sw */

View File

@ -796,6 +796,7 @@ static const struct {
{335545093, "42702"}, // 773 dup_attribute {335545093, "42702"}, // 773 dup_attribute
{335545094, "42000"}, // 774 dyn_no_priv {335545094, "42000"}, // 774 dyn_no_priv
{335545095, "42000"}, // 775 dsql_cant_grant_option {335545095, "42000"}, // 775 dsql_cant_grant_option
{335545096, "40001"}, // 776 read_conflict
{335740929, "00000"}, // 1 gfix_db_name {335740929, "00000"}, // 1 gfix_db_name
{335740930, "00000"}, // 2 gfix_invalid_sw {335740930, "00000"}, // 2 gfix_invalid_sw
{335740932, "00000"}, // 4 gfix_incmp_sw {335740932, "00000"}, // 4 gfix_incmp_sw

View File

@ -746,8 +746,7 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
if (!(transaction->tra_flags & TRA_ignore_limbo)) if (!(transaction->tra_flags & TRA_ignore_limbo))
{ {
CCH_RELEASE(tdbb, &rpb->getWindow(tdbb)); CCH_RELEASE(tdbb, &rpb->getWindow(tdbb));
ERR_post(Arg::Gds(isc_deadlock) << ERR_post(Arg::Gds(isc_deadlock) << Arg::Gds(isc_trainlim));
Arg::Gds(isc_trainlim));
} }
state = tra_limbo; state = tra_limbo;
@ -768,7 +767,10 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
if (state == tra_active) if (state == tra_active)
{ {
tdbb->bumpRelStats(RuntimeStatistics::RECORD_CONFLICTS, relation->rel_id);
ERR_post(Arg::Gds(isc_deadlock) << ERR_post(Arg::Gds(isc_deadlock) <<
Arg::Gds(isc_read_conflict) <<
Arg::Gds(isc_concurrent_transaction) << Arg::Num(rpb->rpb_transaction_nr)); Arg::Gds(isc_concurrent_transaction) << Arg::Num(rpb->rpb_transaction_nr));
} }
@ -5405,6 +5407,8 @@ static int prepare_update( thread_db* tdbb,
// We need to loop waiting in read committed transactions only // We need to loop waiting in read committed transactions only
if (!(transaction->tra_flags & TRA_read_committed)) if (!(transaction->tra_flags & TRA_read_committed))
{ {
tdbb->bumpRelStats(RuntimeStatistics::RECORD_CONFLICTS, relation->rel_id);
ERR_post(Arg::Gds(isc_deadlock) << ERR_post(Arg::Gds(isc_deadlock) <<
Arg::Gds(isc_update_conflict) << Arg::Gds(isc_update_conflict) <<
Arg::Gds(isc_concurrent_transaction) << Arg::Num(update_conflict_trans)); Arg::Gds(isc_concurrent_transaction) << Arg::Num(update_conflict_trans));
@ -5413,8 +5417,7 @@ static int prepare_update( thread_db* tdbb,
return PREPARE_LOCKERR; return PREPARE_LOCKERR;
case tra_limbo: case tra_limbo:
ERR_post(Arg::Gds(isc_deadlock) << ERR_post(Arg::Gds(isc_deadlock) << Arg::Gds(isc_trainlim));
Arg::Gds(isc_trainlim));
case tra_dead: case tra_dead:
break; break;

View File

@ -1,7 +1,7 @@
/* MAX_NUMBER is the next number to be used, always one more than the highest message number. */ /* MAX_NUMBER is the next number to be used, always one more than the highest message number. */
set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES (?, ?, ?, ?); set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES (?, ?, ?, ?);
-- --
('2014-07-12 23:48:00', 'JRD', 0, 776) ('2014-08-27 16:38:00', 'JRD', 0, 777)
('2012-01-23 20:10:30', 'QLI', 1, 532) ('2012-01-23 20:10:30', 'QLI', 1, 532)
('2013-11-13 15:59:10', 'GFIX', 3, 122) ('2013-11-13 15:59:10', 'GFIX', 3, 122)
('1996-11-07 13:39:40', 'GPRE', 4, 1) ('1996-11-07 13:39:40', 'GPRE', 4, 1)

View File

@ -883,6 +883,7 @@ Data source : @4', NULL, NULL)
('dup_attribute', 'UserManagement::execute', 'UserManagement.cpp', NULL, 0, 773, NULL, 'Duplicated user attribute @1', NULL, NULL); ('dup_attribute', 'UserManagement::execute', 'UserManagement.cpp', NULL, 0, 773, NULL, 'Duplicated user attribute @1', NULL, NULL);
('dyn_no_priv', NULL, 'scl.epp', NULL, 0, 774, NULL, 'There is no privilege for this operation', NULL, NULL); ('dyn_no_priv', NULL, 'scl.epp', NULL, 0, 774, NULL, 'There is no privilege for this operation', NULL, NULL);
('dsql_cant_grant_option', NULL, 'DdlNodes.epp', NULL, 0, 775, NULL, 'Using GRANT OPTION on @1 not allowed', NULL, NULL); ('dsql_cant_grant_option', NULL, 'DdlNodes.epp', NULL, 0, 775, NULL, 'Using GRANT OPTION on @1 not allowed', NULL, NULL);
('read_conflict', NULL, NULL, 'vio.cpp', 0, 776, NULL, 'read conflicts with concurrent update', NULL, NULL);
-- QLI -- QLI
(NULL, NULL, NULL, NULL, 1, 0, NULL, 'expected type', NULL, NULL); (NULL, NULL, NULL, NULL, 1, 0, NULL, 'expected type', NULL, NULL);
(NULL, NULL, NULL, NULL, 1, 1, NULL, 'bad block type', NULL, NULL); (NULL, NULL, NULL, NULL, 1, 1, NULL, 'bad block type', NULL, NULL);

View File

@ -782,6 +782,7 @@ set bulk_insert INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, FA
(-901, '42', '702', 0, 773, 'dup_attribute', NULL, NULL); (-901, '42', '702', 0, 773, 'dup_attribute', NULL, NULL);
(-901, '42', '000', 0, 774, 'dyn_no_priv', NULL, NULL) (-901, '42', '000', 0, 774, 'dyn_no_priv', NULL, NULL)
(-901, '42', '000', 0, 775, 'dsql_cant_grant_option', NULL, NULL); (-901, '42', '000', 0, 775, 'dsql_cant_grant_option', NULL, NULL);
(-904, '40', '001', 0, 776, 'read_conflict', NULL, NULL);
-- GFIX -- GFIX
(-901, '00', '000', 3, 1, 'gfix_db_name', NULL, NULL) (-901, '00', '000', 3, 1, 'gfix_db_name', NULL, NULL)
(-901, '00', '000', 3, 2, 'gfix_invalid_sw', NULL, NULL) (-901, '00', '000', 3, 2, 'gfix_invalid_sw', NULL, NULL)