我在我的开发中使用php evseevnn / php-cassandra-binary 。上次我总是异常:
<h4>A PHP Error was encountered</h4>
<p>Severity: User Notice</p>
<p>Message: Reading while at end of stream</p>
<p>Filename: Response/Rows.php</p>
<p>Line Number: 65</p>
我在第65行看到了ar文件 Response / Rows.php 。 有这里:
public function current() {
if (!isset($this->rows[$this->current])) {
throw new \OutOfRangeException('Invalid index');
}
$row = $this->rows[$this->current];
for ($i = 0; $i < $this->columnCount; ++$i) {
try {
$data = new DataStream($this->rows[$this->current][$this->columns[$i]['name']]);
$row[$this->columns[$i]['name']] = $data->readByType($this->columns[$i]['type']);
} catch (\Exception $e) {
trigger_error($e->getMessage()); // Line 65
$row[$this->columns[$i]['name']] = null;
}
}
return $row;
}
你能帮我解决一下这个错误并理解它为什么会发生吗?也许在Github向开发人员写一个问题? https://github.com/evseevnn/php-cassandra-binary
答案 0 :(得分:2)
NULL值和地图列存在问题。 https://github.com/evseevnn/php-cassandra-binary/issues/27
我使用了https://github.com/eyeem/php-cassandra-binary/tree/develop的开发分支,并用https://github.com/eyeem/php-cassandra-binary/blob/master/src/Protocol/Response/DataStream.php替换了DataStream.php
之后一切正常。
答案 1 :(得分:1)
看起来像$ this-&gt; columnCount设置不正确。