summaryrefslogtreecommitdiff
path: root/mysql-test/suite/gcol
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/gcol')
-rw-r--r--mysql-test/suite/gcol/inc/gcol_ins_upd.inc12
-rw-r--r--mysql-test/suite/gcol/inc/gcol_keys.inc11
-rw-r--r--mysql-test/suite/gcol/inc/gcol_select.inc6
-rw-r--r--mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc4
-rw-r--r--mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result4
-rw-r--r--mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result8
-rw-r--r--mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result12
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_myisam.result10
-rw-r--r--mysql-test/suite/gcol/r/gcol_select_innodb.result6
-rw-r--r--mysql-test/suite/gcol/r/gcol_select_myisam.result6
-rw-r--r--mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result24
-rw-r--r--mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result24
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_fk.result4
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_fk.test3
14 files changed, 116 insertions, 18 deletions
diff --git a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc
index 4b3431eea2e..7fde9c2e852 100644
--- a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc
+++ b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc
@@ -47,7 +47,7 @@ delete from t1;
select * from t1;
--echo # INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols
-insert into t1 values (1,2,3);
+insert ignore into t1 values (1,2,3);
select * from t1;
delete from t1;
select * from t1;
@@ -73,7 +73,7 @@ select * from t1;
--echo # INSERT INTO tbl_name (<normal+gcols>) VALUES... a non-NULL value is specified
--echo # against gcols
-insert into t1 (a,b) values (1,3), (2,4);
+insert ignore into t1 (a,b) values (1,3), (2,4);
select * from t1;
delete from t1;
select * from t1;
@@ -131,7 +131,7 @@ select * from t1;
--echo # UPDATE tbl_name SET gcol=expr WHERE non-gcol=expr
insert into t1 (a) values (1), (2);
select * from t1 order by a;
-update t1 set c=3 where a=2;
+update ignore t1 set c=3 where a=2;
select * from t1 order by a;
delete from t1;
select * from t1;
@@ -147,7 +147,7 @@ select * from t1;
--echo # UPDATE tbl_name SET gcol=expr WHERE gcol=expr
insert into t1 (a) values (1), (2);
select * from t1 order by a;
-update t1 set c=3 where b=-2;
+update ignore t1 set c=3 where b=-2;
select * from t1 order by a;
delete from t1;
select * from t1;
@@ -493,7 +493,7 @@ b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL,
KEY (a(183),b)
);
-INSERT INTO t VALUES(), (), ();
+INSERT IGNORE INTO t VALUES(), (), ();
DELETE IGNORE FROM t;
@@ -512,7 +512,7 @@ CREATE TABLE t (
UNIQUE(b),
UNIQUE(b1)
);
-INSERT INTO t VALUES();
+INSERT IGNORE INTO t VALUES();
SELECT b from t;
SELECT b1 from t;
SELECT * from t;
diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc
index 7f888ef54a5..44824215c40 100644
--- a/mysql-test/suite/gcol/inc/gcol_keys.inc
+++ b/mysql-test/suite/gcol/inc/gcol_keys.inc
@@ -676,7 +676,9 @@ INSERT INTO t(a) VALUES (1);
# Before index was created, this query returned the expected one match.
SELECT * FROM t WHERE c = '0';
# Adding an index sometimes crashed, other times populated it with garbage ...
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t ADD UNIQUE INDEX (c(1));
+SET sql_mode = DEFAULT;
# ... so that this query found no match in the index.
SELECT * FROM t WHERE c = '0';
DROP TABLE t;
@@ -689,9 +691,16 @@ CREATE TABLE t (a INT, b INT, h VARCHAR(10));
INSERT INTO t VALUES (12, 3, "ss");
INSERT INTO t VALUES (13, 4, "ss");
INSERT INTO t VALUES (14, 0, "ss");
+--error ER_DIVISION_BY_ZERO
ALTER TABLE t ADD c INT GENERATED ALWAYS AS (a/b) VIRTUAL;
-#--error ER_DIVISION_BY_ZERO
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+ALTER TABLE t ADD c INT GENERATED ALWAYS AS (a/b) VIRTUAL;
+SET sql_mode = DEFAULT;
+--error ER_DIVISION_BY_ZERO
+CREATE INDEX idx ON t(c);
+SET sql_mode = '';
CREATE INDEX idx ON t(c);
+set sql_mode = DEFAULT;
CALL mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual column values failed");
DROP TABLE t;
}
diff --git a/mysql-test/suite/gcol/inc/gcol_select.inc b/mysql-test/suite/gcol/inc/gcol_select.inc
index efaffd5168d..632a0cca922 100644
--- a/mysql-test/suite/gcol/inc/gcol_select.inc
+++ b/mysql-test/suite/gcol/inc/gcol_select.inc
@@ -852,15 +852,19 @@ DROP TABLE t2, t3;
--disable_abort_on_error
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2147483647);
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL;
ALTER TABLE t1 DROP COLUMN b;
ALTER TABLE t1 ADD COLUMN c SMALLINT AS (a) VIRTUAL;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t1 ADD COLUMN d SMALLINT AS (a) VIRTUAL;
ALTER TABLE t1 DROP COLUMN d;
+SET sql_mode = DEFAULT;
ALTER TABLE t1 ADD COLUMN c INT AS(a) VIRTUAL;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 CHANGE c c SMALLINT AS(a) VIRTUAL;
ALTER TABLE t1 MODIFY c TINYINT AS(a) VIRTUAL;
+SET sql_mode = DEFAULT;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(a INT);
@@ -869,8 +873,10 @@ ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL;
ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY;
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED;
ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE;
+SET sql_mode = DEFAULT;
--enable_abort_on_error
DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc
index 88268ddd6c4..957940b8c99 100644
--- a/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/gcol/inc/gcol_supported_sql_funcs_main.inc
@@ -937,7 +937,9 @@ let $cols = a datetime, b datetime generated always as (last_day(a)) virtual;
let $values1 = '2003-02-05',default;
let $values2 = '2003-02-32',default;
let $rows = 2;
+set sql_mode = 'NO_ENGINE_SUBSTITUTION';
--source suite/gcol/inc/gcol_supported_sql_funcs.inc
+set sql_mode = DEFAULT;
--echo # MAKEDATE()
let $cols = a int, b datetime generated always as (makedate(a,1)) virtual;
@@ -1046,7 +1048,9 @@ let $rows = 1;
let $cols = a datetime, b datetime, c time generated always as (timediff(a,b)) virtual;
let $values1 = '2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default;
let $rows = 1;
+set sql_mode = 'NO_ENGINE_SUBSTITUTION';
--source suite/gcol/inc/gcol_supported_sql_funcs.inc
+set sql_mode = DEFAULT;
--echo # TIMESTAMP()
let $cols = a datetime, b timestamp generated always as (timestamp(a)) virtual;
diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
index f6d0830ee3d..15522f94c1e 100644
--- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
@@ -354,15 +354,19 @@ ERROR 42000: Can't DROP INDEX `PRIMARY`; check that it exists
DROP TABLE t1;
# Bug#20949226:i CAN ASSIGN NON-DEFAULT() VALUE TO GENERATED COLUMN
#
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5 AS c2;
Warnings:
Warning 1906 The value specified for generated column 'c2' in table 't1' ignored
+SET sql_mode = DEFAULT;
CREATE TABLE t2 (a int);
INSERT INTO t2 values(1);
DROP TABLE t1;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2;
Warnings:
Warning 1906 The value specified for generated column 'c2' in table 't1' ignored
+SET sql_mode = DEFAULT;
DROP TABLE t1;
CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5;
SELECT * FROM t1;
diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
index 192016ba8df..3c2e4d3dd0a 100644
--- a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
@@ -23,7 +23,7 @@ delete from t1;
select * from t1;
a b c
# INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols
-insert into t1 values (1,2,3);
+insert ignore into t1 values (1,2,3);
Warnings:
Warning 1906 The value specified for generated column 'b' in table 't1' ignored
Warning 1906 The value specified for generated column 'c' in table 't1' ignored
@@ -63,7 +63,7 @@ select * from t1;
a b c
# INSERT INTO tbl_name (<normal+gcols>) VALUES... a non-NULL value is specified
# against gcols
-insert into t1 (a,b) values (1,3), (2,4);
+insert ignore into t1 (a,b) values (1,3), (2,4);
Warnings:
Warning 1906 The value specified for generated column 'b' in table 't1' ignored
Warning 1906 The value specified for generated column 'b' in table 't1' ignored
@@ -151,7 +151,7 @@ select * from t1 order by a;
a b c
1 -1 -1
2 -2 -2
-update t1 set c=3 where a=2;
+update ignore t1 set c=3 where a=2;
Warnings:
Warning 1906 The value specified for generated column 'c' in table 't1' ignored
select * from t1 order by a;
@@ -181,7 +181,7 @@ select * from t1 order by a;
a b c
1 -1 -1
2 -2 -2
-update t1 set c=3 where b=-2;
+update ignore t1 set c=3 where b=-2;
Warnings:
Warning 1906 The value specified for generated column 'c' in table 't1' ignored
select * from t1 order by a;
diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
index b30eb709c47..4d62a5d7a82 100644
--- a/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_ins_upd_myisam.result
@@ -23,7 +23,7 @@ delete from t1;
select * from t1;
a b c
# INSERT INTO tbl_name VALUES... a non-NULL value is specified against gcols
-insert into t1 values (1,2,3);
+insert ignore into t1 values (1,2,3);
Warnings:
Warning 1906 The value specified for generated column 'b' in table 't1' ignored
Warning 1906 The value specified for generated column 'c' in table 't1' ignored
@@ -63,7 +63,7 @@ select * from t1;
a b c
# INSERT INTO tbl_name (<normal+gcols>) VALUES... a non-NULL value is specified
# against gcols
-insert into t1 (a,b) values (1,3), (2,4);
+insert ignore into t1 (a,b) values (1,3), (2,4);
Warnings:
Warning 1906 The value specified for generated column 'b' in table 't1' ignored
Warning 1906 The value specified for generated column 'b' in table 't1' ignored
@@ -151,7 +151,7 @@ select * from t1 order by a;
a b c
1 -1 -1
2 -2 -2
-update t1 set c=3 where a=2;
+update ignore t1 set c=3 where a=2;
Warnings:
Warning 1906 The value specified for generated column 'c' in table 't1' ignored
select * from t1 order by a;
@@ -181,7 +181,7 @@ select * from t1 order by a;
a b c
1 -1 -1
2 -2 -2
-update t1 set c=3 where b=-2;
+update ignore t1 set c=3 where b=-2;
Warnings:
Warning 1906 The value specified for generated column 'c' in table 't1' ignored
select * from t1 order by a;
@@ -549,7 +549,7 @@ a BLOB GENERATED ALWAYS AS ('') VIRTUAL,
b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL,
KEY (a(183),b)
);
-INSERT INTO t VALUES(), (), ();
+INSERT IGNORE INTO t VALUES(), (), ();
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b' at row 2
@@ -568,7 +568,7 @@ c1 YEAR GENERATED ALWAYS AS ('aaaa') STORED,
UNIQUE(b),
UNIQUE(b1)
);
-INSERT INTO t VALUES();
+INSERT IGNORE INTO t VALUES();
SELECT b from t;
b
2000
diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result
index a331b1d2154..9da6313abce 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result
@@ -706,9 +706,11 @@ INSERT INTO t(a) VALUES (1);
SELECT * FROM t WHERE c = '0';
a b c
1 127 0
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t ADD UNIQUE INDEX (c(1));
Warnings:
Warning 1264 Out of range value for column 'b' at row 1
+SET sql_mode = DEFAULT;
SELECT * FROM t WHERE c = '0';
a b c
1 127 0
@@ -722,7 +724,15 @@ INSERT INTO t VALUES (12, 3, "ss");
INSERT INTO t VALUES (13, 4, "ss");
INSERT INTO t VALUES (14, 0, "ss");
ALTER TABLE t ADD c INT GENERATED ALWAYS AS (a/b) VIRTUAL;
+ERROR 22012: Division by 0
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+ALTER TABLE t ADD c INT GENERATED ALWAYS AS (a/b) VIRTUAL;
+SET sql_mode = DEFAULT;
+CREATE INDEX idx ON t(c);
+ERROR 22012: Division by 0
+SET sql_mode = '';
CREATE INDEX idx ON t(c);
+set sql_mode = DEFAULT;
CALL mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual column values failed");
DROP TABLE t;
#
diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result
index 24daadb0d5b..61b86f55a96 100644
--- a/mysql-test/suite/gcol/r/gcol_select_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result
@@ -512,19 +512,23 @@ DROP TABLE t2, t3;
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2147483647);
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL;
ALTER TABLE t1 DROP COLUMN b;
ALTER TABLE t1 ADD COLUMN c SMALLINT AS (a) VIRTUAL;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t1 ADD COLUMN d SMALLINT AS (a) VIRTUAL;
ALTER TABLE t1 DROP COLUMN d;
+SET sql_mode = DEFAULT;
ALTER TABLE t1 ADD COLUMN c INT AS(a) VIRTUAL;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 CHANGE c c SMALLINT AS(a) VIRTUAL;
Warnings:
Warning 1264 Out of range value for column 'c' at row 1
ALTER TABLE t1 MODIFY c TINYINT AS(a) VIRTUAL;
Warnings:
Warning 1264 Out of range value for column 'c' at row 1
+SET sql_mode = DEFAULT;
SELECT * FROM t1;
a c
2147483647 127
@@ -537,6 +541,7 @@ ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED;
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
@@ -544,6 +549,7 @@ ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUS
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'g' at row 1
+SET sql_mode = DEFAULT;
DROP TABLE t1;
#
# Bug#21980430 GCOLS: CRASHING
diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result
index d5e4bdabb38..374bc6915b3 100644
--- a/mysql-test/suite/gcol/r/gcol_select_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result
@@ -1121,6 +1121,7 @@ DROP TABLE t2, t3;
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2147483647);
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL;
Warnings:
Warning 1264 Out of range value for column 'b' at row 1
@@ -1133,13 +1134,16 @@ ALTER TABLE t1 ADD COLUMN d SMALLINT AS (a) VIRTUAL;
Warnings:
Warning 1264 Out of range value for column 'd' at row 1
ALTER TABLE t1 DROP COLUMN d;
+SET sql_mode = DEFAULT;
ALTER TABLE t1 ADD COLUMN c INT AS(a) VIRTUAL;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 CHANGE c c SMALLINT AS(a) VIRTUAL;
Warnings:
Warning 1264 Out of range value for column 'c' at row 1
ALTER TABLE t1 MODIFY c TINYINT AS(a) VIRTUAL;
Warnings:
Warning 1264 Out of range value for column 'c' at row 1
+SET sql_mode = DEFAULT;
SELECT * FROM t1;
a c
2147483647 127
@@ -1152,6 +1156,7 @@ ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED;
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
@@ -1159,6 +1164,7 @@ ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUS
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'g' at row 1
+SET sql_mode = DEFAULT;
DROP TABLE t1;
#
# Bug#21980430 GCOLS: CRASHING
diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
index 25e07e450d9..a6032c74432 100644
--- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_innodb.result
@@ -273,10 +273,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values (2,default);
insert into t1 values (-2,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-2 NULL
2 0.693147
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# LOG()
@@ -292,11 +296,15 @@ t1 CREATE TABLE `t1` (
insert into t1 values (2,65536,default);
insert into t1 values (10,100,default);
insert into t1 values (1,100,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b c
1 100 NULL
10 100 2
2 65536 16
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
set sql_warnings = 1;
@@ -309,10 +317,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values (2,default);
insert into t1 values (-2,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-2 NULL
2 0.693147
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# LOG2()
@@ -326,10 +338,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values (65536,default);
insert into t1 values (-100,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-100 NULL
65536 16
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# LOG10()
@@ -344,11 +360,15 @@ t1 CREATE TABLE `t1` (
insert into t1 values (2,default);
insert into t1 values (100,default);
insert into t1 values (-100,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-100 NULL
100 2
2 0.30103
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# -
@@ -2254,6 +2274,7 @@ a b
drop table t1;
set sql_warnings = 0;
# LAST_DAY()
+set sql_mode = 'NO_ENGINE_SUBSTITUTION';
set sql_warnings = 1;
create table t1 (a datetime, b datetime generated always as (last_day(a)) virtual);
show create table t1;
@@ -2272,6 +2293,7 @@ a b
2003-02-05 00:00:00 2003-02-28 00:00:00
drop table t1;
set sql_warnings = 0;
+set sql_mode = DEFAULT;
# MAKEDATE()
set sql_warnings = 1;
create table t1 (a int, b datetime generated always as (makedate(a,1)) virtual);
@@ -2531,6 +2553,7 @@ a b
drop table t1;
set sql_warnings = 0;
# TIMEDIFF()
+set sql_mode = 'NO_ENGINE_SUBSTITUTION';
set sql_warnings = 1;
create table t1 (a datetime, b datetime, c time generated always as (timediff(a,b)) virtual);
show create table t1;
@@ -2546,6 +2569,7 @@ a b c
2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58
drop table t1;
set sql_warnings = 0;
+set sql_mode = DEFAULT;
# TIMESTAMP()
set sql_warnings = 1;
create table t1 (a datetime, b timestamp generated always as (timestamp(a)) virtual);
diff --git a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
index 03be01c3229..72f6d385353 100644
--- a/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_supported_sql_funcs_myisam.result
@@ -273,10 +273,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (2,default);
insert into t1 values (-2,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-2 NULL
2 0.693147
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# LOG()
@@ -292,11 +296,15 @@ t1 CREATE TABLE `t1` (
insert into t1 values (2,65536,default);
insert into t1 values (10,100,default);
insert into t1 values (1,100,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b c
1 100 NULL
10 100 2
2 65536 16
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
set sql_warnings = 1;
@@ -309,10 +317,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (2,default);
insert into t1 values (-2,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-2 NULL
2 0.693147
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# LOG2()
@@ -326,10 +338,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (65536,default);
insert into t1 values (-100,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-100 NULL
65536 16
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# LOG10()
@@ -344,11 +360,15 @@ t1 CREATE TABLE `t1` (
insert into t1 values (2,default);
insert into t1 values (100,default);
insert into t1 values (-100,default);
+Warnings:
+Warning 1365 Division by 0
select * from t1;
a b
-100 NULL
100 2
2 0.30103
+Warning 1365 Division by 0
+Warnings:
drop table t1;
set sql_warnings = 0;
# -
@@ -2254,6 +2274,7 @@ a b
drop table t1;
set sql_warnings = 0;
# LAST_DAY()
+set sql_mode = 'NO_ENGINE_SUBSTITUTION';
set sql_warnings = 1;
create table t1 (a datetime, b datetime generated always as (last_day(a)) virtual);
show create table t1;
@@ -2272,6 +2293,7 @@ a b
2003-02-05 00:00:00 2003-02-28 00:00:00
drop table t1;
set sql_warnings = 0;
+set sql_mode = DEFAULT;
# MAKEDATE()
set sql_warnings = 1;
create table t1 (a int, b datetime generated always as (makedate(a,1)) virtual);
@@ -2531,6 +2553,7 @@ a b
drop table t1;
set sql_warnings = 0;
# TIMEDIFF()
+set sql_mode = 'NO_ENGINE_SUBSTITUTION';
set sql_warnings = 1;
create table t1 (a datetime, b datetime, c time generated always as (timediff(a,b)) virtual);
show create table t1;
@@ -2546,6 +2569,7 @@ a b c
2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58
drop table t1;
set sql_warnings = 0;
+set sql_mode = DEFAULT;
# TIMESTAMP()
set sql_warnings = 1;
create table t1 (a datetime, b timestamp generated always as (timestamp(a)) virtual);
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result
index 38a13edd8fa..3ba7b8dc260 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_fk.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result
@@ -346,6 +346,10 @@ ON UPDATE CASCADE);
INSERT INTO t1 VALUES(1), (2);
INSERT INTO t2 VALUES(1, DEFAULT), (2, default);
UPDATE t1 SET fld1= 0 WHERE fld1= 2;
+ERROR 22012: Division by 0
+UPDATE IGNORE t1 SET fld1= 0 WHERE fld1= 2;
+Warnings:
+Warning 1365 Division by 0
SELECT fld2 FROM t2;
fld2
NULL
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk.test b/mysql-test/suite/gcol/t/innodb_virtual_fk.test
index bd8f3664839..37a2b871a00 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_fk.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_fk.test
@@ -290,8 +290,9 @@ CREATE TABLE t2(fld1 INT NOT NULL,
ON UPDATE CASCADE);
INSERT INTO t1 VALUES(1), (2);
INSERT INTO t2 VALUES(1, DEFAULT), (2, default);
-#--error ER_DIVISION_BY_ZERO
+--error ER_DIVISION_BY_ZERO
UPDATE t1 SET fld1= 0 WHERE fld1= 2;
+UPDATE IGNORE t1 SET fld1= 0 WHERE fld1= 2;
SELECT fld2 FROM t2;
DROP TABLE t2, t1;