I'm getting the error below in /var/log/apache2/error.log when selecting data using cassandra-pdo on PHP:
[Mon Jan 14 23:37:47 2013] [error] [client 10.0.0.5] PHP Fatal error: Uncaught exception 'PDOException' with message 'CQLSTATE[08006] [8] No more data to read.' in /var/www/test_cassandra_pdo.php:13
Stack trace:
#0 /var/www/test_cassandra_pdo.php(13): PDOStatement->execute()
#1 {main}
thrown in /var/www/test_cassandra_pdo.php on line 13
I'm using:
- lastest cassandra-pdo (http://code.google.com/a/apache-extras.org/p/cassandra-pdo/)
- Apache/2.2.22
- PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 19:00:43)
- Cassandra 1.2
- Ubuntu 12.04 LTS
Below is my PHP code:
// Connect to two hosts
$dsn = "cassandra:host=cassandra001,port=9160;host=cassandra002,port=9160;cqlversion=3.0.0";
$db = new PDO($dsn);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("USE test");
$stmt = $db->prepare("SELECT page, local, key, vl FROM lalala;");
//$stmt->bindValue(':key', 'a');
$stmt->execute();
$result = $stmt->fetchAll();
var_dump($result);
Below is the data structure (created and listed with cqlsh):
Connected to test at cassandra001:9160.
[cqlsh 2.3.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0]
Use HELP for help.
cqlsh> use test;
cqlsh:test> describe table lalala;
CREATE TABLE lalala (
page text,
local text,
key text,
value text,
vl text,
PRIMARY KEY (page, local, key)
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
The select using cqlsh:
cqlsh:test> SELECT page, local, key, vl FROM lalala;
page | local | key | vl
------------+-------+-------+----------------
teste.html | EN | title | Ola, bem vindo
I opened a issue on cassandra-pdo but without any return:
http://code.google.com/a/apache-extras.org/p/cassandra-pdo/issues/detail?id=15
Anybody can help?