{"record":{"id":"7d7da4f11a59c9e7","repo":"sqlmapproject/sqlmap","slug":"unexpected-tds-token-0x-02x","errorCode":null,"errorMessage":"unexpected TDS token 0x%02x","messagePattern":"unexpected TDS token 0x%02x","errorType":"exception","errorClass":"InterfaceError","httpStatus":null,"severity":"error","filePath":"extra/dbwire/tds.py","lineNumber":537,"sourceCode":"            error = data[msg_off + 2:msg_off + 2 + mlen * 2].decode(\"utf-16-le\", \"replace\")\n            off += tlen\n        elif token == 0xab:  # INFO\n            (tlen,) = struct.unpack(\"<H\", data[off:off + 2]); off += 2 + tlen\n        elif token == 0xad:  # LOGINACK\n            (tlen,) = struct.unpack(\"<H\", data[off:off + 2]); off += 2 + tlen\n        elif token == 0xe3:  # ENVCHANGE\n            (tlen,) = struct.unpack(\"<H\", data[off:off + 2]); off += 2 + tlen\n        elif token == 0x79:  # RETURNSTATUS\n            off += 4\n        elif token == 0xa9:  # ORDER\n            (tlen,) = struct.unpack(\"<H\", data[off:off + 2]); off += 2 + tlen\n        elif token in (0xfd, 0xfe, 0xff):  # DONE / DONEPROC / DONEINPROC\n            status, _curcmd, rowcount = struct.unpack(\"<HHq\", data[off:off + 12])\n            if status & _DONE_COUNT:        # only then is DoneRowCount meaningful (MS-TDS 2.2.7.5)\n                affected = rowcount if affected is None else affected + rowcount\n            off += 12\n        else:\n            raise InterfaceError(\"unexpected TDS token 0x%02x\" % token)\n\n    if error is not None:\n        if login:\n            raise OperationalError(\"(remote) %s\" % error)\n        raise ProgrammingError(\"(remote) %s\" % error)\n    return description, rows, affected\n\nclass Cursor(object):\n    def __init__(self, connection):\n        self.connection = connection\n        self.description = None\n        self.rowcount = -1\n        self._rows = []\n        self._pos = 0\n\n    def execute(self, query, params=None):\n        if params is not None:\n            raise NotSupportedError(\"parameter binding is not supported; pass a fully-formed query string\")","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/dbwire/tds.py#L519-L555","documentation":"Error \"unexpected TDS token 0x%02x\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/dbwire/tds.py:537 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"}