Skip to content

Commit 8f9cb4c

Browse files
SingingBushAbscissa
authored andcommitted
fix #205 implicit convertion from size_t to ushort
1 parent 064366b commit 8f9cb4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/mysql/protocol/comms.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ package struct ProtocolPrepared
415415
static void sendLongData(MySQLSocket socket, uint hStmt, ParameterSpecialization[] psa)
416416
{
417417
assert(psa.length <= ushort.max); // parameter number is sent as short
418-
foreach (ushort i, PSN psn; psa)
418+
foreach (size_t i, PSN psn; psa)
419419
{
420420
if (!psn.chunkSize) continue;
421421
uint cs = psn.chunkSize;
@@ -426,7 +426,7 @@ package struct ProtocolPrepared
426426
chunk.setPacketHeader(0 /*each chunk is separate cmd*/);
427427
chunk[4] = CommandType.STMT_SEND_LONG_DATA;
428428
hStmt.packInto(chunk[5..9]); // statement handle
429-
packInto(i, chunk[9..11]); // parameter number
429+
packInto(cast(ushort)i, chunk[9..11]); // parameter number
430430

431431
// byte 11 on is payload
432432
for (;;)

0 commit comments

Comments
 (0)