Skip Menu |

This queue is for tickets about the DBD-Cassandra CPAN distribution.

Report information
The Basics
Id: 121245
Status: resolved
Priority: 0/
Queue: DBD-Cassandra

People
Owner: TVDW [...] cpan.org
Requestors: vasek.balcar [...] spolecne.cz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.01
  • 0.02
  • 0.03
  • 0.04
  • 0.05
  • 0.06
  • 0.07
  • 0.08
  • 0.09
  • 0.10
  • 0.11
  • 0.12
  • 0.13
  • 0.14
  • 0.15
  • 0.16
  • 0.17
  • 0.18
  • 0.19
  • 0.20
  • 0.21
  • 0.22
  • 0.23
  • 0.24
  • 0.25
  • 0.51
  • 0.52
  • 0.53
  • 0.54
  • 0.55
Fixed in: (no value)



Subject: sth->bind_param broken
assigning parameters via bind_param doesn't work. The STR script (attached) produces DBD::Cassandra::st execute failed: Error 8704: there were 1 markers(?) in CQL but 0 bound variables at /vagrant/pswitchshare/bind_param_cassandra.pl line 11. the problem/fix may appear here: --- /usr/share/perl5/vendor_perl/DBD/Cassandra/st.pm.orig 2017-04-13 00:52:47.466845955 +0000 +++ /usr/share/perl5/vendor_perl/DBD/Cassandra/st.pm 2017-04-13 00:53:11.097029807 +0000 @@ -8,7 +8,7 @@ sub bind_param { my ($sth, $pNum, $val, $attr)= @_; - my $params= $sth->{cass_params}; + my $params= $sth->{cass_params} //= []; $params->[$pNum-1] = $val; 1; }
Subject: bind_param_cassandra.pl
#!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect("DBI:Cassandra:keyspace=system;host=cassandra", 'cassandra', 'cassandra', {RaiseError => 1}); my $sth = $dbh->prepare("select * from hints WHERE target_id = ?"); $sth->bind_param(1 => 'someuuid'); $sth->execute(); $dbh->disconnect();
Ha, fun bugs. Looks like this appeared when I split DBD::Cassandra and Cassandra::Client with the release of DBD::Cassandra 0.51 Easy patch indeed. Also included a unit test so it doesn't happen again. https://github.com/TvdW/perl-DBD-Cassandra/commit/0421f1ffd0101d8d42482644552cc62d2c10f24e Will ship a release right away. Thanks!