Hey Guys, I found the mistake I made, basically I'm using a tool called Sentry to capture the exceptions. The value returned from the Python is 2^64-1, which is -1 from mysql_affected_rows. Sentry is using JSON format as the a kind of storage, apparently the MAX SAFE INTEGER <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obj...> is 2^53 -1. Sorry for the indeliberated report of this issue and thanks for all of you helps. On Sat, Jul 23, 2016 at 12:06 AM, Tian JiaLin <himurakenshin54@gmail.com> wrote:
Yes, you are right. Definitely "long" in Python can represent a number much bigger than the native.
But the range of returned value from mysql_affected_rows within 0 ~ 2^64-1. No matter how it's converted, the converted value in Python also should in the range of 0 ~ 2^64 - 1.
On Fri, Jul 22, 2016 at 11:50 PM, Eric Snow <ericsnowcurrently@gmail.com> wrote:
On Fri, Jul 22, 2016 at 3:02 AM, Stefan Ring <stefanrin@gmail.com> wrote:
So to sum this up, you claim that PyLong_FromUnsignedLongLong can somehow produce a number larger than the value range of a 64 bit number (0x10000000000000180). I have a hard time believing this.
Perhaps I misunderstood your meaning, but Python's integers (AKA "PyLong") can be bigger that a machine-native integer (e.g. 64 bits):
"All integers are implemented as “long” integer objects of *arbitrary size*." (emphasis mine)
(https://docs.python.org/3.5//c-api/long.html)
-eric
-- kenshin
http://kenbeit.com Just Follow Your Heart
-- kenshin http://kenbeit.com Just Follow Your Heart