Subject: | Scalar/string context in p |
Dear Mark,
I'm not sure is it a bug or maybe feature, this is what I discovered just today.
Suppose I create a query with parameters, where attributes are supposed to be just integers. Like
$some_qry = "MATCH (n) WHERE n.payload <= {my_val} RETURN id(n)";
I "compile" (or "prepare") it than, like
$qry_some = REST::Neo4p::Query->new( $some_qry );
and execute it:
$my_int = ...some int value... ;
$numrows = $qry_some->execute( my_val => $my_int );
What I discovered. As soon as $my_int <= 0 (my "some int value" is negative, like -1234) query works fine. But as soon as $my_in >= 0 (like 5678) I got an error, smth like "cannot compare n.payload (Long) with 5678 (String)".
Adding explicit type (context?) conversion, like:
$numrows = $qry_some->execute( my_val => int( $my_int ) );
helps, query works as expected. I'm just in doubt - either this is a feature out of my knowlege, or this is a bug with unwanted context switch to string while $my_int is actually integer?
What do you think on it?
Thanks in advance!
WBR,
Andrii