mysql underflow
Sebastian Mendel
lists at sebastianmendel.de
Don Dez 14 18:34:01 CET 2006
ilja schrieb:
> Hallo,
>
> Ist es jemandem von euch auch schon aufgefallen, dass in mysql 4 ein
> `spalte` = `spalte` - 1 bei einer UNSIGNED spalte bei 0 aufhört, bei
> mysql >= 5 jedoch die zahl umklappt und er plotzlich die größtmögliche
> Zahl drin stehen hat?
bei mir nicht:
CREATE TABLE `table` (
`a` INT UNSIGNED NOT NULL DEFAULT '0'
) ENGINE = MYISAM ;
INSERT INTO `table` SET `a` = 0;
INSERT INTO `table` SET `a` = -1;
#1264 - Out of range value for column 'a' at row 1
UPDATE `table` SET `a` = `a` - 1;
#1264 - Out of range value for column 'a' at row 1
das hängt vom eingestellten 'Standard' ab.
psst: das weiß der Andreas aber nicht - weil PostgreSQL sowas nicht kann
... ;-)
--
Sebastian Mendel
www.sebastianmendel.de
--
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->> http://www.4t2.com/mysql