{
    "id": "mysql140-x-index-data-contract",
    "title": "Проверить отсутствующее поле и ошибочное описание индекса",
    "columns": [
        "Наблюдение",
        "Результат"
    ],
    "rows": [
        [
            "Optional сохранил документ без weight",
            true
        ],
        [
            "Required отклонён на старых неполных данных",
            true
        ],
        [
            "Вес после исправления исходного документа",
            1
        ],
        [
            "Новая запись без weight отклонена",
            true
        ],
        [
            "Ошибочный JSON отклонён",
            true
        ],
        [
            "Неизвестная опция отклонена",
            true
        ],
        [
            "Неизвестный тип отклонён",
            true
        ],
        [
            "Вызов с unique:true принят",
            true
        ],
        [
            "SHOW INDEX: Non_unique для unique_sku",
            1
        ],
        [
            "Повторный артикул с новым _id записался",
            true
        ],
        [
            "Сохранённых документов",
            3
        ]
    ],
    "checks": {
        "optional_missing": true,
        "required_existing_missing_failed": true,
        "repaired_document": true,
        "required_new_missing_failed": true,
        "malformed_json_failed": true,
        "unknown_field_failed": true,
        "unknown_type_failed": true,
        "index_request_accepted": true,
        "unique_flag_not_enforced": true,
        "duplicate_value_persisted": true,
        "expected_document_count": true,
        "owned_collections_removed": true
    },
    "observations": {
        "optional_document": {
            "_id": "BAG",
            "sku": "BAG"
        },
        "repaired_document": {
            "_id": "BAG",
            "sku": "BAG",
            "weight": 1
        },
        "absent_failed_insert": null,
        "missing_at_build": [
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 5117,
                "message": "[5117][HY000] Collection contains document missing required field"
            }
        ],
        "missing_at_insert": [
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 10000,
                "message": "[HY000] Couldn't fetch data"
            },
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 5115,
                "message": "[HY000] Document is missing a required field"
            }
        ],
        "bad_json": [
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 10077,
                "message": "[10077][HY000] json parse error, code: 4"
            }
        ],
        "unknown_option": [
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 0,
                "message": "unsupported field trait 'unsupported_option"
            }
        ],
        "bad_type": [
            {
                "class": "mysql_xdevapi\\Exception",
                "code": 5017,
                "message": "[5017][HY000] Invalid or unsupported type specification 'NOT_A_SQL_TYPE'"
            }
        ],
        "index_return_type": "bool",
        "indexes": [
            {
                "Table": "mysql140_contract_5447386309f6",
                "Non_unique": 0,
                "Key_name": "PRIMARY",
                "Seq_in_index": 1,
                "Column_name": "_id",
                "Collation": "A",
                "Cardinality": 2,
                "Sub_part": null,
                "Packed": null,
                "Null": "",
                "Index_type": "BTREE",
                "Comment": "",
                "Index_comment": "",
                "Visible": "YES",
                "Expression": null
            },
            {
                "Table": "mysql140_contract_5447386309f6",
                "Non_unique": 1,
                "Key_name": "weight_required",
                "Seq_in_index": 1,
                "Column_name": "$ix_i_r_2D8FA3E83FC26B3A572C94D67A6F56CAC0CA1EAB",
                "Collation": "A",
                "Cardinality": 2,
                "Sub_part": null,
                "Packed": null,
                "Null": "",
                "Index_type": "BTREE",
                "Comment": "",
                "Index_comment": "",
                "Visible": "YES",
                "Expression": null
            },
            {
                "Table": "mysql140_contract_5447386309f6",
                "Non_unique": 1,
                "Key_name": "unique_sku",
                "Seq_in_index": 1,
                "Column_name": "$ix_t40_r_557191F7548279CAE586E18F0925C00E2A85629F",
                "Collation": "A",
                "Cardinality": 2,
                "Sub_part": 40,
                "Packed": null,
                "Null": "",
                "Index_type": "BTREE",
                "Comment": "",
                "Index_comment": "",
                "Visible": "YES",
                "Expression": null
            }
        ],
        "duplicate_sku_exception": null,
        "duplicate_readback": {
            "_id": "DUP",
            "sku": "BOX",
            "weight": 3
        },
        "documents": [
            {
                "_id": "BAG",
                "sku": "BAG",
                "weight": 1
            },
            {
                "_id": "BOX",
                "sku": "BOX",
                "weight": 2
            },
            {
                "_id": "DUP",
                "sku": "BOX",
                "weight": 3
            }
        ]
    },
    "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_contract_5447386309f6"
    ],
    "removed_collections": [
        "mysql140_contract_5447386309f6"
    ]
}
