@@ -2929,39 +2929,85 @@ static void transaction_options(thread_db* tdbb,
2929
2929
{
2930
2930
case isc_tpb_consistency:
2931
2931
if (!isolation.assignOnce (true ))
2932
+ {
2932
2933
ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2933
2934
Arg::Gds (isc_tpb_multiple_txn_isolation));
2935
+ }
2936
+
2937
+ if (read_consistency.isAssigned ())
2938
+ {
2939
+ ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2940
+ // 'Option @1 is not valid if @2 was used previously in TPB'
2941
+ Arg::Gds (isc_tpb_conflicting_options) <<
2942
+ Arg::Str (" isc_tpb_consistency" ) << Arg::Str (" isc_tpb_read_consistency" ));
2943
+ }
2944
+
2945
+ if (rec_version.isAssigned ())
2946
+ {
2947
+ const auto tpbStr = rec_version.asBool () ?
2948
+ " isc_tpb_rec_version" : " isc_tpb_no_rec_version" ;
2949
+
2950
+ ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2951
+ // 'Option @1 is not valid if @2 was used previously in TPB'
2952
+ Arg::Gds (isc_tpb_conflicting_options) <<
2953
+ Arg::Str (" isc_tpb_consistency" ) << Arg::Str (tpbStr) );
2954
+ }
2934
2955
2935
2956
if (shared_snapshot)
2936
2957
{
2937
2958
ERR_post (
2938
2959
Arg::Gds (isc_bad_tpb_content) <<
2960
+ // 'Option @1 is not valid if @2 was used previously in TPB'
2939
2961
Arg::Gds (isc_tpb_conflicting_options) <<
2940
2962
Arg::Str (" isc_tpb_consistency" ) << Arg::Str (" isc_tpb_at_snapshot_number" ));
2941
2963
}
2942
2964
2943
2965
transaction->tra_flags |= TRA_degree3;
2944
- transaction->tra_flags &= ~TRA_read_committed;
2966
+ transaction->tra_flags &= ~( TRA_read_committed | TRA_read_consistency | TRA_rec_version) ;
2945
2967
break ;
2946
2968
2947
2969
case isc_tpb_concurrency:
2948
2970
if (!isolation.assignOnce (true ))
2971
+ {
2949
2972
ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2950
2973
Arg::Gds (isc_tpb_multiple_txn_isolation));
2974
+ }
2975
+
2976
+ if (read_consistency.isAssigned ())
2977
+ {
2978
+ ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2979
+ // 'Option @1 is not valid if @2 was used previously in TPB'
2980
+ Arg::Gds (isc_tpb_conflicting_options) <<
2981
+ Arg::Str (" isc_tpb_concurrency" ) << Arg::Str (" isc_tpb_read_consistency" ));
2982
+ }
2983
+
2984
+ if (rec_version.isAssigned ())
2985
+ {
2986
+ const auto tpbStr = rec_version.asBool () ?
2987
+ " isc_tpb_rec_version" : " isc_tpb_no_rec_version" ;
2988
+
2989
+ ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2990
+ // 'Option @1 is not valid if @2 was used previously in TPB'
2991
+ Arg::Gds (isc_tpb_conflicting_options) <<
2992
+ Arg::Str (" isc_tpb_concurrency" ) << Arg::Str (tpbStr) );
2993
+ }
2951
2994
2952
2995
transaction->tra_flags &= ~TRA_degree3;
2953
- transaction->tra_flags &= ~TRA_read_committed;
2996
+ transaction->tra_flags &= ~( TRA_read_committed | TRA_read_consistency | TRA_rec_version) ;
2954
2997
break ;
2955
2998
2956
2999
case isc_tpb_read_committed:
2957
3000
if (!isolation.assignOnce (true ))
3001
+ {
2958
3002
ERR_post (Arg::Gds (isc_bad_tpb_content) <<
2959
3003
Arg::Gds (isc_tpb_multiple_txn_isolation));
3004
+ }
2960
3005
2961
3006
if (shared_snapshot)
2962
3007
{
2963
3008
ERR_post (
2964
3009
Arg::Gds (isc_bad_tpb_content) <<
3010
+ // 'Option @1 is not valid if @2 was used previously in TPB'
2965
3011
Arg::Gds (isc_tpb_conflicting_options) <<
2966
3012
Arg::Str (" isc_tpb_read_committed" ) << Arg::Str (" isc_tpb_at_snapshot_number" ));
2967
3013
}
@@ -3066,14 +3112,16 @@ static void transaction_options(thread_db* tdbb,
3066
3112
3067
3113
if (rec_version.isAssigned ())
3068
3114
{
3115
+ const auto tpbStr = rec_version.asBool () ?
3116
+ " isc_tpb_rec_version" : " isc_tpb_no_rec_version" ;
3117
+
3069
3118
ERR_post (Arg::Gds (isc_bad_tpb_content) <<
3070
3119
// 'Option @1 is not valid if @2 was used previously in TPB'
3071
3120
Arg::Gds (isc_tpb_conflicting_options) <<
3072
- Arg::Str (" isc_tpb_read_consistency" ) << (rec_version.asBool () ?
3073
- Arg::Str (" isc_tpb_rec_version" ) : Arg::Str (" isc_tpb_no_rec_version" )) );
3121
+ Arg::Str (" isc_tpb_read_consistency" ) << Arg::Str (tpbStr) );
3074
3122
}
3075
3123
3076
- transaction->tra_flags |= TRA_read_consistency | TRA_rec_version;
3124
+ transaction->tra_flags |= TRA_read_committed | TRA_read_consistency | TRA_rec_version;
3077
3125
break ;
3078
3126
3079
3127
case isc_tpb_nowait:
@@ -3479,24 +3527,12 @@ static void transaction_options(thread_db* tdbb,
3479
3527
}
3480
3528
}
3481
3529
3482
- if (rec_version.isAssigned () && !(transaction->tra_flags & TRA_read_committed))
3483
- {
3484
- if (rec_version.asBool ())
3485
- {
3486
- ERR_post (Arg::Gds (isc_bad_tpb_content) <<
3487
- Arg::Gds (isc_tpb_option_without_rc) << Arg::Str (" isc_tpb_rec_version" ));
3488
- }
3489
- else
3490
- {
3491
- ERR_post (Arg::Gds (isc_bad_tpb_content) <<
3492
- Arg::Gds (isc_tpb_option_without_rc) << Arg::Str (" isc_tpb_no_rec_version" ));
3493
- }
3494
- }
3495
-
3496
- if ((transaction->tra_flags & TRA_read_committed) && !(tdbb->tdbb_flags & TDBB_sweeper))
3530
+ if ((transaction->tra_flags & TRA_read_committed) &&
3531
+ !(transaction->tra_flags & TRA_read_consistency) &&
3532
+ !(tdbb->tdbb_flags & TDBB_sweeper) &&
3533
+ tdbb->getDatabase ()->dbb_config ->getReadConsistency ())
3497
3534
{
3498
- if (tdbb->getDatabase ()->dbb_config ->getReadConsistency ())
3499
- transaction->tra_flags |= TRA_read_consistency | TRA_rec_version;
3535
+ transaction->tra_flags |= TRA_read_consistency | TRA_rec_version;
3500
3536
}
3501
3537
3502
3538
if (transaction->tra_attachment ->isGbak ())
0 commit comments