Fun_GetAddMapJson.md 1.22 KB

Fun_GetAddMapJson (function)

组装MapJSON

  • Type: FUNCTION
  • Returns: longtext
  • Deterministic: NO
  • SQL data access: CONTAINS SQL

Parameters

# Mode Name Type
1 IN p_JSON longtext
2 IN p_Cloumn varchar(500)
3 IN p_Value varchar(1000)

Body

Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTIONFunGetAddMapJson'._

Narrative

Business context: JSON-object builder — 组装MapJSON. Appends a single "key":"value" pair to an existing JSON object (or creates a new one if empty), returning the merged JSON string.

What it does: strips { and } from p_JSON to gauge non-emptiness. If empty, returns {"p_Cloumn":"p_value"}. Otherwise, snips the trailing } off p_JSON and concatenates ,"p_Cloumn":"p_value"}. Pure string manipulation — does not parse or validate JSON.

Invocation: Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. MySQL's native JSON_SET / JSON_OBJECT are preferred elsewhere in the codebase.