Skip to content

fix: support ABAP SQL string functions - #27

Merged
marianfoo merged 7 commits into
masterfrom
codex/fix-base-bug-003-v2
Aug 7, 2026
Merged

marianfoo merged 7 commits into
masterfrom
codex/fix-base-bug-003-v2

Conversation

@marianfoo

Copy link
Copy Markdown
Owner

Summary

  • fix SUBSTRING, CONCAT, LENGTH, LPAD, LTRIM, REPLACE, RIGHT, and RTRIM result generation
  • add a quote- and parenthesis-aware select-list scanner for metadata inference
  • preserve the original validated executable SQL unchanged
  • add focused ABAP Unit coverage for nested functions, aliases, literal commas/blanks, the complete ABAP 7.50 function family, and malformed expressions

Fixes #4.

Root cause

QUERY_GENERATE replaced every comma in its inference copy and split the result at spaces. That collapsed top-level result separators, nested function arguments, and literal data into the same representation, so tokens such as SUBSTRING( fell through to invalid DDIC component inference. LENGTH also failed to activate strict ABAP SQL clause ordering because it contains no comma.

The new scanner normalizes only the metadata-inference copy. It tracks parentheses, literals, and doubled quotes; supported function expressions are kept together and malformed representations fail closed before generated-program creation.

TDD evidence

  • red candidate f75fad1 on SAP_BASIS 750: all 67 inherited tests passed and exactly four new function-generator regressions failed
  • final source candidate 6a2971b: 78/78 ABAP Unit tests pass on SAP_BASIS 750 and SAP_BASIS 758
  • local source SHA-256: 4f07726e262d06a42fa56257197bd22ce5d1654fbf64919e9069f2a28deb3256
  • both systems reported equal active/inactive candidate source at server-normalized SHA-256 36ebfcba68733ff91655ec552298af8ec5d19a203767aa88f34dedc67d7e6f83

Validation

  • npm ci: passed, no dependency vulnerabilities
  • npm test: passed, configured abaplint has 0 findings
  • repository and installation contracts: passed
  • git diff --check: passed
  • NPL / SAP_BASIS 750: activation, syntax, 78/78 Unit, inactive-object closure, and complete DEFAULT ATC passed; ATC remained 88 findings
  • A4H / SAP_BASIS 758: activation, syntax, 78/78 Unit, inactive-object closure, and complete ABAP_CLOUD_READINESS passed; ATC remained 682 findings
  • S4HANA_READINESS_2023 returned no rows but remains explicitly prerequisite-incomplete
  • fresh A4H WebGUI sessions returned five rows for SUBSTRING and nested CONCAT/SUBSTRING queries with expected aliases
  • no new ST22 dump appeared
  • both shared SAP targets were restored and explicitly activated to exact master after evidence collection
  • final Codex Security diff review covered all four changed files and found no reportable security regression

Compatibility and risk

The implementation uses ABAP syntax and APIs available on SAP_BASIS 750. It introduces no new SAP API or structural object. Existing source authorization, full-fragment validation, generated-line splitting, and both GENERATE SUBROUTINE POOL gates remain in place.

This is a non-breaking bug fix. Release Please PR #23 is intentionally not modified or merged here.

@marianfoo

Copy link
Copy Markdown
Owner Author

Final checked head a662e00 is green. Quality run: https://github.com/marianfoo/ztoad/actions/runs/31173457448 (Repository quality / ABAP 7.50 passed); abaplint passed and observations completed neutral. The post-green audit changed documentation only, moved the plan to docs/plans/finished, and did not invalidate the frozen ABAP candidate or its recorded live-system evidence.

@marianfoo
marianfoo merged commit 0f056e8 into master Aug 7, 2026
3 checks passed
@marianfoo
marianfoo deleted the codex/fix-base-bug-003-v2 branch August 7, 2026 11:17
This was referenced Aug 7, 2026
marianfoo pushed a commit that referenced this pull request Aug 7, 2026
🤖 I have created a release *beep* *boop*
---


## [5.0.1](5.0.0...5.0.1)
(2026-08-07)


### Bug Fixes

* bound temporary subroutine pools
([#32](#32))
([ef54657](ef54657))
* classify ZTOAD table as not extensible
([#26](#26))
([e5ae759](e5ae759))
* enforce bounded SELECT results
([#33](#33))
([b6acc14](b6acc14))
* execute queries safely in WebGUI
([#24](#24))
([5218476](5218476))
* execute UNION as one SQL set
([a5ad27c](a5ad27c))
* generate aggregate CASE result types
([#21](#21))
([d532b2e](d532b2e))
* isolate generated query failures
([#31](#31))
([b0b4d9f](b0b4d9f))
* parse top-level SQL clauses
([#28](#28))
([c5ca65b](c5ca65b))
* support ABAP SQL string functions
([#27](#27))
([0f056e8](0f056e8))
* verify complete native-abapGit installation
([#22](#22))
([2360fe4](2360fe4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open SQL Functions not working

1 participant