php-cassandra-binary icon indicating copy to clipboard operation
php-cassandra-binary copied to clipboard

Warning: unpack(): Type l: not enough input

Open penfold45 opened this issue 9 years ago • 5 comments

Hi I just pulled the latest version of dev-master and I now get this error

Warning: unpack(): Type l: not enough input, need 4, have 0 in vendor/evseevnn/php-cassandra-binary/src/Protocol/Response/DataStream.php on line 77

When I run a pretty simple CQL query

SELECT * FROM basket WHERE global_id = :global_id AND tag = :tag ORDER BY id,hotel_id, room_id

I tried to debug it but got a bit lost in what is going on in there.

penfold45 avatar Oct 22 '14 11:10 penfold45

Thanks for opening the issue. Can you tell me what data types you have inserted and also what data was inserted so I can write a regression test and patch?

LarsFronius avatar Oct 22 '14 11:10 LarsFronius

Hi yeh there is no data at all. It is empty and the structure is

CREATE TABLE basket (                                                                                                                                                                                                                                          
                 id uuid,                                                                                                                                                                                                                                                      
                 tag text,                                                                                                                                                                                                                                                
                 global_id text,                                                                                                                                                                                                                                               
                 hotel_id int,                                                                                                                                                                                                                                                 
                 room_id int,                                                                                                                                                                                                                                                  
                 date_from text,                                                                                                                                                                                                                                               
                 date_to text,                                                                                                                                                                                                                                                 
                 adults int,                                                                                                                                                                                                                                                   
                 number_of_children int,                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                 PRIMARY KEY ( (tag, global_id), id, hotel_id, room_id, date_from, date_to)

penfold45 avatar Oct 22 '14 11:10 penfold45

It's true, that there are issues with empty fields. Check https://github.com/evseevnn/php-cassandra-binary/pull/33 as well. I'm gonna check for your case what is going on.

LarsFronius avatar Oct 23 '14 07:10 LarsFronius

I'm getting the same error, with a very simple query:

$data = $database->query('SELECT * FROM "client" WHERE "id" = :id', ['id' => 'a5b9491e-372d-49d9-943c-63d40dcb67f4']);

I am getting the data I need, but I get this warning:

Warning: unpack(): Type l: not enough input, need 4, have 1 in /var/www/cassa/vendor/evseevnn/php-cassandra-binary/src/Protocol/Response/DataStream.php on line 77

andreassolberg avatar Nov 19 '14 12:11 andreassolberg

I've found the cause of this issue. It is introduced in 6f1cae97b206dd8cc412553fb08ba568c725253b

Please revert this patch. Until then I have to rely on:

    "require": {
        "evseevnn/php-cassandra-binary": "dev-master#31fa28eb756e5d06470a1e4ae4698d44250231b8"
    }

andreassolberg avatar Nov 26 '14 21:11 andreassolberg