| 2893 | |
| 2894 | |
| 2895 | static void transaction_options(thread_db* tdbb, |
| 2896 | jrd_tra* transaction, |
| 2897 | const UCHAR* tpb, USHORT tpb_length) |
| 2898 | { |
| 2899 | /************************************** |
| 2900 | * |
| 2901 | * t r a n s a c t i o n _ o p t i o n s |
| 2902 | * |
| 2903 | ************************************** |
| 2904 | * |
| 2905 | * Functional description |
| 2906 | * Process transaction options. |
| 2907 | * |
| 2908 | **************************************/ |
| 2909 | SET_TDBB(tdbb); |
| 2910 | |
| 2911 | if (!tpb_length) |
| 2912 | return; |
| 2913 | |
| 2914 | const UCHAR* const end = tpb + tpb_length; |
| 2915 | |
| 2916 | if (*tpb != isc_tpb_version3 && *tpb != isc_tpb_version1) |
| 2917 | ERR_post(Arg::Gds(isc_bad_tpb_form) << |
| 2918 | Arg::Gds(isc_wrotpbver)); |
| 2919 | |
| 2920 | Attachment* const attachment = tdbb->getAttachment(); |
| 2921 | |
| 2922 | RelationLockTypeMap lockmap; |
| 2923 | |
| 2924 | TriState wait, lock_timeout; |
| 2925 | TriState isolation, read_only, rec_version, read_consistency; |
| 2926 | bool anylock_write = false; |
| 2927 | bool shared_snapshot = false; |
| 2928 | |
| 2929 | ++tpb; |
| 2930 | |
| 2931 | while (tpb < end) |
| 2932 | { |
| 2933 | const USHORT op = *tpb++; |
| 2934 | switch (op) |
| 2935 | { |
| 2936 | case isc_tpb_consistency: |
| 2937 | if (!isolation.assignOnce(true)) |
| 2938 | { |
| 2939 | ERR_post(Arg::Gds(isc_bad_tpb_content) << |
| 2940 | Arg::Gds(isc_tpb_multiple_txn_isolation)); |
| 2941 | } |
| 2942 | |
| 2943 | if (read_consistency.isAssigned()) |
| 2944 | { |
| 2945 | ERR_post(Arg::Gds(isc_bad_tpb_content) << |
| 2946 | // 'Option @1 is not valid if @2 was used previously in TPB' |
| 2947 | Arg::Gds(isc_tpb_conflicting_options) << |
| 2948 | Arg::Str("isc_tpb_consistency") << Arg::Str("isc_tpb_read_consistency")); |
| 2949 | } |
| 2950 | |
| 2951 | if (shared_snapshot) |
| 2952 | { |
no test coverage detected