{"record":{"id":"2e495f5dae6e8279","repo":"sqlmapproject/sqlmap","slug":"unexpected-firebird-operation-d-during-fetch","errorCode":null,"errorMessage":"unexpected Firebird operation %d during fetch","messagePattern":"unexpected Firebird operation (.+?) during fetch","errorType":"exception","errorClass":"OperationalError","httpStatus":null,"severity":"error","filePath":"extra/dbwire/firebird.py","lineNumber":629,"sourceCode":"            blr += [7, 0]\n        blr += [255, 76]\n        return bytes(bytearray((256 + b) if b < 0 else b for b in blr))\n\n    def _fetch(self, stmt, columns):\n        blr = self._calc_blr(columns)\n        nbytes = (len(columns) + 7) // 8\n        blob_cols = [i for i, c in enumerate(columns) if c.sqltype == _SQL_BLOB]\n        rows = []\n        more = True\n        while more:\n            self._send(_pack_int(_op_fetch) + _pack_int(stmt) + _pack_bytes(blr) + _pack_int(0) + _pack_int(400))\n            op = self._wire.recv_int()\n            while op == _op_dummy:\n                op = self._wire.recv_int()\n            if op != _op_fetch_response:\n                if op == _op_response:\n                    _parse_response(self._wire)\n                raise OperationalError(\"unexpected Firebird operation %d during fetch\" % op)\n            status = self._wire.recv_int()\n            count = self._wire.recv_int()\n            while count:\n                null_bitmap = _le(self._wire.recv(nbytes, align=True))\n                row = []\n                for i, col in enumerate(columns):\n                    if null_bitmap & (1 << i):\n                        row.append(None)\n                        continue\n                    io = col.io_length()\n                    ln = self._wire.recv_int() if io < 0 else io\n                    raw = self._wire.recv(ln, align=True)\n                    # blob columns yield an 8-byte blob id; resolve AFTER the fetch batch is fully drained\n                    # (a blob sub-request mid-batch would interleave with the still-streaming rows and desync)\n                    row.append(raw if col.sqltype == _SQL_BLOB else self._decode(col, raw))\n                rows.append(row)\n                op = self._wire.recv_int()\n                status = self._wire.recv_int()","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/dbwire/firebird.py#L611-L647","documentation":"Error \"unexpected Firebird operation %d during fetch\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/dbwire/firebird.py:629 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}