>Description:
error with "order clause" without "where clause"
>How-To-Repeat:
We have an error when we count records.
You can find a database with this error.
with mysql, you type this command :
select * from t_titre_sup order by tit_code
<snip>
465 rows in set (0.08 sec)
select count(*) from t_titre_sup
+----------+
| count(*) |
+----------+
| 447 |
+----------+
1 row in set (0.00 sec)
There is a diffence about numbers of rows.
This is why some records are count two or three times and not order also.
>Fix:
I add a "true where clause" with same data from the "order clause".
select * from t_titre_sup where tit_code > -1 order by tit_code
447 rows in set (0.10 sec)
>Submitter-Id: <submitter ID>
>Originator: pjouguet@stripped
>Organization:
<organization of PR author (multiple lines)>
>MySQL support: [none]
>Synopsis: <synopsis of the problem (one line)>
>Severity: <[serious] (one line)>
>Priority: <[ high ] (one line)>
>Category: mysql
>Class: <[ sw-bug ] (one line)>
>Release: mysql-3.22.25 (RPM distribution)
>Server: /usr/bin/mysqladmin Ver 7.11 Distrib 3.22.25, for pc-linux-gnu on i686
TCX Datakonsult AB, by Monty
Server version 3.22.25
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 11 min 38 sec
Threads: 14 Questions: 3886 Slow queries: 0 Opens: 129 Flush tables: 1 Open tables:
63
>Environment:
<machine, os, target, libraries (multiple lines)>
System: Linux diamant.int.vdldiffusion.com 2.0.36 #10 Wed Jul 7 17:24:01 CEST 1999 i686
unknown
Architecture: i686
Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
gcc version 2.7.2.3
Compilation info: CC='egcs' CFLAGS='-O6 -fomit-frame-pointer -mpentium' CXX='egcs'
CXXFLAGS='-O6 -fomit-fram\
e-pointer -felide-constructors -fno-exceptions -fno-rtti -mpentium'
LDFLAGS=''
Configure command: ./configure --enable-shared --enable-assembler --disable-shared
--with-mysqld-ldflags=-all-\
static --with-client-ldflags=-all-static --with-mysqld-user=mysql
--with-unix-socket-path=/var/lib/mysql/mysql.\
sock --prefix=/ --exec-prefix=/usr --libexecdir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --localstatedi\
r=/var/lib/mysql --infodir=/usr/info --includedir=/usr/include --mandir=/usr/man
Perl: This is perl, version 5.004_04 built for i386-linux
--
Philippe
Email : philippe.jouguet@stripped
Attachment: [application/x-gzip] t_titre_sup.sql.gz