{"record":{"id":"45264b475b207433","repo":"sqlmapproject/sqlmap","slug":"no-working-length-function-found","errorCode":null,"errorMessage":"no working length function found","messagePattern":"no working length function found","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"extra/esperanto/discovery.py","lineNumber":280,"sourceCode":"        # so length stays in the same unit as the char-indexed substring\n        for prefer_chars in (True, False):\n            for name, tmpl in _LENGTH:\n                f = lambda s: tmpl.format(expr=s)\n                if not (self._ask(\"%s=1\" % f(\"'A'\")) and self._ask(\"%s=2\" % f(\"'AB'\"))):\n                    continue\n                try:\n                    unit = self._lengthUnit(f)\n                except OracleUndecided:\n                    unit = \"unknown\"\n                if prefer_chars and unit != \"characters\":\n                    continue\n                trailing = self._ask(\"%s=2\" % f(\"'A '\"))       # preserves trailing space?\n                empty_null = not self._ask(\"(%s) IS NOT NULL\" % f(\"''\"))  # LENGTH('') errors/NULL?\n                self.dialect.length = Cap(name, tmpl, unit=unit, trailing=trailing,\n                                          empty_is_null=empty_null)\n                return name\n        self.dialect.length = None\n        raise RuntimeError(\"no working length function found\")\n\n    def _lengthUnit(self, f):\n        # ASCII-only: measure the length of a multibyte char built from its code.\n        # 1 => character-counting, >=2 => byte-counting. no raw non-ASCII on the wire.\n        cf = self._codeCharTmpl()\n        if not cf:\n            return \"unknown\"\n        mb = cf.format(code=0x20AC)\n        if self._ask(\"%s=1\" % f(mb)):\n            return \"characters\"\n        if self._ask(\"%s>=2\" % f(mb)):\n            return \"bytes\"\n        return \"unknown\"\n\n    def _fixupLength(self):\n        # a length fn that trims trailing spaces (SQL Server/Sybase LEN) truncates\n        # any value ending in spaces; rebuild it as LEN(x||'.')-1 with the concat.\n        L = self.dialect.length","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/esperanto/discovery.py#L262-L298","documentation":"Error \"no working length function found\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/esperanto/discovery.py:280 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"}