Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.11
-
Fedora 29
Description
mysql_stmt_fetch() returns 0 instead of 101 when results are bound to a buffer of size 1 and the data is longer than 1.
Output of the attached test case:
$ ./test.sh
|
Client compile version: 80013
|
Client runtime version: 8.0.13
|
Server version: 80013
|
Result: 00001
|
|
Buffer length: 1
|
mysql_stmt_fetch result: 101
|
Result: 0 (prepared statement)
|
|
Buffer length: 2
|
mysql_stmt_fetch result: 101
|
Result: 00 (prepared statement)
|
|
Buffer length: 3
|
mysql_stmt_fetch result: 101
|
Result: 000 (prepared statement)
|
|
Buffer length: 4
|
mysql_stmt_fetch result: 101
|
Result: 0000 (prepared statement)
|
|
Buffer length: 5
|
mysql_stmt_fetch result: 0
|
Result: 00001 (prepared statement)
|
Client compile version: 100311
|
Client runtime version: 10.3.11
|
Server version: 100311
|
Result: 00001
|
|
Buffer length: 1
|
mysql_stmt_fetch result: 0
|
Result: 1. (prepared statement)
|
|
Buffer length: 2
|
mysql_stmt_fetch result: 101
|
Result: 00 (prepared statement)
|
|
Buffer length: 3
|
mysql_stmt_fetch result: 101
|
Result: 000 (prepared statement)
|
|
Buffer length: 4
|
mysql_stmt_fetch result: 101
|
Result: 0000 (prepared statement)
|
|
Buffer length: 5
|
mysql_stmt_fetch result: 0
|
Result: 00001 (prepared statement)
|
For buffer length 0..4 the expected result is 101 (MYSQL_DATA_TRUNCATED)
For buffer length 5 the result should be 0
Attachments
Issue Links
- relates to
-
CONC-407 mysql_stmt_fetch: required buffer for zerofil integer is 1 more than reported length
- Open