ahmetb / orman

lightweight and minimalist ORM for Java/Android. works with SQLite & MySQL. (not actively maintained)
Other
249 stars 47 forks source link

String.format error due to SQL includes `%` #32

Closed ahmetb closed 13 years ago

ahmetb commented 13 years ago

(separating this from issue from #29 comment https://github.com/ahmetalpbalkan/orman/issues/29#issuecomment-2102818)

When we log executed SQL statements using Log.trace, it uses String.format(message, [params...]) method of Java API.

If the SQL itself has % characters somewhere (like in string literals or wildcard in LIKE clause) it throws java.util. MissingFormatArgumentException. In this case `%'% causes it.

Assigning to myself. (@almozavr reported this bug)