summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-12-18 00:17:25 +0300
committerunknown <konstantin@mysql.com>2004-12-18 00:17:25 +0300
commit996352b73e60cce2458cf72ab36c49126e635997 (patch)
tree75100b91f7d8e8ab02c6fa3120b8fbb75d8e7265 /libmysql
parent91a76445335eb251440e61b114b4fdbb0dba5813 (diff)
downloadmariadb-git-996352b73e60cce2458cf72ab36c49126e635997.tar.gz
Truncations patch: a post-review fix.
include/mysql.h: Adding an option for data truncations feature. libmysql/libmysql.c: No 'smart' behaviour now for data truncations: they are always reported, unless switched off with mysql_options(mysql, MYSQL_REPORT_DATA_TRUNCATION, (my_bool*) &(option=1)); sql-common/client.c: Add support for report-data-truncation variable in my.cnf tests/client_test.c: A test for MYSQL_REPORT_DATA_TRUNCATION option.
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 7d078a179ed..ce8a5aaaaab 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -4342,7 +4342,6 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
MYSQL_FIELD *field;
ulong bind_count= stmt->field_count;
uint param_count= 0;
- uchar report_data_truncation= 0;
DBUG_ENTER("mysql_stmt_bind_result");
DBUG_PRINT("enter",("field_count: %d", bind_count));
@@ -4380,8 +4379,6 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
if (!param->error)
param->error= &param->error_value;
- else
- report_data_truncation= REPORT_DATA_TRUNCATION;
param->param_number= param_count++;
param->offset= 0;
@@ -4395,7 +4392,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
DBUG_RETURN(1);
}
}
- stmt->bind_result_done= BIND_RESULT_DONE | report_data_truncation;
+ stmt->bind_result_done= BIND_RESULT_DONE;
+ if (stmt->mysql->options.report_data_truncation)
+ stmt->bind_result_done|= REPORT_DATA_TRUNCATION;
+
DBUG_RETURN(0);
}