mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
Go AWS SDK v2 expression.Builder joins top-level UpdateExpression clauses with '\n' (e.g. "SET #a = :a\nADD #b :b"). Two bugs in the clause walker silently dropped clauses on these inputs: 1. indexOfKeyword only accepted a literal space as the left word boundary, so a keyword preceded by \n/\t/\r was rejected. This meant findNextClauseKeyword returned -1 for the next clause, and the current clause helper consumed the next clause's text as its own operand. For "SET x = :a\nADD y :b" applySetClause swallowed ":a\nADD y :b" as the SET value, failed the placeholder lookup, and neither SET nor ADD ran. Relaxed the boundary check to accept any whitespace via Character.isWhitespace. 2. indexOfKeyword returned -1 at the first non-boundary occurrence of a keyword, even when a valid match existed later. An attribute named oldSET in "REMOVE oldSET SET newAttr = :v" masked the real SET. Looped past non-boundary hits until a boundary match or end of string. 3. applyRemoveClause, applyAddClause, and applyDeleteClause advanced on the next comma before checking for a clause keyword, so an intra-clause comma in a following SET (e.g. "ADD a :v SET b = :b, c = :c") consumed the SET keyword. Aligned all three helpers with applySetClause's "earlier of next clause keyword or next comma wins" rule. Closes #430.