assimbly / runtime

Java & REST API's for creating and running integrations
Apache License 2.0
17 stars 3 forks source link

[SQL]Double insert of backslash if option Escape characters is enabled #229

Closed Hooghof closed 2 weeks ago

Hooghof commented 1 month ago

If the option Escape characters? in the SQL component is enabled, a backslash is inserted twice. In case this value is inserted: {"body":"abc\ndef"} Acceptance stores: {\"body\":\"abc\ndef\"} Development stores: {\"body\":\"abc\ndef\"} Next stores: {\"body\":\"abc\\ndef\"}

Between abc and ndef there is an extra backslash

Reproduction Instance: next Tenant: Regression Tests Flow: SQL (choices: insert_postgresql, insert_postgresql_escaped and insert_mysql8_escaped) Postman tests: (SQL insert_postgresql, SQL insert_postgresql_escape and SQL insert_mysql8_escaped)

brunovg commented 3 weeks ago

Created the following simple flow test: Development (Test BVG1) - https://development.dovetail.world/flowdesigner/666971249a8bd8000e00000e/1/route Next (Bruno) - https://next.dovetail.world/flowdesigner/66696ae076f90a000a00000e/0/route Acceptance (Test BVG) - https://acceptance.dovetail.world/flowdesign/666972fda2f8f60030000012

And I got the same results, with (second result) and without (first result) using escape chars:

Image

Hooghof commented 3 weeks ago

I tested the same flow on acceptance, development and next. Next gives a different view. The insert queries are equal:

INSERT into transaction (timestamp,breadcrumbId,server,tenant,environment,flow_id,flow_name,name,value) VALUES ('2024-06-14T16:47:21','6EB60CCC00333B5-0000000000080CCD_insert_mysql8_escaped','https://next.dovetail.world','Regression Tests','test','659bd6d5d377b7000b000002','SQL','body','{"body":"abc\ndef"}')

The stored data in the column 'value' differs:

Image