1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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.
This commit is contained in:
unknown
2004-12-18 00:17:25 +03:00
parent 91a7644533
commit 996352b73e
4 changed files with 67 additions and 5 deletions

View File

@ -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);
}