Hi!
>>>>> "MARK" == MARK CALLAGHAN <mdcallag@stripped> writes:
MARK> On Sun, Oct 18, 2009 at 2:16 PM, Michael Widenius <monty@stripped>
> wrote:
>>
>> Hi!
>>
>>>>>>> "MARK" == MARK CALLAGHAN <mdcallag@stripped> writes:
>>
>> <cut>
>>
>>>> Functions that only returns 0 or 1 should be bool or my_bool.
>>
MARK> I am being pedantic, but functions that return TRUE or FALSE can be
MARK> bool/my_bool. A lot of MySQL source uses 0/1 in place of FALSE/TRUE
MARK> for bool/my_bool which makes the code harder to read.
>>
MARK> I am not against using bool, I am against using it to return TRUE on
MARK> error. The libc model is for functions to return type int with 0 on
MARK> success and not 0 on error. I want the same to be done in MySQL.
MARK> Predicate functions (has_a(), is_a()) can return type bool.
>>
>> In MySQL we are using relatively consistently 1 for errors.
>> Changing it now, would not be practical.
MARK> I am fine with returning 1 or anything other than 0 on error. But '1'
MARK> is an integer, not bool. I don't want functions that return 0 for
MARK> success and 1 on error to return type bool.
Ok, I see your point. I am fine to addopt that new code for bool/my_bool
function should return TRUE or FALSE.
Regards,
Monty