Description:
when you execute the query :
SELECT col_name1, 0, col_name2 FROM table
you expect to get :
+----------------+---+----------------+
| col_name1 | 0 | col_name2 |
+----------------+---+----------------+
| value 1 | 0 | value 2 |
| value 3 | 0 | value 4 |
| ... | 0 | ... |
+----------------+---+----------------+
but you have the 1st row replaced by the number 0 instead :
+----------------+---+----------------+
| col_name1 | 0 | col_name2 |
+----------------+---+----------------+
| 0 | 0 | value 2 |
| 0 | 0 | value 4 |
| ... | 0 | ... |
+----------------+---+----------------+
You have not the problem when you execute the query with a number different of zero :
SELECT col_name1, 1, col_name2 FROM table
or
SELECT col_name1, 0.3, col_name2 FROM table
...
------------------------
>Release: mysql-4.0.21-standard (Official MySQL RPM)
>C compiler: 2.95.3
>C++ compiler: 2.95.3
>Environment:
<machine, os, target, libraries (multiple lines)>
System: Linux s005122w.d11720100 2.4.18-6mdk #1 Fri Mar 15 02:59:08 CET 2002 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/i586-mandrake-linux-gnu/2.96/specs
gcc version 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)
Compilation info: CC='gcc' CFLAGS='-O2 -mcpu=i486 -fno-strength-reduce' CXX='gcc' CXXFLAGS='-O2 -mcpu=i486 -fno-strength-reduce -felide-constructors -fno-exceptions -fno-rtti ' LDFLAGS='' ASFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 sep 24 2002 /lib/libc.so.6 -> libc-2.2.4.so
-rwxr-xr-x 1 root root 1275300 mar 7 2002 /lib/libc-2.2.4.so
-rw-r--r-- 1 root root 27274138 mar 7 2002 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 mar 7 2002 /usr/lib/libc.so
Configure command: ./configure '--disable-shared' '--with-mysqld-ldflags=-all-static' '--with-client-ldflags=-all-static' '--with-server-suffix=-standard' '--without-embedded-server' '--without-berkeley-db' '--with-innodb' '--without-vio' '--without-openssl' '--enable-assembler' '--enable-local-infile' '--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' '--prefix=/' '--with-extra-charsets=complex' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--libdir=/usr/lib' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' '--includedir=/usr/include' '--mandir=/usr/share/man' '--enable-thread-safe-client' '--with-comment=Official MySQL RPM' 'CC=gcc' 'CFLAGS=-O2 -mcpu=i486 -fno-strength-reduce' 'CXXFLAGS=-O2 -mcpu=i486 -fno-strength-reduce -felide-constructors -fno-exceptions -fno-rtti ' 'CXX=gcc'
How to repeat:
SELECT col_name1, 1, col_name2 FROM table
select *, 0 from table
SELECT WhatEverYouWant, 0, WhatEverYouWant FROM table
all theses query are buggy
Suggested fix:
;-)
Good luck !
Fred