﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23434	Incorrect parameter coercion for bool in Oracle backend	Josh Smeaton	Josh Smeaton	"The following code exists in backends.oracle.base.OracleParam:

{{{
        # Oracle doesn't recognize True and False correctly in Python 3.
        # The conversion done below works both in 2 and 3.
        if param is True:
            param = ""1""
        elif param is False:
            param = ""0""
}}}

I believe the conversion should be to the integers `1` and `0` respectively, rather than strings. This hasn't manifested as a problem before, but it is causing problems when using user defined boolean annotations in #14030. The string ""1"" is being returned rather than the integer 1 so the field converters aren't receiving the type they expect (integers) and do no conversions.

The alternative to changing the code above would be to change the field converter to check for `value in (""1"",""0"")` and then do the relevant bool(int()) conversion, but I think that's working around the actual problem.

Happy to put a patch together. I just wanted to get some buy in that this needs fixing first, and that the approach above should be valid. I'm not sure whether OracleParam can work with just strings or not."	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	oracle backend orm		Ready for checkin	1	0	0	0	0	0
