summaryrefslogtreecommitdiff
path: root/mysql-test/r/insert.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/insert.result')
-rw-r--r--mysql-test/r/insert.result44
1 files changed, 42 insertions, 2 deletions
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 3f91039d592..36d2b9ef348 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -355,17 +355,17 @@ insert into t2 values (1,12), (2,24);
insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
+ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
select * from t1;
f1 f2
1 11
2 22
-3 NULL
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
+ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
select * from t1;
f1 f2
1 11
2 22
-12 NULL
drop view v1;
drop table t1,t2;
create table t1 (id int primary key auto_increment, data int, unique(data));
@@ -639,3 +639,43 @@ CREATE TABLE t2(f1 CHAR(1));
INSERT INTO t2 SELECT f1 FROM t1;
DROP TABLE t1, t2;
End of 5.0 tests.
+#
+# Bug#34898 "mysql_info() reports 0 warnings while
+# mysql_warning_count() reports 1"
+# Check that the number of warnings reported by
+# mysql_info() is correct.
+#
+drop table if exists t1;
+create table t1 (data varchar(4) not null);
+set sql_mode='error_for_division_by_zero';
+#
+# Demonstrate that the number of warnings matches
+# the information in mysql_info().
+#
+insert t1 (data) values ('letter'), (1/0);
+affected rows: 2
+info: Records: 2 Duplicates: 0 Warnings: 3
+Warnings:
+Warning 1265 Data truncated for column 'data' at row 1
+Warning 1365 Division by 0
+Warning 1048 Column 'data' cannot be null
+update t1 set data='envelope' where 1/0 or 1;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 3
+Warnings:
+Warning 1365 Division by 0
+Warning 1265 Data truncated for column 'data' at row 1
+Warning 1265 Data truncated for column 'data' at row 2
+insert t1 (data) values (default), (1/0), ('dead beef');
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 4
+Warnings:
+Warning 1364 Field 'data' doesn't have a default value
+Warning 1365 Division by 0
+Warning 1048 Column 'data' cannot be null
+Warning 1265 Data truncated for column 'data' at row 3
+set sql_mode=default;
+drop table t1;
+#
+# End of 5.4 tests
+#