PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > ERROR 1062 (23000): Duplicate entry '1' for key 1 during SELECT
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ERROR 1062 (23000): Duplicate entry '1' for key 1 during SELECT

Réponse
 
LinkBack Outils de la discussion
Vieux 13/03/2008, 00h01   #1
mike@gn5.gistnet.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut ERROR 1062 (23000): Duplicate entry '1' for key 1 during SELECT

>Description:
When running the statements below, MySQL errors out with:
ERROR 1062 (23000) at line 5: Duplicate entry '1' for key 1 during SELECT

>How-To-Repeat:


drop table if exists t;

create table t (f int not null);

insert into t values (1),(1);

select 1 from
t straight_join
t as t2
left join t as t3 on 0=1
group by
t2.f
having
0=count(*)

>Fix:

Workarounds include removing "not null" from the table definition, using a
join instead of a straight_join, removing the left join, having no rows in
the left joined table (three different tables can be used; the bug doesn't
depend on aliases), grouping on t.f instead of t2.f, or changing
"0=count(*)" to "0=0".

>Submitter-Id: <submitter ID>
>Originator: Michael Thorpe
>Organization: GISTnet, Inc.
>MySQL support: none
>Synopsis: Duplicate key error during select
>Severity: non-critical
>Priority: low
>Category: mysql
>Class: sw-bug
>Release: mysql-5.0.37 (Source distribution)
>Server: /usr/bin/mysqladmin Ver 8.41 Distrib 5.0.37, for unknown-linux-gnu on x86_64

Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 5.0.37-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /usr/mysql/sock/mysql.sock
Uptime: 170 days 4 hours 18 min 34 sec

Threads: 12 Questions: 218282739 Slow queries: 379 Opens: 4014478 Flush tables: 1 Open tables: 64 Queries per second avg: 14.846
>C compiler: gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
>C++ compiler: g++ (GCC) 3.3.5 (Debian 1:3.3.5-13)
>Environment:


System: Linux gn5 2.6.14 #5 SMP Mon Mar 5 14:19:52 PST 2007 x86_64 GNU/Linux
Architecture: x86_64

Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/x86_64-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib x86_64-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' LDFLAGS='' ASFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 Feb 21 2007 /lib/libc.so.6 -> libc-2.3.2.so
-rwxr-xr-x 1 root root 1295328 Feb 17 2007 /lib/libc-2.3.2.so
-rw-r--r-- 1 root root 3861862 Feb 17 2007 /usr/lib/libc.a
-rwxr-xr-x 1 root root 206 Feb 17 2007 /usr/lib/libc.so
Configure command: ./configure '--prefix=/usr/mysql' '--with-unix-socket-path=/usr/mysql/sock/mysql.sock' '--with-mysqld-user=mysql' '--without-readline'

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h12.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08228 seconds with 9 queries