exclude option is not respected #78

quintonm opened this Issue Oct 12, 2013 · 0 comments


None yet
1 participant

quintonm commented Oct 12, 2013

Migrated from sourceforge: https://sourceforge.net/p/p6spy/bugs/17/

I noticed a bug concerning the "exclude" option.
In the file spy.properties it is said that "exclude" takes a "comma separated list of tables to exclude when filtering". After looking in the current source of the svn trunk I found out that
contains the statement
found = Pattern.matches(tables[i], sql);
The JDK-API for Pattern states that
public static boolean matches(String regex, CharSequence input)
takes a regexp as first arg but tables[i] is a tablename and no regexp. Therefore e.g. Pattern.matches("SOMETABLE", "SELECT * FROM SOMETABLE WHERE BLA") will not match and every sql call is passed into the p6spy log.
Simple fix:
found = sql.indexOf(tables[i]) >= 0;

typekpb added a commit that referenced this issue Nov 2, 2013

P6LogOptions: for exclude/include and sqlexpression we compile Patter…
…n eagerly => to improve performance; tests for these added; fixed #78

@typekpb typekpb closed this in #115 Nov 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment