From ca3abf6b4974f097b6a212ef5c69439db3cc5967 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 26 Dec 2015 02:29:26 +0100 Subject: Removed some old MySQL 4 compatibility code Long overdue, since MySQL 4.x was already unsupported for quite a while (to be fair, we're about to deprecate support for MySQL 5.0 and 5.1) Signed-off-by: Haru --- src/common/sql.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/common') diff --git a/src/common/sql.c b/src/common/sql.c index ef8cde536..9a90f9807 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -778,8 +778,6 @@ int SqlStmt_NextRow(struct SqlStmt *self) // check for errors if (err == MYSQL_NO_DATA) return SQL_NO_DATA; -#if defined(MYSQL_DATA_TRUNCATED) - // MySQL 5.0/5.1 defines and returns MYSQL_DATA_TRUNCATED [FlavioJS] if (err == MYSQL_DATA_TRUNCATED) { my_bool truncated; @@ -804,7 +802,6 @@ int SqlStmt_NextRow(struct SqlStmt *self) ShowSQL("DB error - data truncated (unknown source)\n"); return SQL_ERROR; } -#endif if (err) { ShowSQL("DB error - %s\n", mysql_stmt_error(self->stmt)); hercules_mysql_error_handler(mysql_stmt_errno(self->stmt)); @@ -816,18 +813,6 @@ int SqlStmt_NextRow(struct SqlStmt *self) for (i = 0; i < cols; ++i) { unsigned long length = self->column_lengths[i].length; MYSQL_BIND *column = &self->columns[i]; -#if !defined(MYSQL_DATA_TRUNCATED) - // MySQL 4.1/(below?) returns success even if data is truncated, so we test truncation manually [FlavioJS] - if (column->buffer_length < length) { - // report truncated column - if (column->buffer_type == MYSQL_TYPE_STRING || column->buffer_type == MYSQL_TYPE_BLOB) { - // string/enum/blob column - SqlStmt_P_ShowDebugTruncatedColumn(self, i); - return SQL_ERROR; - } - // FIXME numeric types and null [FlavioJS] - } -#endif if (self->column_lengths[i].out_length) *self->column_lengths[i].out_length = (uint32)length; if (column->buffer_type == MYSQL_TYPE_STRING) { -- cgit v1.2.3-70-g09d2