Bernard Clement wrote:
Hello Vlad,
The reason is: "If one or both arguments are NULL, the result of the comparison is NULL, except for the NULL-safe <=> equality comparison operator.
Thereore, "or NULL" in your select statement will always returned NULL.
You can find all the rules for comparaison at URL: http://dev.mysql.com/doc/mysql/en/Comparison_Operators.html
Thanks for help but this is not my case. My case described in section "Logical Operators":
OR ||
Logical OR. Evaluates to 1 if any operand is non-zero, to NULL if any operand is NULL, otherwise 0 is returned.
mysql> SELECT 1 || 1; -> 1 mysql> SELECT 1 || 0; -> 1 mysql> SELECT 0 || 0; -> 0 mysql> SELECT 0 || NULL; -> NULL mysql> SELECT 1 || NULL; -> 1
Any help appreciated.
Hi, All
It's happen after upgrade from 3.23.46.
Just look at this set of queries
mysql> select 1 or null; +-----------+
| 1 or null |
+-----------+
| 1 | -> Ok
+-----------+ 1 row in set (0.00 sec)
mysql> create table a ( a int not null ); Query OK, 0 rows affected (0.00 sec)
mysql> select min( a ) is null from a; +------------------+
| min( a ) is null |
+------------------+
| 1 | -> Ok
+------------------+ 1 row in set (0.00 sec)
mysql> select min( a ) is null or null from a; +--------------------------+
| min( a ) is null or null |
+--------------------------+
| NULL | -> Why ???
+--------------------------+ 1 row in set (0.00 sec)
It is very important for me to solve this problem. Thanks for any help
Info from mysqlbug script
Server version 4.1.7 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /tmp/.mysql.sock Uptime: 23 hours 43 min 34 sec
Threads: 2 Questions: 53 Slow queries: 0 Opens: 20 Flush tables: 1 Open tables: 6 Queries per second avg: 0.001
C compiler: 2.95.3 C++ compiler: 2.95.3
>Environment:
<machine, os, target, libraries (multiple lines)> System: SunOS asv 5.8 Generic_108529-23 i86pc i386 i86pc Architecture: i86pc
Some paths: /usr/local/bin/perl /usr/ccs/bin/make /opt/sfw/bin/gmake /opt/sfw/bin/gcc /usr/local/bin/cc GCC: Reading specs from /opt/sfw/lib/gcc-lib/i386-pc-solaris2.8/2.95.3/specs gcc version 2.95.3 20010315 (release) Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' LDFLAGS='' ASFLAGS='' LIBC: -rw-r--r-- 1 root bin 1608268 Jul 30 2003 /lib/libc.a lrwxrwxrwx 1 root root 11 Mar 3 2004 /lib/libc.so -> ./libc.so.1 -rwxr-xr-x 1 root bin 956112 Jul 30 2003 /lib/libc.so.1 -rw-r--r-- 1 root bin 1608268 Jul 30 2003 /usr/lib/libc.a lrwxrwxrwx 1 root root 11 Mar 3 2004 /usr/lib/libc.so -> ./libc.so.1 -rwxr-xr-x 1 root bin 956112 Jul 30 2003 /usr/lib/libc.so.1 Configure command: ./configure '--prefix=/usr/local/mysql-4.1.7' '--exec-prefix=/usr/local/mysql-4.1.7' '--libexecdir=/usr/local/mysql-4.1.7/bin' '--localstatedir=/main/MysqlDB' '--enable-thread-safe-client' '--with-unix-socket-path=/tmp/.mysql.sock' '--with-mysqld-user=mysql' '--without-debug' '--without-bench' '--with-charset=koi8r' Perl: This is perl, version 5.005_03 built for i86pc-solaris
-- --------------------------------------------------------------------------- ----- Vlad A. Shalnev E-mail: [EMAIL PROTECTED]
"Gravity can't be blamed for someone falling in love"
( Albert Einstein )
-- -------------------------------------------------------------------------------- Vlad A. Shalnev E-mail: [EMAIL PROTECTED]
"Gravity can't be blamed for someone falling in love"
( Albert Einstein )
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]