silviucpp/erlcass

Segmentation fault

Closed this issue · 3 comments

erlcass v2.8
OTP 19.3

CREATE TABLE channel.test (
    id text, 
    name text,
    PRIMARY KEY (id)
);
erlcass:add_prepare_statement(test, "SELECT * FROM channel.test WHERE id=?").
erlcass:execute(test, [<<"test">>, <<"test">>]).

After executed query, we get - Segmentation fault

Thanks for reporting.
I will test to fix the problem . but looking on it seems also a problem with the way you are using prepared statements:

You have only one parameter id = ? but you send two arguments.

Correct is :

erlcass:execute(test, [<<"test">>]).

Fixed in last master. Instead crashing will return {error,badarg}

Thanks. master works correctly!