Bug #104391 Multiple statements in one query will fail using Parameterized Query
Submitted: 23 Jul 2021 8:47 Modified: 23 Jul 2021 13:15
Reporter: Yuwei Yang Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[23 Jul 2021 8:47] Yuwei Yang
Description:
Multiple statements in one query will fail using prepared statement, while pass with standard statement.

SQL example:

- Non-PQ ---- PASS
SET @city_id = 1;
SET @city_desc = 'Test Proc OFF';
CALL AddToCityList(@city_id, @city_desc);

- PQ ---- FAIL
SET @city_id = ?;
SET @city_desc = ?;
CALL AddToCityList(@city_id, @city_desc);
with parameters:
    1
    Test Proc

ODBC trace attached.

How to repeat:
1. Create DSN using MySQL 8.x Unicode Driver, enable "allow multiple statements"
2. Send multiple statements in one query to Driver
3. PQ case will fail, non PQ case will pass
[23 Jul 2021 8:48] Yuwei Yang
ODBC Trace with standard statement

Attachment: SQLTrace_nonpq.LOG (application/octet-stream, text), 53.06 KiB.

[23 Jul 2021 8:48] Yuwei Yang
ODBC Trace using prepared query

Attachment: SQLtrace_pq.LOG (application/octet-stream, text), 240.89 KiB.

[23 Jul 2021 13:15] MySQL Verification Team
Hello Yuwei Yang,

Thank you for the report.
Imho this is duplicate of Bug #76689, please see the Bug #76689.

Regards,
Ashwini Patil