Commit 0440e70a authored by venu@hundin.mysql.fi's avatar venu@hundin.mysql.fi

undo one row warning instead use sql_warnings=1

parent bc7cf303
......@@ -91,8 +91,11 @@ Warning 1263 Data truncated for column 'b' at row 3
Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
Warning 1263 Data truncated for column 'b' at row 4
insert into t2(b) values('mysqlab');
set sql_warnings=1;
insert into t2(b) values('mysqlab');
Warnings:
Warning 1263 Data truncated for column 'b' at row 1
set sql_warnings=0;
drop table t1, t2;
create table t1(a char(10));
alter table t1 add b char;
......
......@@ -52,6 +52,9 @@ update t1 set d=c;
create table t2(a tinyint NOT NULL, b char(3));
insert into t2 select b,c from t1;
insert into t2(b) values('mysqlab');
set sql_warnings=1;
insert into t2(b) values('mysqlab');
set sql_warnings=0;
drop table t1, t2;
#
......
......@@ -231,9 +231,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
info.update_fields=&update_fields;
info.update_values=&update_values;
// Don't count warnings for simple inserts
if ((thd->client_capabilities & CLIENT_PROTOCOL_41) ||
values_list.elements > 1 ||
(thd->options & OPTION_WARNINGS))
if (values_list.elements > 1 || (thd->options & OPTION_WARNINGS))
thd->count_cuted_fields = 1;
thd->cuted_fields = 0L;
table->next_number_field=table->found_next_number_field;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment