From 5df447b6ec612cab24f8d62892d2d5aca0c762d0 Mon Sep 17 00:00:00 2001 From: Ravi Prakash Date: Tue, 14 Aug 2018 11:59:09 -0700 Subject: [PATCH] Fix MCOL-1635 where an "insert into table select query" crashes the server. This happens for a MEDIUMBLOB column type. --- dbcon/mysql/ha_calpont_dml.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbcon/mysql/ha_calpont_dml.cpp b/dbcon/mysql/ha_calpont_dml.cpp index 9583d9f9e..c2dc36e47 100755 --- a/dbcon/mysql/ha_calpont_dml.cpp +++ b/dbcon/mysql/ha_calpont_dml.cpp @@ -1615,8 +1615,11 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_ } else if (ci.columnTypes[colpos].colWidth < 16777216) { - dataLength = *(uint32_t*) buf; - buf = buf + 3 ; + dataLength = *(uint16_t*) buf; + buf = buf + 2 ; + if (*(uint8_t*)buf) + dataLength += 256*256*(*(uint8_t*)buf) ; + buf++; } else {