Skip to content

[BUG] Expression function replace SQL is not correct position #66

Closed
@ldcuong

Description

@ldcuong

I using below version:

  1. mybatis-thymeleaf v 1.0.2
  2. thymeleaf 3.0.11
  3. springboot 2.3.0
  4. mybatis 3.5.5
  5. Java 11

When using Expression Function in mybatis thymeleaf.

Example:
SELECT * FROM area WHERE NAME LIKE 'Tara%' /*[(${#likes.escapeClause()})]*/ ORDER BY ID

Output result:
SELECT * FROM area WHERE NAME LIKE 'Tara%' escape '\'

Expected result:
SELECT * FROM area WHERE NAME LIKE 'Tara%' escape '\' ORDER BY ID

ORDER BY ID will be removed, it will be replace all character before comma in same line make sql incorrect.

If we format SQL by line -> SQL will be correct.

Example:

SELECT * FROM area 
WHERE 
	NAME LIKE 'Tara%' /*[(${#likes.escapeClause()})]*/ 
ORDER BY ID

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions