Bug with field type double unsigned

Bug with field type double unsigned

am 05.01.2005 11:12:26 von Uzi Klein

Hi
thters seems to be an error with double unsigned fields :

mysql version 4.0.22
red hat linux 9


mysql> SHOW CREATE TABLE ContractPayments;
+------------------+---------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
----------------------------------------+
| Table | Create Table












|
+------------------+---------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
----------------------------------------+
| ContractPayments | CREATE TABLE `ContractPayments` (
`PaymentID` int(10) unsigned NOT NULL auto_increment,
`ContractID` int(10) unsigned NOT NULL default '0',
`FundRemains` double unsigned default NULL,
PRIMARY KEY (`PaymentID`),
KEY `ContractID` (`ContractID`)
) ENGINE=MyISAM DEFAULT |
+------------------+---------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
----------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT FundRemains FROM ContractPayments WHERE FundRemains<0;
+-------------+
| FundRemains |
+-------------+
| -1439.252 |
| -100529.06 |
| -0.847 |
| -0.855 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -1.695 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.847 |
| -0.855 |
| -0.847 |
| -0.847 |
| -12277.966 |
| -3205.128 |
+-------------+
38 rows in set (0.13 sec)

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Bug with field type double unsigned

am 06.01.2005 11:39:19 von Sergei Golubchik

Hi!

On Jan 05, Uzi Klein wrote:
> Hi
> thters seems to be an error with double unsigned fields :

Could you provide a repeatable test case ?
(that is, INSERT/UPDATE statements that would generate such a table)

I failed to repeat it with random data :(

By the way, the recommended place to report bugs is our bug-tracking
system at http://bugs.mysql.com, you will get automatic notification
when the bug is fixed, etc.

But of course bugs@lists.mysql.com is ok too

> mysql version 4.0.22
> red hat linux 9
>
> mysql> SHOW CREATE TABLE ContractPayments;
> +------------------+---------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ----------------------------------------------------------
------------------------------------------+
> | Table | Create Table
> +------------------+---------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ----------------------------------------------------------
------------------------------------------+
> | ContractPayments | CREATE TABLE `ContractPayments` (
> `PaymentID` int(10) unsigned NOT NULL auto_increment,
> `ContractID` int(10) unsigned NOT NULL default '0',
> `FundRemains` double unsigned default NULL,
> PRIMARY KEY (`PaymentID`),
> KEY `ContractID` (`ContractID`)
> ) ENGINE=MyISAM DEFAULT |
> +------------------+---------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ----------------------------------------------------------
------------------------------------------+
> 1 row in set (0.00 sec)
>
> mysql> SELECT FundRemains FROM ContractPayments WHERE FundRemains<0;
> +-------------+
> | FundRemains |
> +-------------+
> | -1439.252 |
> | -100529.06 |
> | -0.847 |
> +-------------+
> 38 rows in set (0.13 sec)
>
Regards,
Sergei

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Bug with field type double unsigned

am 06.01.2005 12:23:29 von Uzi Klein

Sergei Golubchik wrote:
> Hi!
>
> On Jan 05, Uzi Klein wrote:
>
>>Hi
>>thters seems to be an error with double unsigned fields :
>
>
> Could you provide a repeatable test case ?
> (that is, INSERT/UPDATE statements that would generate such a table)
>
> I failed to repeat it with random data :(

EXAMPLE :

mysql> SELECT VERSION();
+------------+
| VERSION() |
+------------+
| 4.0.22-log |
+------------+
1 row in set (0.00 sec)

mysql> use test;
Database changed
mysql> CREATE TABLE `TestDouble` (
-> `ID` int(10) unsigned NOT NULL auto_increment,
-> `DoubleField1` double default NULL,
-> `DoubleField2` double unsigned default NULL,
-> PRIMARY KEY (`ID`)
-> ) TYPE=MyISAM;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO TestDouble (DoubleField1) VALUES ('-12345.123');
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM TestDouble;
+----+--------------+--------------+
| ID | DoubleField1 | DoubleField2 |
+----+--------------+--------------+
| 1 | -12345.123 | NULL |
+----+--------------+--------------+
1 row in set (0.00 sec)

mysql> UPDATE TestDouble SET DoubleField2 = DoubleField1 WHERE ID = 1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> SELECT * FROM TestDouble;
+----+--------------+--------------+
| ID | DoubleField1 | DoubleField2 |
+----+--------------+--------------+
| 1 | -12345.123 | -12345.123 |
+----+--------------+--------------+
1 row in set (0.00 sec)



>
> By the way, the recommended place to report bugs is our bug-tracking
> system at http://bugs.mysql.com, you will get automatic notification
> when the bug is fixed, etc.
>

> But of course bugs@lists.mysql.com is ok too
>
>
>>mysql version 4.0.22
>>red hat linux 9
>>
>>mysql> SHOW CREATE TABLE ContractPayments;
>>+------------------+-------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
------------------------------------------+
>>| Table | Create Table
>>+------------------+-------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
------------------------------------------+
>>| ContractPayments | CREATE TABLE `ContractPayments` (
>> `PaymentID` int(10) unsigned NOT NULL auto_increment,
>> `ContractID` int(10) unsigned NOT NULL default '0',
>> `FundRemains` double unsigned default NULL,
>> PRIMARY KEY (`PaymentID`),
>> KEY `ContractID` (`ContractID`)
>> ) ENGINE=MyISAM DEFAULT |
>>+------------------+-------------------------------------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
------------------------------------------+
>>1 row in set (0.00 sec)
>>
>>mysql> SELECT FundRemains FROM ContractPayments WHERE FundRemains<0;
>>+-------------+
>>| FundRemains |
>>+-------------+
>>| -1439.252 |
>>| -100529.06 |
>>| -0.847 |
>>+-------------+
>>38 rows in set (0.13 sec)
>>
>
> Regards,
> Sergei
>

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org