mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-14 06:45:21 +00:00
#1113 - SqlUpdate with leading spaces leads to Invalid event detection (which table was update for L2 cache invalidation etc)
This commit is contained in:
1 parent
9b621d2ec7
commit
58eb49617b
5 files changed
+29
-18
No files matched your search
@@ -128,13 +128,11 @@ public class ExeUpdateSql {
|
||||
|
||||
private void parseUpdate(String sql, PersistRequestUpdateSql request) {
|
||||
|
||||
int start = leadingTrim(sql);
|
||||
|
||||
int[] pos = new int[3];
|
||||
int spaceCount = 0;
|
||||
|
||||
int len = sql.length();
|
||||
for (int i = start; i < len; i++) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
char c = sql.charAt(i);
|
||||
if (Character.isWhitespace(c)) {
|
||||
pos[spaceCount] = i;
|
||||
@@ -158,13 +156,4 @@ public class ExeUpdateSql {
|
||||
determineType(firstWord, secWord, thirdWord, request);
|
||||
}
|
||||
|
||||
private int leadingTrim(String s) {
|
||||
int len = s.length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (!Character.isWhitespace(s.charAt(i))) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user