I assume if there is a match, the above code should return 1, and if there is no match, it should return 0.
Upon testing, I realize the return value is not reliable at all. Most of the time it returns 0 even though there is a match, so I wonder whether it only returns 1 if the update to service_type property actually changes the value. But then I noticed that in the cases it returns 1, there is a match but there is no change to the service_type property. In summary, neither 1 nor 0 means what I thought it is.
We are running a bunch of updating statements like this:
The
query
variable isand an example of the
params
variable isI assume if there is a match, the above code should return 1, and if there is no match, it should return 0.
Upon testing, I realize the return value is not reliable at all. Most of the time it returns 0 even though there is a match, so I wonder whether it only returns 1 if the update to
service_type
property actually changes the value. But then I noticed that in the cases it returns 1, there is a match but there is no change to theservice_type
property. In summary, neither 1 nor 0 means what I thought it is.Can someone help explain?