I am able to reproduce your issue directly in HSQLDB 2.3.1 and HSQLDB 2.4.1.
try(Statementst=conn.createStatement()){st.execute("CREATE TABLE ttt (id int PRIMARY KEY, cNull varchar(255))");st.execute("INSERT INTO ttt (id) VALUES (1)");Stringsql=null;ResultSetrs=null;sql="select CASE cNull WHEN NULL THEN 2 ELSE 1 END FROM ttt";rs=st.executeQuery(sql);rs.next();System.out.println(rs.getInt(1));// 1sql="select CASE WHEN cNull IS NULL THEN 2 ELSE 1 END FROM ttt";rs=st.executeQuery(sql);rs.next();System.out.println(rs.getInt(1));// 2}
However, I am also able to reproduce the issue using Microsoft SQL Server 2014:
Hi,
When the test expression in a simple (as opposed to searched) CASE expression has value NULL, the NULL branch is not used:
Is the first form being considered as "CASE WHEN cNull=NULL THEN..."? This would obviously fail.
Kind regards,
Mick.
I am able to reproduce your issue directly in HSQLDB 2.3.1 and HSQLDB 2.4.1.
However, I am also able to reproduce the issue using Microsoft SQL Server 2014:
Thus, this issue is not specific to HSQLDB or UCanAccess.
It is not an issue at all for me: null = null is always false in sql
Thanks for investigating, Gord - my bad!