← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 0319ee58fbb: MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or `! is_set()' failed

 

Hi Sanja,

The patch looks OK for me. Please find one suggestion below:


On 09/19/2017 05:56 PM, Oleksandr Byelkin wrote:
> revision-id: 0319ee58fbb6372ccc8533613e0c55666abc948a (mariadb-10.0.32-32-g0319ee58fbb)
> parent(s): 389f7cdf3ccd11a6b4fb9b6346436790254e615c
> author: Oleksandr Byelkin
> committer: Oleksandr Byelkin
> timestamp: 2017-09-19 15:55:59 +0200
> message:
> 
> MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or `! is_set()' failed
> 
> Check error status which can be set by conversion procedures.
> 
> ---
>  mysql-test/r/insert.result | 22 ++++++++++++++++++++++
>  mysql-test/t/insert.test   | 26 ++++++++++++++++++++++++++
>  sql/table.cc               |  3 +++
>  3 files changed, 51 insertions(+)
> 
> diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
> index 82f3977e231..0efee36e22d 100644
> --- a/mysql-test/r/insert.result
> +++ b/mysql-test/r/insert.result
> @@ -717,3 +717,25 @@ 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'
> +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: ''
> +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'
> +drop view v1;
> +drop table t1;
> +SET @@sql_mode= @save_mode;
> diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
> index ff8396fd7fd..d84c0cee90d 100644
> --- a/mysql-test/t/insert.test
> +++ b/mysql-test/t/insert.test
> @@ -573,3 +573,29 @@ 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;

Can you please add "SELECT * FROM t1" here and some other places (see
below), to make sure that REPLACE did not actually insert new records.
Please see my comments in MDEV.

> +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;

Please add "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;

Please add "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;
> diff --git a/sql/table.cc b/sql/table.cc
> index 975d9d53882..ff9c4217b7d 100644
> --- a/sql/table.cc
> +++ b/sql/table.cc
> @@ -4642,6 +4642,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);
>  }
>  
> _______________________________________________
> commits mailing list
> commits@xxxxxxxxxxx
> https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits
>