[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    mysql: MySQL: problem with negative integers, Digital Unix
From:       Niels Kokholm <kokholm () math ! ku ! dk>
Date:       1998-03-31 10:37:02
[Download RAW message or body]

>Submitter-Id:	kokholm@math.ku.dk
>Originator:	
>Organization:
     Niels Jørgen Kokholm          | email:   kokholm@math.ku.dk
     Matematisk Institut           | phone:   +45 3532 0759/+45 2128 6932
     Universitetsparken 5          | fax:     +45 3532 0704
     DK-2100 København Ø, Denmark  | www:     http://www.math.ku.dk/~kokholm
>
>MySQL support: 
none
>Synopsis:	
problem with negative integers, Digital Unix
>Severity:	
serious
>Priority:	
high 
>Category:	
mysql
>Class:	
sw-bug
>Release:	mysql-3.21.26-gamma (TCX binary)
>Environment:
	
System: OSF1 jessen V4.0 564 alpha
Architecture: alpha
Machine: alpha
Some paths:  /usr/local/bin/perl /bin/make /bin/cc
Perl: This is perl, version 5.004

>Description:
	Under some circumstances integer comparison with negative
        integers in the where clause gives a wrong empty result.

	
>How-To-Repeat:
	The following how-to is based on the test-insert benchmark:
 %bin/mysql test
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 2 to server version: 3.21.26-gamma-log

 Type 'help' for help.

 mysql> drop table a;
 Query OK, 0 rows affected (0.02 sec)
 
 mysql> create table a (id int NOT NULL,primary key (id));
 Query OK, 0 rows affected (0.00 sec)
 
 mysql> insert into a (id) values (0);
 Query OK, 1 row affected (0.03 sec)

 mysql> insert into a (id) values (1);
 Query OK, 1 row affected (0.00 sec)

 mysql> insert into a (id) values (2);
 Query OK, 1 row affected (0.00 sec)

 mysql> insert into a (id) values (3);
 Query OK, 1 row affected (0.02 sec)

 mysql> insert into a (id) values (4);
 Query OK, 1 row affected (0.00 sec)

 mysql> insert into a (id) values (5);
 Query OK, 1 row affected (0.00 sec)

 mysql> insert into a (id) values (6);
 Query OK, 1 row affected (0.00 sec)

 mysql> select * from a;
 +----+
 | id |
 +----+
 |  0 |
 |  1 |
 |  2 |
 |  3 |
 |  4 |
 |  5 |
 |  6 |
 +----+
 7 rows in set (0.00 sec)

 mysql> select * from a where id>0;
 +----+
 | id |
 +----+
 |  1 |
 |  2 |
 |  3 |
 |  4 |
 |  5 |
 |  6 |
 +----+
 6 rows in set (0.02 sec)

 mysql> select * from a where id>-1;
 +----+
 | id |
 +----+
 |  0 |
 |  1 |
 |  2 |
 |  3 |
 |  4 |
 |  5 |
 |  6 |
 +----+
 7 rows in set (0.02 sec)

 mysql> insert into a (id) values (7);
 Query OK, 1 row affected (0.00 sec)

 mysql> select * from a;
 +----+
 | id |
 +----+
 |  0 |
 |  1 |
 |  2 |
 |  3 |
 |  4 |
 |  5 |
 |  6 |
 |  7 |
 +----+
 8 rows in set (0.00 sec)

 mysql> select * from a where id>0;
 +----+
 | id |
 +----+
 |  1 |
 |  2 |
 |  3 |
 |  4 |
 |  5 |
 |  6 |
 |  7 |
 +----+
 7 rows in set (0.00 sec)

 mysql> select * from a where id>-1;
 Empty set (0.00 sec)

 mysql> 



>Fix:
	

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic