mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
undo one row warning instead use sql_warnings=1
This commit is contained in:
@ -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 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
||||||
Warning 1263 Data truncated for column 'b' at row 4
|
Warning 1263 Data truncated for column 'b' at row 4
|
||||||
insert into t2(b) values('mysqlab');
|
insert into t2(b) values('mysqlab');
|
||||||
|
set sql_warnings=1;
|
||||||
|
insert into t2(b) values('mysqlab');
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated for column 'b' at row 1
|
Warning 1263 Data truncated for column 'b' at row 1
|
||||||
|
set sql_warnings=0;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
create table t1(a char(10));
|
create table t1(a char(10));
|
||||||
alter table t1 add b char;
|
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));
|
create table t2(a tinyint NOT NULL, b char(3));
|
||||||
insert into t2 select b,c from t1;
|
insert into t2 select b,c from t1;
|
||||||
insert into t2(b) values('mysqlab');
|
insert into t2(b) values('mysqlab');
|
||||||
|
set sql_warnings=1;
|
||||||
|
insert into t2(b) values('mysqlab');
|
||||||
|
set sql_warnings=0;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -231,9 +231,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
info.update_fields=&update_fields;
|
info.update_fields=&update_fields;
|
||||||
info.update_values=&update_values;
|
info.update_values=&update_values;
|
||||||
// Don't count warnings for simple inserts
|
// Don't count warnings for simple inserts
|
||||||
if ((thd->client_capabilities & CLIENT_PROTOCOL_41) ||
|
if (values_list.elements > 1 || (thd->options & OPTION_WARNINGS))
|
||||||
values_list.elements > 1 ||
|
|
||||||
(thd->options & OPTION_WARNINGS))
|
|
||||||
thd->count_cuted_fields = 1;
|
thd->count_cuted_fields = 1;
|
||||||
thd->cuted_fields = 0L;
|
thd->cuted_fields = 0L;
|
||||||
table->next_number_field=table->found_next_number_field;
|
table->next_number_field=table->found_next_number_field;
|
||||||
|
Reference in New Issue
Block a user