List:General Discussion« Previous MessageNext Message »
From:BAUMEISTER Alexandre Date:April 25 2001 12:02pm
Subject:Re[2]: Primary key not unique on Innodb tables.
View as plain text  
Heikki,

HT> check by other queries whether it is the table which contains a
HT> duplicate row, or if the SELECT gives a wrong answer.

HT> Check what 

HT> SELECT * FROM ... WHERE symbole='1rPFTE';

HT> returns.

  Really strange :

mysql> select * from livequote_last_PAR where symbole='1rPFTE' order by id desc;
+---------+-------+---------------------+----------+--------+
| symbole | id    | date                | last     | volume |
+---------+-------+---------------------+----------+--------+
| 1rPFTE  | 33548 | 2001-04-25 13:54:43 | 78.55000 |     37 |
| 1rPFTE  | 33547 | 2001-04-25 13:54:30 | 78.55000 |     40 |
| 1rPFTE  | 33546 | 2001-04-25 13:54:19 | 78.55000 |    300 |
| 1rPFTE  | 33545 | 2001-04-25 13:54:09 | 78.55000 |     61 |
| 1rPFTE  | 33544 | 2001-04-25 13:54:09 | 78.55000 |      9 |
| 1rPFTE  | 33543 | 2001-04-25 13:53:37 | 78.55000 |    968 |
| 1rPFTE  | 33542 | 2001-04-25 13:53:37 | 78.60000 |    482 |
| 1rPFTE  | 33541 | 2001-04-25 13:53:37 | 78.65000 |    950 |
| 1rPFTE  | 33540 | 2001-04-25 13:53:30 | 78.70000 |    152 |
| 1rPFTE  | 33539 | 2001-04-25 13:53:06 | 78.65000 |   1700 |
+---------+-------+---------------------+----------+--------+
10 rows in set (0.00 sec)

  Then I see in the logs of my prog that it does :

UPDATE livequote_last_PAR SET date=concat(CURDATE(), '
13:58:17'),last=78.550000,volume=20,id=33549 WHERE symbole='1rPFTE' AND id=33539

  And then

mysql> select * from livequote_last_PAR where symbole='1rPFTE';
+---------+-------+---------------------+----------+--------+
| symbole | id    | date                | last     | volume |
+---------+-------+---------------------+----------+--------+
| 1rPFTE  | 33549 | 2001-04-25 13:58:17 | 78.55000 |     20 |
| 1rPFTE  | 33540 | 2001-04-25 13:53:30 | 78.70000 |    152 |
| 1rPFTE  | 33541 | 2001-04-25 13:53:37 | 78.65000 |    950 |
| 1rPFTE  | 33542 | 2001-04-25 13:53:37 | 78.60000 |    482 |
| 1rPFTE  | 33543 | 2001-04-25 13:53:37 | 78.55000 |    968 |
| 1rPFTE  | 33544 | 2001-04-25 13:54:09 | 78.55000 |      9 |
| 1rPFTE  | 33545 | 2001-04-25 13:54:09 | 78.55000 |     61 |
| 1rPFTE  | 33546 | 2001-04-25 13:54:19 | 78.55000 |    300 |
| 1rPFTE  | 33547 | 2001-04-25 13:54:30 | 78.55000 |     40 |
| 1rPFTE  | 33548 | 2001-04-25 13:54:43 | 78.55000 |     37 |
| 1rPFTE  | 33549 | 2001-04-25 13:58:17 | 78.55000 |     20 |
+---------+-------+---------------------+----------+--------+
11 rows in set (0.00 sec)

mysql> select * from livequote_last_PAR where symbole='1rPFTE' order by id desc;
+---------+-------+---------------------+----------+--------+
| symbole | id    | date                | last     | volume |
+---------+-------+---------------------+----------+--------+
| 1rPFTE  | 33549 | 2001-04-25 13:58:17 | 78.55000 |     20 |
| 1rPFTE  | 33549 | 2001-04-25 13:58:17 | 78.55000 |     20 |
| 1rPFTE  | 33548 | 2001-04-25 13:54:43 | 78.55000 |     37 |
| 1rPFTE  | 33547 | 2001-04-25 13:54:30 | 78.55000 |     40 |
| 1rPFTE  | 33546 | 2001-04-25 13:54:19 | 78.55000 |    300 |
| 1rPFTE  | 33545 | 2001-04-25 13:54:09 | 78.55000 |     61 |
| 1rPFTE  | 33544 | 2001-04-25 13:54:09 | 78.55000 |      9 |
| 1rPFTE  | 33543 | 2001-04-25 13:53:37 | 78.55000 |    968 |
| 1rPFTE  | 33542 | 2001-04-25 13:53:37 | 78.60000 |    482 |
| 1rPFTE  | 33541 | 2001-04-25 13:53:37 | 78.65000 |    950 |
| 1rPFTE  | 33540 | 2001-04-25 13:53:30 | 78.70000 |    152 |
+---------+-------+---------------------+----------+--------+
11 rows in set (0.01 sec)

  After other updates, the duplicated line disappears :

mysql> select * from livequote_last_PAR where symbole='1rPFTE' order by id desc;
+---------+-------+---------------------+----------+--------+
| symbole | id    | date                | last     | volume |
+---------+-------+---------------------+----------+--------+
| 1rPFTE  | 33551 | 2001-04-25 14:00:46 | 78.60000 |      4 |
| 1rPFTE  | 33550 | 2001-04-25 14:00:45 | 78.60000 |   2000 |
| 1rPFTE  | 33549 | 2001-04-25 13:58:17 | 78.55000 |     20 |
| 1rPFTE  | 33548 | 2001-04-25 13:54:43 | 78.55000 |     37 |
| 1rPFTE  | 33547 | 2001-04-25 13:54:30 | 78.55000 |     40 |
| 1rPFTE  | 33546 | 2001-04-25 13:54:19 | 78.55000 |    300 |
| 1rPFTE  | 33545 | 2001-04-25 13:54:09 | 78.55000 |     61 |
| 1rPFTE  | 33544 | 2001-04-25 13:54:09 | 78.55000 |      9 |
| 1rPFTE  | 33543 | 2001-04-25 13:53:37 | 78.55000 |    968 |
| 1rPFTE  | 33542 | 2001-04-25 13:53:37 | 78.60000 |    482 |
+---------+-------+---------------------+----------+--------+
10 rows in set (0.00 sec)

  I  didn't  noticed  this  problem  with Mysql-3.23.36. I will try to
  downgrade to 3.23.36 in order to see if I have the problem.

  Alex.


Thread
Innobase name changes to InnoDB in 3.23.37, have to changemy.cnfHeikki Tuuri13 Apr
  • Primary key not unique on Innodb tables.BAUMEISTER Alexandre25 Apr
Re: Primary key not unique on Innodb tables.Heikki Tuuri25 Apr
  • Re[2]: Primary key not unique on Innodb tables.BAUMEISTER Alexandre25 Apr
  • Re[2]: Primary key not unique on Innodb tables.BAUMEISTER Alexandre25 Apr
  • Re[2]: Primary key not unique on Innodb tables.BAUMEISTER Alexandre25 Apr