summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-26 02:29:26 +0100
committerHaru <haru@dotalux.com>2016-05-08 19:53:58 +0200
commitca3abf6b4974f097b6a212ef5c69439db3cc5967 (patch)
tree9ed3096f2daf9f1b1beb6154760d5dac47f49245 /src
parent2349b2a1528fe5dc41d930f8dd332df5ba521eb6 (diff)
downloadhercules-ca3abf6b4974f097b6a212ef5c69439db3cc5967.tar.gz
hercules-ca3abf6b4974f097b6a212ef5c69439db3cc5967.tar.bz2
hercules-ca3abf6b4974f097b6a212ef5c69439db3cc5967.tar.xz
hercules-ca3abf6b4974f097b6a212ef5c69439db3cc5967.zip
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 <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/sql.c15
1 files changed, 0 insertions, 15 deletions
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) {