[Firebird-test] Bug in DSQL parameter?

View: New views
1 Messages — Rating Filter:   Alert me  

[Firebird-test] Bug in DSQL parameter?

by Maycon Ferraça-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi people!

Look this (Test in FB 2.0 RC4 with IBExpert):
------------------------------------------------------------------------------------------
CREATE TABLE TEST (MYDATE DATE NOT NULL PRIMARY KEY);
COMMIT;

INSERT INTO TEST VALUES (CURRENT_DATE);
INSERT INTO TEST VALUES (CURRENT_DATE + 1);
INSERT INTO TEST VALUES (CURRENT_DATE + 2);
INSERT INTO TEST VALUES (CURRENT_DATE + 3);
COMMIT;

-- This expression fails
SELECT * FROM TEST WHERE MYDATE + CAST(:days AS INTEGER) >= :dateparam;
--Error:
--Dynamic SQL Error.
--SQL error code = -804.
--Data type unknown.

--But in this is okay
SELECT * FROM TEST WHERE MYDATE + 5 >= :dateparam;
------------------------------------------------------------------------------------------
Is a bug???


Another question:

In FB 1.5 and oldest this query fails:
SELECT 1 FROM RDB$DATABASE :myparam IS NULL;

With the feature in FB 2.0 (Bug fix #1371274) this situation can be
corrected thus:
SELECT 1 FROM RDB$DATABASE CAST(:myparam AS INTEGER) IS NULL;

But I think that in this situation is not necessary for engine know a
datatype, because the parameter "myparam" is verified with null state.
Is not a bug, right? But a feature?

Thanks
Maycon Ferraça - Brazil

PS.:
(1) Sorry if this wrong place for this message.
(2) Sorry for my bad bad english... :S

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-test mailing list
Firebird-test@...
https://lists.sourceforge.net/lists/listinfo/firebird-test
LightInTheBox - Buy quality products at wholesale price!