On 07/23/14 19:59, Adriano dos Santos Fernandes wrote:
> Hi!
>
> After I reported an TCS fail to Alex in January, he moved this method
> from IStatement to IResultSet.

That move was not directly related with TCS fail. Originally setting 
cursor name remained in effect only for cursor life-time - i.e. after 
isc_dsql_free_statement with DSQL_close option cursor name was 
destroyed. If we set cursor name for statement, semantically it should 
exist after closing cursor. But this breaks applications (starting with 
IBO components) that tend to set new cursor name for each statement 
execution.

> But I fail to understand. Not talking about implementation detail, but
> about interface.
>
> IMO makes no sense to first open the cursor and then name it later.
>
> We can have two prepared statement, while the second uses the cursor
> name of the first. But now we need to open the first before prepare the
> second.
>
> Isn't this just wrong?

Slightly changing FB_SQL_2 test

diff -u -r1.1 FB_SQL_2.script
--- FB_SQL_2.script     27 Dec 2009 16:51:23 -0000      1.1
+++ FB_SQL_2.script     24 Jul 2014 10:24:31 -0000
@@ -62,8 +62,6 @@
         }
         if (isc_dsql_set_cursor_name(userStatus, &stmt1, "C1", 0))
                 isc_print_status(userStatus);
-       if (isc_dsql_execute(userStatus, &gds__trans, &stmt1, 1, NULL))
-               isc_print_status(userStatus);

         stmt2 = 0;
         if (isc_dsql_allocate_statement(userStatus, &db, &stmt2))
@@ -74,6 +72,9 @@
                 isc_print_status(userStatus);
         }

+       if (isc_dsql_execute(userStatus, &gds__trans, &stmt1, 1, NULL))
+               isc_print_status(userStatus);
+
         printf("Original values:\n");

         while (1)

(doing exactly what you talk about - no execute before preparing stmt2) 
runs fine on 2.5, but fails with 3.0 - it's enough to change client 
library. I.e. I certainly agree that we have a problem.


But what solution can we suggest? Move setCursorName back to IStatement 
and blank it when cursor is closed? Last is required to make IBO happy. 
IMHO in old API this is required. But what about new one? What it worse 
- change in behavior or ugly semantics?



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to