Skip to content

Commit

Permalink
Merge branch '10.0' into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cvicentiu committed Sep 20, 2017
2 parents 78f6f2b + 20d4cac commit c9e1112
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
28 changes: 28 additions & 0 deletions mysql-test/r/insert.result
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,31 @@ insert ignore into t1 values (1,12);
Warnings:
Warning 1062 Duplicate entry '1' for key 'f1'
DROP TABLE t1;
#
# MDEV-13290 Assertion Assertion `!is_set() || (m_status == DA_OK_BULK
# && is_bulk_op())' or `! is_set()' failed
#
SET @save_mode= @@sql_mode;
SET sql_mode= 'STRICT_ALL_TABLES';
CREATE TABLE t1 (f1 INT DEFAULT 0, f2 INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
REPLACE INTO v1 SET f2 = 1;
ERROR 22007: Truncated incorrect DOUBLE value: 'x'
SELECT * from t1;
f1 f2
drop view v1;
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = cast('' as decimal) WITH CHECK OPTION;
REPLACE INTO v1 SET f2 = 1;
ERROR 22007: Truncated incorrect DECIMAL value: ''
SELECT * from t1;
f1 f2
drop view v1;
SELECT 0,0 INTO OUTFILE 't1.txt';
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
LOAD DATA INFILE 't1.txt' INTO TABLE v1;
ERROR 22007: Truncated incorrect DOUBLE value: 'x'
SELECT * from t1;
f1 f2
drop view v1;
drop table t1;
SET @@sql_mode= @save_mode;
29 changes: 29 additions & 0 deletions mysql-test/t/insert.test
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,32 @@ insert ignore into t1 values (1,12) on duplicate key update f2=13;
set @@old_mode="";
insert ignore into t1 values (1,12);
DROP TABLE t1;

--echo #
--echo # MDEV-13290 Assertion Assertion `!is_set() || (m_status == DA_OK_BULK
--echo # && is_bulk_op())' or `! is_set()' failed
--echo #

SET @save_mode= @@sql_mode;
SET sql_mode= 'STRICT_ALL_TABLES';
CREATE TABLE t1 (f1 INT DEFAULT 0, f2 INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
--error ER_TRUNCATED_WRONG_VALUE
REPLACE INTO v1 SET f2 = 1;
SELECT * from t1;
drop view v1;
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = cast('' as decimal) WITH CHECK OPTION;
--error ER_TRUNCATED_WRONG_VALUE
REPLACE INTO v1 SET f2 = 1;
SELECT * from t1;
drop view v1;
SELECT 0,0 INTO OUTFILE 't1.txt';
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
--error ER_TRUNCATED_WRONG_VALUE
LOAD DATA INFILE 't1.txt' INTO TABLE v1;
SELECT * from t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.txt;
drop view v1;
drop table t1;
SET @@sql_mode= @save_mode;
3 changes: 3 additions & 0 deletions sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4730,6 +4730,9 @@ int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
main_view->view_name.str);
return(VIEW_CHECK_ERROR);
}
/* We check thd->error() because it can be set by conversion problem. */
if (thd->is_error())
return(VIEW_CHECK_ERROR);
return(VIEW_CHECK_OK);
}

Expand Down

0 comments on commit c9e1112

Please sign in to comment.