bamaer commented on PR #8693:
URL: https://github.com/apache/hop/pull/8693#issuecomment-5932234526
**Blockers**
- **Row mode can silently lose all rows when the procedure also has
OUT/INOUT parameters.** `Database.callProcedure` reads the OUT parameters
(`readProcedureOutputs`, `Database.java:4675`) before it retains the first
result set (`:4677`). SQL Server (mssql-jdbc, jTDS) and Sybase only return OUT
values after the pending results have been consumed, so reading them first
discards the result set. A procedure that does a `SELECT` and also has an OUT
parameter then outputs zero rows, without an error.
Suggested fix: in Row mode, reject OUT/INOUT arguments, with a `check()`
error and an error at runtime. The alternative is to read the result set first
and the OUT values after draining it, which means buffering the rows.
**Should fix**
- **Get fields executes the procedure without asking.** When the driver
can't describe the result set up front, `getProcedureResultFields` calls the
procedure with NULL arguments (`DBProcDialog.java:450` →
`Database.getProcedureResultFields`). The rollback afterwards doesn't undo a
procedure that commits itself, a driver that refuses to turn auto-commit off,
or side effects outside the database.
Suggested fix: show a confirmation ("This runs the procedure with NULL
arguments to find its result columns. Continue?") before executing it, and skip
the confirmation when the driver can describe the result set without running
the procedure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]