Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

最後にマッチするのはこっちの方がイケてた!

  • Loading branch information...
commit d09901ef49de057de3411ad4fb58cfda4bee934c 1 parent 056a0b0
@ken39arg authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/MySQL/Sharding/Client.pm
View
9 lib/MySQL/Sharding/Client.pm
@@ -221,10 +221,9 @@ sub _parse_columns {
sub _parse_group {
my ($self, $sql) = @_;
- my $f = 0;
- $f = 1 while ($sql =~ m/GROUP +BY +([^\)]+?) *(HAVING|UNION|ORDER|LIMIT|$)[\)]*/gi);
-
- return undef unless $f;
+ unless ($sql =~ m/.*GROUP +BY +([^\)]+?) *(HAVING|UNION|ORDER|LIMIT|$)[\)]*/i) {
+ return undef;
+ }
my @group;
foreach my $column (split / *, */, $1) {
@@ -235,7 +234,7 @@ sub _parse_group {
sub _parse_order {
my ($self, $sql) = @_;
- unless ($sql =~ m/ORDER +BY +(.+?) *(LIMIT|$)/i) {
+ unless ($sql =~ m/.*ORDER +BY +(.+?) *(LIMIT|$)/i) {
return undef;
}
Please sign in to comment.
Something went wrong with that request. Please try again.