This one seems to be a close relative to the one just reported (KB Stack
type Illegal), as the "functioning" of the latter also depends on the
where-clause.

I am using 7.4.3.17 on W2K, _UNICODE = NO
Steps to reproduce:

CREATE TABLE "DBA"."MURXX"
(
"MSG_KEY" Integer NOT NULL DEFAULT SERIAL (1),
"MSG_FROM" Integer NOT NULL,
"MSG_TO" Integer NOT NULL,
"MSG_TEXT" Varchar (7500) ASCII NOT NULL,
"MSG_DATE" Timestamp NOT NULL DEFAULT TIMESTAMP,
"MSG_DATE_RD" Timestamp,
"FROM_DEL" Smallint NOT NULL DEFAULT 0,
"TO_DEL" Smallint NOT NULL DEFAULT 0,
"MSG_EMAILED" Smallint NOT NULL DEFAULT 0,
"MSG_READ" Smallint NOT NULL DEFAULT 0,
"STOP_FROM" Smallint NOT NULL DEFAULT 0,
"STOP_TO" Smallint NOT NULL DEFAULT 0,
PRIMARY KEY ("MSG_KEY", "MSG_FROM", "MSG_TO")
)
--
CREATE INDEX "IDX_MURXX_DAT" ON "DBA"."MURXX"("MSG_DATE" DESC)
--
insert into murxx values(0,72,811,'blabla','2003-05-01
17:00:00.000000','2003-05-03 17:00:00.000000',0,0,0,0,0,0)
--
insert into murxx values(0,56,72,'blabla','2003-05-03
17:00:00.000000','2003-05-05 17:00:00.000000',0,0,0,0,0,0)

Now a:

select * from murxx where 72 in (msg_from,msg_to) and not (false and
msg_to=72) order by msg_date desc

only returns one row, it is the one that does not contain 72 in msg_to.
However, the where-clause always evaluates to true (false AND anything is
always false, therefore NOT false is true)

If you drop the index it's all ok.

(Gerald)

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to