mirror of
https://github.com/moparisthebest/JdbcMapper
synced 2024-12-22 07:18:51 -05:00
Allow parens directly before and after FROM
This commit is contained in:
parent
3a51d6ee56
commit
1e4a1c2371
@ -10,7 +10,7 @@ public class SimpleSQLParser extends AbstractSQLParser {
|
||||
|
||||
private static final Pattern aliasPattern = Pattern.compile("^.*\\.");
|
||||
private static final Pattern parenPattern = Pattern.compile("\\([^)]+\\)");
|
||||
private static final Pattern fromPattern = Pattern.compile("\\s+FROM\\s+");
|
||||
private static final Pattern fromPattern = Pattern.compile("[\\s)]+FROM[\\s(]+");
|
||||
|
||||
public SimpleSQLParser() {
|
||||
super(null, false);
|
||||
|
@ -37,6 +37,11 @@ public class SimpleSQLParserTest {
|
||||
assertTrue(ret.isSelect());
|
||||
assertArrayEquals(new String[]{null, "SOMETHING_FROM_BOB"}, ret.columnNames());
|
||||
}
|
||||
{
|
||||
final SQLParser ret = getFactory().parse("select something_from_bob from( tom)");
|
||||
assertTrue(ret.isSelect());
|
||||
assertArrayEquals(new String[]{null, "SOMETHING_FROM_BOB"}, ret.columnNames());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user