{
    "id": "mysql140-x-exclusive-reservation",
    "title": "Отдать последнюю лампу одному покупателю",
    "columns": [
        "Наблюдение",
        "Результат"
    ],
    "rows": [
        [
            "Остаток в первом защищённом чтении",
            1
        ],
        [
            "Обычное чтение второго сеанса",
            1
        ],
        [
            "Второй получил NOWAIT-конфликт",
            true
        ],
        [
            "После commit первый резерв существует",
            true
        ],
        [
            "Второй заново прочитал остаток",
            0
        ],
        [
            "Подтверждено резервов",
            1
        ],
        [
            "Итоговый остаток",
            0
        ]
    ],
    "checks": {
        "initial_stock_one": true,
        "ordinary_read_allowed": true,
        "actual_nowait_conflict": true,
        "one_item_changed": true,
        "second_reads_current_zero": true,
        "only_first_reserved": true,
        "no_second_reservation": true,
        "stock_not_negative": true,
        "owned_collections_removed": true
    },
    "observations": {
        "first_locked_read": {
            "_id": "LED-1",
            "kind": "product",
            "stock": 1
        },
        "ordinary_read": {
            "_id": "LED-1",
            "kind": "product",
            "stock": 1
        },
        "nowait_exception_chain": [
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 10000,
                "message": "[HY000] Couldn't fetch data"
            },
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 3572,
                "message": "[HY000] Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set."
            }
        ],
        "second_locked_read_after_commit": {
            "_id": "LED-1",
            "kind": "product",
            "stock": 0
        },
        "saved_product": {
            "_id": "LED-1",
            "kind": "product",
            "stock": 0
        },
        "saved_reservations": [
            {
                "_id": "RES-A",
                "qty": 1,
                "owner": "A"
            }
        ]
    },
    "runtime": {
        "php": "8.3.35",
        "extension": "8.0.30",
        "server_version": 80413,
        "schema": "php_manual_x139",
        "host": "127.0.0.1",
        "port": 33140
    },
    "owned_collections": [
        "mysql140_exclusive_reservation_6f3406113631"
    ],
    "removed_collections": [
        "mysql140_exclusive_reservation_6f3406113631"
    ]
}
