X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FFixtures.pm;h=c0df026781a4ffa5ad9fe41694a503a8c0aae672;hb=b788f241aa3e3efecbace8e40151ae2c204eb468;hp=eb6ca438efa2505d22f403ca2fae772f7107deeb;hpb=deba97cc4ec71e943119f7cdd3e0d777b60ffffc;p=dbsrgits%2FDBIx-Class-Fixtures.git diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index eb6ca43..c0df026 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -1403,13 +1403,11 @@ sub populate { $rs->result_source->storage->dbh_do(sub { my ($storage, $dbh, @cols) = @_; $self->msg( - my $sql = "SELECT setval('${sequence}', (SELECT max(" - .$dbh->quote_identifier($column) - .") FROM " - .$dbh->quote_identifier(${table}) - ."));" - ); + my $sql = sprintf("SELECT setval(?, (SELECT max(%s) FROM %s));",$dbh->quote_identifier($column),$dbh->quote_identifier($table)) + ); my $sth = $dbh->prepare($sql); + $sth->bind_param(1,$sequence); + my $rv = $sth->execute or die $sth->errstr; $self->msg("- $sql"); });