Cassandra异常错误-谁知道解决方案


Cassandra exception error - who do know solution?

我在开发中使用phpevseevnn/php-cassandra二进制。上一次我总是得到例外:

<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

NULL值和映射列存在问题。https://github.com/evseevnn/php-cassandra-binary/issues/27

我使用的开发分支https://github.com/eyeem/php-cassandra-binary/tree/develop并将DataStream.php替换为https://github.com/eyeem/php-cassandra-binary/blob/master/src/Protocol/Response/DataStream.php

之后一切都很好。

调用粘贴函数时,

看起来$this->columnCount设置不正确。