Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: here's a good one from dizwell on the recent product launch

Re: here's a good one from dizwell on the recent product launch

From: Mark Townsend <markbtownsend_at_sbcglobal.net>
Date: Wed, 18 Jul 2007 22:30:27 -0700
Message-ID: <469EF6F3.8050100@sbcglobal.net>

>
> I looked at this one tonight. The problem boils down to the following
> reproducible case
>
> select 1 from dual
> where ('Tout' = CASE 'Oui'
> WHEN 'Oui' THEN 'Y'
> WHEN 'Non' THEN 'N'
> ELSE 'Tout' END)
> /
>
> Exactly as this - i.e it has to be literals used in this manner, with
> this outcome.
>

Wow - Suddenly I had a flashback.

In a past life before Oracle I wrote language compilers in PL/1.

PL/1 allowed you to define literals that were also part of the reserved word list for the language itself. So compiler code that read as followed was entirely possible

If if = if then then = then else then = else.

You could also have boolean literals - true, false, yes, no, on, off etc

So code such as

if if is true then then is false else then is true

was also regular.

In fact, we delighted in writing the most obtuse code we could come up with - youthful exuberance and maybe a modicum of job protection

One day a particular customers program caused a pointer exception in the stack that flipped the static bits in the exact 2 byte word where the boolean literals were stored.

So literals for true became false and vice versa.

Code that read one way now behaved exactly the opposite way.

That one took two of us 6 weeks to diagnose. Received on Thu Jul 19 2007 - 00:30:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US