为什么MySQL有这个奇怪的重复错误提示?

时间:2014-08-09 16:26:47

标签: mysql sql primary-key

我在当前工作的公司的服务器错误中检查此错误。

MySQL返回下一条消息...... - >

  

ERROR 1062(23000):重复录入' 439.9618-7403.4014-2014-08-09 10:36:27'关键' PRIMARY'

但是,在搜索表格时,该值并不存在。我将附加mysql的结果表,命令以及表的创建方式。欢迎任何帮助,谢谢。

--------+----------+----------+---------------------+----------+------+-----------+------+ <br>
| fixset | gpstime  | gpsutime | servertime          | lat      | hem1 | lon       | hem2 |<br>
+--------+----------+----------+---------------------+----------+------+-----------+------+
|    321 | 15:32:01 |        0 | 2014-08-09 10:33:42 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:33:53 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:34:05 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:34:17 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:34:29 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:34:40 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:34:52 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:35:04 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:35:15 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:35:27 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:35:39 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:35:51 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:36:03 | 439.9618 | N    | 7403.4014 | W    |
|    321 | 15:32:01 |        0 | 2014-08-09 10:36:15 | 439.9618 | N    | 7403.4014 | W    |
+--------+----------+----------+---------------------+----------+------+-----------+------+

创建表:

create table gps_point (
    fixset int(10) unsigned not null,
    gpstime time,
    gpsutime mediumint(6) unsigned,
    servertime timestamp not null default current_timestamp;
    lat float(8,4),
    hem1 char(2),
    lon float(9,4),
    hem2 char(2),
    primary key (lat, lon, servertime),
    foreign key (fixset) references gps_fixset(fixset)
);

我在控制台上做了同样的事情,我得到了同样的错误......

mysql> INSERT INTO gps_point (fixset,gpstime,gpsutime,servertime,lat,hem1,lon,hem2) VALUES ('000000321','15:32:01','','2014-08-09 10:36:27','0439.9618','N','07403.4012','W');
ERROR 1062 (23000): Duplicate entry '439.9618-7403.4014-2014-08-09 10:36:27' for key 'PRIMARY'<br>

0 个答案:

没有答案