{"record":{"id":"24d6b6e2f62349a8","repo":"sqlmapproject/sqlmap","slug":"no-working-substring-function-found","errorCode":null,"errorMessage":"no working substring function found","messagePattern":"no working substring function found","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"extra/esperanto/discovery.py","lineNumber":216,"sourceCode":"            if base is None:\n                continue\n            self.dialect.substring = Cap(name, tmpl, index_base=base)\n            # base detection above CONFIRMS the substring fn works; the property\n            # measurements below are best-effort and MUST NOT discard it - a probe the\n            # oracle can't decide leaves the property at a safe default, never aborts.\n            props = self.dialect.substring.props\n            try:\n                props[\"beyond_end\"] = self._edgeBehavior(self._sub(\"'ABCDE'\", 6, 1))\n                props[\"zero_length\"] = self._edgeBehavior(self._sub(\"'ABCDE'\", 1, 0))\n                props[\"unit\"] = self._substringUnit()\n            except OracleUndecided:\n                pass\n            props.setdefault(\"beyond_end\", \"unknown\")\n            props.setdefault(\"zero_length\", \"unknown\")\n            props.setdefault(\"unit\", \"unknown\")\n            return name\n        self.dialect.substring = None\n        raise RuntimeError(\"no working substring function found\")\n\n    def _codeCharTmpl(self):\n        # a code->char template (CHAR/CHR/NCHAR), probed ASCII-only and cached. lets\n        # the unicode PROPERTY probes build a multibyte test char server-side instead\n        # of pushing a raw non-ASCII byte through the URL/app/DBMS encoding layers.\n        if self._codeTmpl is None:\n            self._codeTmpl = False\n            # PASS 1 prefers a UNICODE-capable constructor (one that yields a non-NULL char for a\n            # code point > 255), so SQL Server picks NCHAR over the byte-only CHAR - CHAR(8364)\n            # is NULL there and would break the euro/UTF-16 probes. PASS 2 accepts any ASCII-\n            # working constructor when no Unicode-capable one exists.\n            for unicode_capable in (True, False):\n                for _, tmpl in _CHARFROM:\n                    if not (self._ask(\"%s='a'\" % tmpl.format(code=97)) and\n                            not self._ask(\"%s='b'\" % tmpl.format(code=97))):\n                        continue\n                    if unicode_capable and not self._ask(\"(%s) IS NOT NULL\" % tmpl.format(code=256)):\n                        continue","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/esperanto/discovery.py#L198-L234","documentation":"Error \"no working substring function found\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/esperanto/discovery.py:216 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"}