Fix and test read-only handling in QueryIterator.

This commit is contained in:
Daniel Nichter
2013-03-11 14:28:39 -06:00
parent 2463344060
commit f00d53adc3
4 changed files with 47 additions and 88 deletions

View File

@@ -215,7 +215,7 @@ sub next {
}
if ( $self->read_only ) {
if ( $event->{arg} !~ m/(?:^SELECT|(?:\*\/\s*SELECT))/i ) {
if ( $event->{arg} !~ m{^(?:/\*[^!].*?\*/)?\s*(?:SELECT|SET)}i ) {
PTDEBUG && _d('Skipping non-SELECT query');
$self->stats->{not_select}++;
next EVENT;