1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix/replacement for PR 107:

Instead of calculating size with packlen for date/time types,
we need to use the max. value of the corresponding type.
This commit is contained in:
Georg Richter
2022-01-24 07:34:30 +01:00
parent 49a22c269a
commit dce4b8a89d

View File

@@ -808,6 +808,16 @@ unsigned char* mysql_stmt_execute_generate_simple_request(MYSQL_STMT *stmt, size
size+= 9; /* max 8 bytes for size */ size+= 9; /* max 8 bytes for size */
size+= (size_t)ma_get_length(stmt, i, 0); size+= (size_t)ma_get_length(stmt, i, 0);
break; break;
case MYSQL_TYPE_TIME:
size+= MAX_TIME_STR_LEN;
break;
case MYSQL_TYPE_DATE:
size+= MAX_DATE_STR_LEN;
break;
case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP:
size+= MAX_DATETIME_STR_LEN;
break;
default: default:
size+= mysql_ps_fetch_functions[stmt->params[i].buffer_type].pack_len; size+= mysql_ps_fetch_functions[stmt->params[i].buffer_type].pack_len;
break; break;