Daniel Diniz wrote:
> Daniel Diniz <ajaksu@gmail.com> added the comment:
>
> As suggested by Stefan Seefeld, this patch handles the overflow on the DB layer.
>
> --- a/roundup-src/roundup/backends/rdbms_common.py Tue May 26 15:50:15 2009 -0300
> +++ b/roundup-src/roundup/backends/rdbms_common.py Wed Jun 03 10:24:15 2009 -0300
> @@ -1110,6 +1110,8 @@
> # Return 1, not True, to match the type of the result of
> # the SQL operation below.
> return 1
> + if int(nodeid) > 2**30: # Avoid Postgres error
> + return 0
Yes, I think this is much better. However, I'm still concerned about two
things:
1) You put postgresql-specific code into rdbms_common.py
2) It seems there may be other cases where we don't properly check for
type / value incompatibilities between Python and SQL backends.
I'm not sure what to suggest, as I don't know the domain well enough.
But I wonder: might it be a good idea to have back_postgresql do more
work, such as provide its own 'sql()' function, where it could either
validate the arguments, or catch backend-specific errors and translate
them into Roundup exceptions ?
Thanks,
Stefan
--
...ich hab' noch einen Koffer in Berlin...
|