[MDEV-22559] reexecution of prepared statement return wrong first row data Created: 2020-05-14  Updated: 2023-12-12

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.4.13, 10.5.2
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Diego Dupin Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 1
Labels: CONNECTOR_RELATED

Attachments: Java Source File Test.java     File dump-testa-202005081710 (1).sql    

 Description   

tested, but not reproduced on 10.2, 10.3 server

There is an issue when reusing multiple time COM_STMT_EXECUTE.

Join to this issue are 2 files (sql + java test) to reproduced the issue.
Executing multiple time the same query on different connection with same parameters sometimes return a strange first resultset binary row.

First row content is normally :

+--------------------------------------------------+
|  0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f |
+--------------------------------------------------+------------------+
| 91 00 00 11 00 00 F8 00  13 31 31 38 32 39 36 31 | .........1182961 |
| 30 39 38 34 35 31 39 38  38 34 38 32 13 31 31 36 | 098451988482.116 |
| 32 35 33 33 33 37 30 36  38 37 30 30 34 36 37 33 | 2533370687004673 |
| 01 01 01 24 33 65 30 30  39 31 65 65 2D 39 31 30 | ...$3e0091ee-910 |
| 35 2D 31 31 65 61 2D 38  32 66 30 2D 30 30 35 30 | 5-11ea-82f0-0050 |
| 35 36 38 64 36 62 62 61  0A 00 00 00 00 00 00 00 | 568d6bba........ |
| 3C 00 00 00 00 00 00 00  24 33 65 30 30 39 32 30 | <.......$3e00920 |
| 37 2D 39 31 30 35 2D 31  31 65 61 2D 38 32 66 30 | 7-9105-11ea-82f0 |
| 2D 30 30 35 30 35 36 38  64 36 62 62 61 01 00 00 | -0050568d6bba... |
| 00 00 00 00 00                                   | .....            |
+--------------------------------------------------+------------------+

but sometime is :

+--------------------------------------------------+
|  0  1  2  3  4  5  6  7   8  9  a  b  c  d  e  f |
+--------------------------------------------------+------------------+
| 4C 00 00 11 00 00 00 00  00 00 00 00 00 00 00 00 | L............... |
| 00 00 00 00 00 01 3C 00  00 00 00 00 00 00 24 33 | ......<.......$3 |
| 65 30 31 31 38 62 64 2D  39 31 30 35 2D 31 31 65 | e0118bd-9105-11e |
| 61 2D 38 32 66 30 2D 30  30 35 30 35 36 38 64 36 | a-82f0-0050568d6 |
| 62 62 61 00 00 00 00 00  04 00 00 00 00 00 00 00 | bba............. |
+--------------------------------------------------+------------------+


Generated at Thu Feb 08 09:15:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.