Skip to content

sqlify returns creates wrong Long representation #213

cjrolo opened this Issue Mar 7, 2013 · 0 comments

2 participants

cjrolo commented Mar 7, 2013

I have triggered this issue with some query's. My unsigned integers, big integers being converted to python Long. Then on insert or updates the query would fail because database would not accept the 1L, '234L, etc..

This patch will never cause problems, since even really long numbers would be converted nicely.

I created this patch to fix the issue:

+++ /usr/local/lib/python2.7/dist-packages/web/    2013-03-07 16:55:46.076738130 +0100
@@ -326,6 +326,8 @@
        return "'t'"
    elif obj is False:
        return "'f'"
+    elif isinstance(obj, long):
+       return str(obj)
    elif datetime and isinstance(obj, datetime.datetime):
        return repr(obj.isoformat())

Of course a better explanation of this issue and/or better solution would be helpfull.

@anandology anandology closed this in 2010d39 Mar 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.