From f251ebccb2d19a2806ee681beca7f2a94835f9c5 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 19 Apr 2017 14:11:21 +0100 Subject: [PATCH] MCOL-669 TEXT cpimport fixes * 64KB TEXT column had off-by-one length pointer counting * TEXT I_S/LDI was looping where it shouldn't causing pointer issues * TEXT data type wasn't fully understood by cpimport --- dbcon/execplan/calpontsystemcatalog.h | 8 ++++---- dbcon/mysql/ha_calpont_dml.cpp | 26 +++++++++++++------------- writeengine/shared/we_type.h | 3 ++- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/dbcon/execplan/calpontsystemcatalog.h b/dbcon/execplan/calpontsystemcatalog.h index 6f7251177..fc9346e2b 100644 --- a/dbcon/execplan/calpontsystemcatalog.h +++ b/dbcon/execplan/calpontsystemcatalog.h @@ -153,11 +153,11 @@ public: UFLOAT, /*!< Unsigned FLOAT type */ UBIGINT, /*!< Unsigned BIGINT type */ UDOUBLE, /*!< Unsigned DOUBLE type */ - NUM_OF_COL_DATA_TYPE, + TEXT, /*!< TEXT type */ + NUM_OF_COL_DATA_TYPE, /* NEW TYPES ABOVE HERE */ LONGDOUBLE, /* @bug3241, dev and variance calculation only */ - STRINT, /* @bug3532, string as int for fast comparison */ - TEXT /*!< TEXT type */ - }; + STRINT /* @bug3532, string as int for fast comparison */ + }; /** the set of column constraint types * diff --git a/dbcon/mysql/ha_calpont_dml.cpp b/dbcon/mysql/ha_calpont_dml.cpp index d693eb6d3..39e879ff8 100755 --- a/dbcon/mysql/ha_calpont_dml.cpp +++ b/dbcon/mysql/ha_calpont_dml.cpp @@ -1597,7 +1597,7 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_ dataLength = *(int8_t*) buf; buf++; } - else if (ci.columnTypes[colpos].colWidth < 65535) + else if (ci.columnTypes[colpos].colWidth < 65536) { dataLength = *(int16_t*) buf; buf = buf + 2 ; @@ -1612,7 +1612,7 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_ dataLength = *(int32_t*) buf; buf = buf + 4 ; } - + // buf contains pointer to blob, for example: // (gdb) p (char*)*(uintptr_t*)buf // $43 = 0x7f68500c58f8 "hello world" @@ -1620,22 +1620,22 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_ dataptr = (uintptr_t*)buf; ucharptr = (uchar*)*dataptr; buf+= sizeof(uintptr_t); - for (int32_t i=0; i