Closed andreyvk closed 5 years ago
I see. Thing is that it doesnt seem to happen always, although I need to test that thoroughly now. Btw, we're using a lot of double
values and those dont seem to have any issues at all. Do you know why?
Hi @Ostico. Found the source of my issue: there was no schema defined for those particular attributes. Hence the problem. Thanks!
Was too quick to comment. I was looking at the wrong schema file. Still searching
Sorry
Hi @andreyvk
there is the piece of code that consume numbers in the driver with CSV serialization: https://github.com/Ostico/PhpOrient/blob/master/src/PhpOrient/Protocols/Binary/Serialization/CSV.php#L259
as you can see in php running on 64bit int and floats are treated as numbers, in 32bit they are treated as strings.
In serialization instead, if the driver find int and float, the driver use them as they are:
That's interesting. Why does it happen only to integers then? I actually tend to think that orient itself should be (just like MySQL, for instance) accept numbers in string format too.
I might just write to the Orient guys and as that question.
Hi @Ostico,
Im having problems with unmarshalling integer fields. I've seen this several times already happening on different record fields so I've decided to create this issue.
Here's what i have on DB side:
It says
integer
. However when I pull the same record with the library and then do a PHP print out like this:I get a
string
as a result. The real problem, of course, comes when I try to save the record back. Orient would throw me an exception:Thing is that it seems to happen occasionally, which is a disturbing... I will do more tests and update you as I go unless you have an idea why this is happening. Thanks in advance!