Bug #97269 Possible bug in com.mysql.cj.xdevapi.StreamingDocResultBuilder
Submitted: 17 Oct 10:52 Modified: 18 Oct 9:31
Reporter: Vladimir Marinov Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:8.0.18 OS:Any
Assigned to: Alexander Soklakov CPU Architecture:Any
Tags: XDevAPI

[17 Oct 10:52] Vladimir Marinov
Description:
The `addProtocolEntity` method of `com.mysql.cj.xdevapi.StreamingDocResultBuilder`
appears to be missing a `return` after handling ProtocolEntity of type Notice.
Other ResultBuilder subclasses do return `false`.

How to repeat:
null
[17 Oct 13:08] Umesh Shastry
Hello Vladimir Marinov,

Thank you for the bug report.
Discussed internally with Alex Soklakov (C/J Developer) and confirmed that it is not a bug as we add already consumed Notice to statementExecuteOkBuilder and then pass control over reading from wire to XProtocolRowInputStream.

Thank you for your interest in MySQL.

regards,
Umesh
[17 Oct 15:52] Vladimir Marinov
Hi Umesh,

readQueryResult in XProtocol class has the following line:
`notices.stream().forEach(resultBuilder::addProtocolEntity)`

That means that for each notice the call to addProtocolEntity will result in reinitialization of XProtocolRowInputStream rowList field in StreamingDocResultBuilder.

Even if nothing breaks for now, it has potential to cause problems in the future.
[18 Oct 9:31] Alexander Soklakov
Hi Vladimir,

You're probably right here, we need to check this. Thanks!