the 'integers' you insert as key are too big to fit in the size of a
integer.
mysql replaces such a big or small integer by the biggest or smallest value
possible.
if you look closely at your query, you see that the key returned by mysql
are not the same values as you inserted.
you have to: or change field type to contain bigger values, or insert
integers that fit within a integer field. for example you could use the
numeric type. setting integer(11) has no effect, numeric(11) has.


gl

rene

----- Original Message -----
From: "Filip Trojan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 11:53 AM
Subject: bug - multiple column primary key cannot correctly determine
duplicate entry


Dear MySQL experts

In the following example I created simple table with two-column primary key
ID,IDT. After some inserts there came insert with ID, IDT values, that are
not equal to none of the previous couples, but MySQL still reported error
"Duplicate entry". In the lines below there is source code that can by used
to reproduce the problem. This example was run under local environment of
Microsoft Windows 98 4.10.1998 on MySQL Ver 3.23.32 for Win95/Win98 on i32
with user privileges select, insert, update, delete, create, drop, alter and
index.
Please feel free to answer that this was my fault. I am just a beginner and
it would be the best result. Otherwise it would be serios bug.

Filip Trojan, Prague, Czech Republic


# MySQL dump 8.12
#
# Host: localhost    Database: tourservis
#--------------------------------------------------------
# Server version 3.23.32-log

#
# Table structure for table 'pobzajturnus'
#

CREATE TABLE pobzajturnus (
  ID int(11) NOT NULL default '0',
  IDT int(11) NOT NULL default '0',
  DZAP datetime NOT NULL default '0000-00-00 00:00:00',
  DAKT datetime NOT NULL default '0000-00-00 00:00:00',
  DZAC datetime NOT NULL default '0000-00-00 00:00:00',
  DKON datetime NOT NULL default '0000-00-00 00:00:00',
  POCMIST smallint(6) default NULL,
  POCVOLN smallint(6) default NULL,
  DOPRAVA varchar(40) default NULL,
  VEDOUCI int(11) default NULL,
  POZN blob,
  PRIMARY KEY (ID,IDT)
) TYPE=MyISAM;

#
# Dumping data for table 'pobzajturnus'
#

INSERT INTO pobzajturnus VALUES (-2147483648,1544414423,'2001-04-14
10:57:56','2001-04-14 10:57:56','2001-06-09 00:00:00','2001-06-16
00:00:00',NULL,NULL,'vlastní nebo autobusovou linkou (není za',0,'');
INSERT INTO pobzajturnus VALUES (-2147483648,44245749,'2001-04-14
10:57:56','2001-04-14 10:57:56','2001-06-16 00:00:00','2001-06-23
00:00:00',NULL,NULL,'vlastní nebo autobusovou linkou (není za',0,'');
INSERT INTO pobzajturnus VALUES (-2147483648,2147483647,'2001-04-14
10:57:56','2001-04-14 10:57:56','2001-06-23 00:00:00','2001-06-30
00:00:00',NULL,NULL,'vlastní nebo autobusovou linkou (není za',0,'');
INSERT INTO pobzajturnus VALUES (-2147483648,1338875697,'2001-04-14
10:57:56','2001-04-14 10:57:56','2001-06-30 00:00:00','2001-07-07
00:00:00',NULL,NULL,'vlastní nebo autobusovou linkou (není za',0,'');
INSERT INTO pobzajturnus VALUES (-2147483648,1969892214,'2001-04-14
10:57:56','2001-04-14 10:57:56','2001-07-07 00:00:00','2001-07-14
00:00:00',NULL,NULL,'vlastní nebo autobusovou linkou (není za',0,'');

insert into pobzajturnus set
 id=-2154422840,
 idt=4764690836,
 dzap=now(),
 dakt=now(),
 dzac='2001-07-14 00:00',
 dkon='2001-07-21 00:00',
 doprava='vlastní nebo autobusovou linkou (není zahrnuta v ceně)',
 vedouci='',
 pozn='';

ERROR 1062 at line 38: Duplicate entry '-2147483648-2147483647' for key 1




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to