17 messages in com.mysql.lists.bugsRe: int unsigned subtraction problem
FromSent OnAttachments
gr...@acm.org24 Jan 2002 16:22 
Sinisa Milivojevic25 Jan 2002 02:49 
Michael Widenius25 Jan 2002 04:11 
Alexander Keremidarski25 Jan 2002 04:20 
Alexander Keremidarski25 Jan 2002 04:36 
Michael Widenius26 Jan 2002 07:37 
Michael Widenius26 Jan 2002 07:51 
Alexander Keremidarski28 Jan 2002 02:54 
Michael Widenius28 Jan 2002 18:12 
Colin Faber28 Jan 2002 19:05 
Alexander Keremidarski29 Jan 2002 04:14 
Michael Widenius29 Jan 2002 04:54 
Michael Widenius29 Jan 2002 17:53 
SDiZ (UHome)30 Jan 2002 00:43 
Alexander Keremidarski30 Jan 2002 04:36 
Michael Widenius31 Jan 2002 08:59 
Michael Widenius26 Feb 2002 02:07 
Subject:Re: int unsigned subtraction problem
From:Michael Widenius (mon@mysql.com)
Date:02/26/2002 02:07:34 AM
List:com.mysql.lists.bugs

Hi!

"Colin" == Colin Faber <cfa@fpsn.net> writes:

Colin> Monty, Colin> I understand that you want to provide as much functionality as possible,

This is not about functionality, but more about consistently. If you don't do things in a consistent manner you will run into a lot of problems you haven't thought about before.

Colin> But can you think of one case where the unsigned value of a negative Colin> number is relevant or useful out side of a custom written application Colin> which has nothing to do with a database result set?

I could probably come up with thousands of cases . Just look in the email archive of how many people had problems with the old behavior, which was not consistent!

In fact, the most important reason you have unsigned in the first place is that you want to have a bigger range of values. You get the bigger range by NOT supporting signed values!

Your question is also asked in the wrong form; There is noting called a negative value when you are talking about unsigned numbers!

Colin> I would think the quickest way to solve this problem is to add an option Colin> in the configuration or something which can be done with in the command Colin> line to notify mysql that the desired result set is cast to unsigned and Colin> negative numbers will be represented as the unsigned value rather than Colin> simply just returning it by default.

This would in the long run bring us even more problems than the one we already have. You should not change the rules of mathematics just because you don't like them!

Regards, Monty