sqlmapproject/sqlmap · error · OperationalError

unexpected Firebird operation %d during fetch

Error message

unexpected Firebird operation %d during fetch

What it means

Error "unexpected Firebird operation %d during fetch" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/firebird.py:629

            blr += [7, 0]
        blr += [255, 76]
        return bytes(bytearray((256 + b) if b < 0 else b for b in blr))

    def _fetch(self, stmt, columns):
        blr = self._calc_blr(columns)
        nbytes = (len(columns) + 7) // 8
        blob_cols = [i for i, c in enumerate(columns) if c.sqltype == _SQL_BLOB]
        rows = []
        more = True
        while more:
            self._send(_pack_int(_op_fetch) + _pack_int(stmt) + _pack_bytes(blr) + _pack_int(0) + _pack_int(400))
            op = self._wire.recv_int()
            while op == _op_dummy:
                op = self._wire.recv_int()
            if op != _op_fetch_response:
                if op == _op_response:
                    _parse_response(self._wire)
                raise OperationalError("unexpected Firebird operation %d during fetch" % op)
            status = self._wire.recv_int()
            count = self._wire.recv_int()
            while count:
                null_bitmap = _le(self._wire.recv(nbytes, align=True))
                row = []
                for i, col in enumerate(columns):
                    if null_bitmap & (1 << i):
                        row.append(None)
                        continue
                    io = col.io_length()
                    ln = self._wire.recv_int() if io < 0 else io
                    raw = self._wire.recv(ln, align=True)
                    # blob columns yield an 8-byte blob id; resolve AFTER the fetch batch is fully drained
                    # (a blob sub-request mid-batch would interleave with the still-streaming rows and desync)
                    row.append(raw if col.sqltype == _SQL_BLOB else self._decode(col, raw))
                rows.append(row)
                op = self._wire.recv_int()
                status = self._wire.recv_int()

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/firebird.py:629 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/2e495f5dae6e8279. Report an issue: GitHub.