maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #12957
Re: d1ec0231553: MDEV-26732 Assertion `0' failed in Item::val_native
Hi, Alexander!
On Oct 25, Alexander Barkov wrote:
> revision-id: d1ec0231553 (mariadb-10.5.4-550-gd1ec0231553)
> parent(s): 8b115503563
> author: Alexander Barkov
> committer: Alexander Barkov
> timestamp: 2021-10-07 20:58:18 +0400
> message:
>
> MDEV-26732 Assertion `0' failed in Item::val_native
>
> Also fixes MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion
would be good to have some explanation here, what was wrong, what was
the fix.
> diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6.result b/plugin/type_inet/mysql-test/type_inet/type_inet6.result
> index da949481337..ac16f5c06ce 100644
> --- a/plugin/type_inet/mysql-test/type_inet/type_inet6.result
> +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6.result
> @@ -2159,3 +2159,38 @@ IFNULL(c, '::1')
> ::1
> DROP TABLE t2;
> DROP TABLE t1;
> +#
> +# MDEV-26732 Assertion `0' failed in Item::val_native
> +#
> +SELECT CAST(CONCAT('::', REPEAT('',RAND())) AS INET6) AS f, var_pop('x') FROM dual HAVING f > '';
do you need RAND() here for a test case? can you replace it with a
literal?
do you need var_pop() here?
> +f var_pop('x')
> +Warnings:
> +Warning 1292 Truncated incorrect DOUBLE value: 'x'
> +Warning 1292 Incorrect inet6 value: ''
> +SELECT CAST(CONCAT('::', REPEAT('',RAND())) AS INET6) AS f, var_pop(1) FROM dual HAVING f >= '::';
> +f var_pop(1)
> +:: 0.0000
> +CREATE TABLE t1(id INET6 NOT NULL PRIMARY KEY, dsc INET6);
> +INSERT INTO t1 VALUES ('::1', '1::1'),('::3', '1::3'),('::4', NULL);
> +CREATE TABLE t2 SELECT COALESCE(t1.dsc), COUNT(*) FROM t1 GROUP BY t1.id;
> +SELECT * FROM t2 ORDER BY 1,2;
> +COALESCE(t1.dsc) COUNT(*)
> +NULL 1
> +1::1 1
> +1::3 1
> +DROP TABLE t1, t2;
> +#
> +# MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion
> +#
> +CREATE TABLE t1 (a INET6);
> +INSERT INTO t1 VALUES ('::'),('::');
> +SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
> +f
> +Warnings:
> +Warning 1292 Incorrect inet6 value: ''
> +SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::';
> +f
> +SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
> +f
> +::
> +DROP TABLE t1;
Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx
Follow ups