List:General Discussion« Previous MessageNext Message »
From:BAUMEISTER Alexandre Date:April 25 2001 10:04am
Subject:Primary key not unique on Innodb tables.
View as plain text  
Bonjour,

  Mysql-3.23.37 on Solaris 2.8.

  I created this table :

CREATE TABLE livequote_last_PAR (
  symbole char(20) NOT NULL default '',
  id int(10) unsigned NOT NULL default '0',
  date datetime NOT NULL default '0000-00-00 00:00:00',
  last double(17,5) NOT NULL default '0.00000',
  volume int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (symbole,id),
  KEY idx_id (id)
) TYPE=Innobase;

  As you can see, (symbole,id) is the primary key.

  But :

mysql> select * from livequote_last_PAR where symbole='1rPFTE' order by id desc;
+---------+-------+---------------------+----------+--------+
| symbole | id    | date                | last     | volume |
+---------+-------+---------------------+----------+--------+
| 1rPFTE  | 33121 | 2001-04-25 11:59:39 | 78.70000 |    492 |
| 1rPFTE  | 33121 | 2001-04-25 11:59:39 | 78.70000 |    492 |
| 1rPFTE  | 33120 | 2001-04-25 11:59:39 | 78.70000 |   1290 |
| 1rPFTE  | 33120 | 2001-04-25 11:59:39 | 78.70000 |   1290 |
| 1rPFTE  | 33119 | 2001-04-25 11:59:29 | 78.70000 |     10 |
| 1rPFTE  | 33118 | 2001-04-25 11:59:04 | 78.70000 |    106 |
| 1rPFTE  | 33117 | 2001-04-25 11:58:49 | 78.70000 |     50 |
| 1rPFTE  | 33116 | 2001-04-25 11:57:57 | 78.70000 |     76 |
| 1rPFTE  | 33115 | 2001-04-25 11:57:33 | 78.60000 |     99 |
| 1rPFTE  | 33114 | 2001-04-25 11:56:44 | 78.70000 |   1768 |
| 1rPFTE  | 33113 | 2001-04-25 11:56:44 | 78.70000 |    118 |
| 1rPFTE  | 33112 | 2001-04-25 11:56:04 | 78.70000 |   1000 |
+---------+-------+---------------------+----------+--------+
12 rows in set (0.00 sec)

  I've  not  yet  deeply  explored what the problem is, but there is a
  problem.

  I  will  have to ckech exactly what queries my programs are doing in
  order to have this result, but there is a problem in mysql or innodb
  anyway I think.

  Regards,
  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