Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dimitry Sibiryakov
Tony Whyman wrote 26.11.2021 18:01: Note that only if FGoToFirstRecordOnExecute is true will the returned values be available immediately. Which (accidentally) is default and has no sense to be changed ever. -- WBR, SD. Firebird-Devel mailing list, web interface at

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Tony Whyman
That code is very legacy and dates from a time when Update..Returning did not exist. Actually, it works the same as the modern version. My point was about what the user expects. If you execute an Update...Returning with the code you pasted in below, with Firebird 4.0.0 it drops through the

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Mark Rotteveel
On 26-11-2021 17:13, Tony Whyman wrote: On 26/11/2021 15:43, Dimitry Sibiryakov wrote: Tony Whyman wrote 26.11.2021 16:32: What you appear to be saying is that you have changed/expanded the semantic of Update...Returning, changed the SQL Statement type returned and then not expected the

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dimitry Sibiryakov
Tony Whyman wrote 26.11.2021 17:13: Legacy code can often appear "insane" with the benefit of hindsight. The problem is that it exists and it is your starting point. You don't break it without good reason. Ok, here is legacy code from TIBSQL.ExecQuery: case FSQLType of SQLSelect:

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dmitry Yemanov
26.11.2021 17:47, Tony Whyman wrote: 3. IBX tries to be general purpose and so prepares a statement, then checks the statement type, and then calls the appropriate IStatement method. Then it shouldn't be broken. It gets isc_info_sql_stmt_select, calls openCursor() and everything works as

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Tony Whyman
On 26/11/2021 15:43, Dimitry Sibiryakov wrote: Tony Whyman wrote 26.11.2021 16:32: What you appear to be saying is that you have changed/expanded the semantic of Update...Returning, changed the SQL Statement type returned and then not expected the change to break any existing code...  

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dimitry Sibiryakov
Tony Whyman wrote 26.11.2021 16:32: What you appear to be saying is that you have changed/expanded the semantic of Update...Returning, changed the SQL Statement type returned and then not expected the change to break any existing code... Correction: any sane code. If a singleton row is

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Mark Rotteveel
On 26-11-2021 16:32, Tony Whyman wrote: What you appear to be saying is that you have changed/expanded the semantic of Update...Returning, changed the SQL Statement type returned and then not expected the change to break any existing code... The change was done in a way that code looking at

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Tony Whyman
What you appear to be saying is that you have changed/expanded the semantic of Update...Returning, changed the SQL Statement type returned and then not expected the change to break any existing code... On 26/11/2021 15:01, Dimitry Sibiryakov wrote: Tony Whyman wrote 26.11.2021 15:28: 3.

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dimitry Sibiryakov
Dimitry Sibiryakov wrote 26.11.2021 16:01: 4. With reference to item 1 above, if "Update..Returning" returns a statement type of isc_info_sql_stmt_select then you _do_ have to also parse the statement in IBX so that you know its an UPDATE and IStatement.execute has to be called instead of

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dimitry Sibiryakov
Tony Whyman wrote 26.11.2021 15:28: 3. Prior to calling IStatement.Execute, the statement type is checked. The current (IBX) code raises an exception if the sql statement type is isc_info_sql_stmt_select in order to stop the wrong IStatement method being called. So it is actually the test

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Alex Peshkoff via Firebird-devel
On 11/26/21 5:47 PM, Tony Whyman wrote: On 26/11/2021 14:32, Dmitry Yemanov wrote: 26.11.2021 17:28, Tony Whyman wrote: 1. IAttachment.prepare is used to parse 'Update Employee Set Hire_Date = ? Where EMP_NO = ? Returning LAST_NAME' 2. IStatement.getType is then used to determine the

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Tony Whyman
On 26/11/2021 14:32, Dmitry Yemanov wrote: 26.11.2021 17:28, Tony Whyman wrote: 1. IAttachment.prepare is used to parse 'Update Employee Set Hire_Date = ? Where EMP_NO = ? Returning LAST_NAME' 2. IStatement.getType is then used to determine the statement type. OK so far. 3. Prior to

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dmitry Yemanov
26.11.2021 17:28, Tony Whyman wrote: 1. IAttachment.prepare is used to parse 'Update Employee Set Hire_Date = ? Where EMP_NO = ? Returning LAST_NAME' 2. IStatement.getType is then used to determine the statement type. OK so far. 3. Prior to calling IStatement.Execute, the statement type is

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Tony Whyman
On 26/11/2021 14:16, Dimitry Sibiryakov wrote: Tony Whyman wrote 26.11.2021 15:10: This caused an error message to be generated because only a singleton row was expected and not a cursor. Well, all I can say is that "existing connectivity drivers do not support this feature automagically".

Re: [Firebird-devel] Firebird 5 and Update...Returning

2021-11-26 Thread Dimitry Sibiryakov
Tony Whyman wrote 26.11.2021 15:10: This caused an error message to be generated because only a singleton row was expected and not a cursor. Well, all I can say is that "existing connectivity drivers do not support this feature automagically". Is it really then intended behaviour for