Hello,
I am having an issue with MonetDB Oct 2014-SP2., though I believe it's also
an issue with Jul2015-SP1. The issue happens when using a select case, the
items in the when statement are validated even when the statement will
never execute. This will cause issues with casting, that otherwise should
never have executed.
For example, this sample code:
select case
when false = true then
cast('a' as int)
else 'b'
end
Results in the error:
Error: conversion of string 'a' to type int failed.
SQLState: 22018
ErrorCode: 0
Even though the when statement should never be true and it shouldn't matter
if it can't cast 'a' to an int.
While the similar query:
select case
when false = true then
'a'
else 'b'
end
Will always result in 'b', as expected. It is almost as if the query is not
short circuiting correctly and checks every statement of the when
statement. I was previously on release Jan-2014 SP1 and I did not have this
issue.
Has anybody else seen something like this? Is there a setting somewhere to
turn off this when check? Apologies if this is a common/simple question, I
am relatively new to MonetDB.
Thank you,
John