Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NPE issue when batch execution is called without any queries (#207)
Motivation: (Please describe the problem you are trying to solve, or the new feature you are trying to add.) we're using this R2DBC client with jOOQ. NPE occurs when we give empty list to `DSLContext#batch` ```kotlin val queries = emptyList() dslContext.batch(queries).awaitLast() ``` this is because `StringBuilder` in `MySqlBatchingBatch` is not initialized until `add` method is called. so, `execute` method will refer to not-initialized `builder` when `add` method is not called. Modification: (Please describe the changes you have made to the codebase, including any new files, modified files, or deleted files.) ~~modify `execute` to return `Flux#empty` when ` builder` is not initialized (i.e., `add` method is not called).~~ send empty string to client without NPE Result: (Please describe the expected outcome of your changes, and any potential side effects or drawbacks. If possible, please also include any relevant testing results.) it now does not throw NPE ~~but returns empty flux instead.~~
- Loading branch information