Skip to content

Commit

Permalink
Precalc nparams in mysql storage
Browse files Browse the repository at this point in the history
  • Loading branch information
tsee committed May 11, 2012
1 parent 1da93a2 commit dbe8812
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,8 @@ Revision history for Perl extension Foo.

{{$NEXT}}

- Minor MySQL storage fixup

0.10 2012-05-08 09:43:54 Europe/Berlin

- MySQL storage: more documentation and minor
Expand Down
2 changes: 1 addition & 1 deletion dist.ini
@@ -1,5 +1,5 @@
name = ShardedKV
version = 0.10
version = 0.11
author = Steffen Mueller <smueller@cpan.org>
author = Nick Perez <nperez@cpan.org>
license = Perl_5
Expand Down
5 changes: 5 additions & 0 deletions lib/ShardedKV/Storage/MySQL.pm
Expand Up @@ -217,11 +217,16 @@ has '_number_of_params' => (
builder => '_calc_no_params',
);

sub BUILD {
$_[0]->_number_of_params;
};

sub _calc_no_params {
my $self = shift;
return 1 + scalar(@{$self->value_col_names});
}


sub _make_get_query {
my $self = shift;
$self->_number_of_params; # prepopulate
Expand Down

0 comments on commit dbe8812

Please sign in to comment.