Skip to content

Commit b6bc0f3

Browse files
committed
Android fix pattern in extractColumnNames
1 parent bb30c5d commit b6bc0f3

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 5.2.5 (2023-09-28)
2+
3+
### Bug Fixes
4+
5+
- Fix Android pattern in extractColumnNames
6+
17
# 5.2.4 (2023-09-28)
28

39
### Bug Fixes
0 Bytes
Binary file not shown.

android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsSQLStatement.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ public static List<String> extractColumnNames(String whereClause) {
136136
Set<String> keywords = new HashSet<>(Arrays.asList("AND", "OR", "IN", "VALUES", "LIKE", "BETWEEN", "NOT"));
137137

138138
Pattern pattern = Pattern.compile(
139-
"\\b[a-zA-Z]\\w*\\b(?=\\s*(?:<=?|>=?|<>?|=|AND|OR|BETWEEN|NOT|IN|LIKE))|" +
139+
"\\b[a-zA-Z]\\w*\\b(?=\\s*(?:<=?|>=?|<>?|=|AND|OR|BETWEEN|NOT|IN|LIKE))|" +
140140
"\\b[a-zA-Z]\\w*\\b\\s+BETWEEN\\s+'[^']+'\\s+AND\\s+'[^']+'|" +
141-
"\\(([^)]+)\\)\\s+IN\\s+\\(VALUES"
141+
"\\(([^)]+)\\)\\s+IN\\s+\\(\\s*VALUES\\s*\\("
142142
);
143143
Matcher matcher = pattern.matcher(whereClause);
144144
List<String> columns = new ArrayList<>();

0 commit comments

Comments
 (0)