Hello Bar,
Alexander Barkov a écrit, Le 23.06.2010 09:40:
> #At file:///home/bar/mysql-bzr/mysql-trunk-bugfixing-b52159/ based on
> revid:alik@ibmvm-20100621075643-rs6obfu871hdbiik
>
> 3064 Alexander Barkov 2010-06-23
> Bug#52159 returning time type from function and empty left join causes debug
> assertion
>
> Problem: Item_copy did not set "fixed", which resulted in DBUG_ASSERT in some
> cases.
> Fix: adding initialization of the "fixed" member
>
> Adding tests:
> mysql-test/include/ctype_numconv.inc
> mysql-test/r/ctype_binary.result
> mysql-test/r/ctype_cp1251.result
> mysql-test/r/ctype_latin1.result
> mysql-test/r/ctype_ucs.result
>
> Adding initialization of the "fixed" member:
> sql/item.h
>
> === modified file 'mysql-test/include/ctype_numconv.inc'
> --- a/mysql-test/include/ctype_numconv.inc 2010-05-14 05:28:51 +0000
> +++ b/mysql-test/include/ctype_numconv.inc 2010-06-23 07:39:00 +0000
> @@ -1606,3 +1606,21 @@ drop function f1;
> --echo # End of WL#2649 Number-to-string conversions
> --echo #
>
> +--echo #
> +--echo # Bug#52159 returning time type from function and empty left join causes
> debug assertion
> +--echo #
> +CREATE FUNCTION f1() RETURNS TIME RETURN 1;
> +CREATE TABLE t1 (b INT);
> +INSERT INTO t1 VALUES (0);
> +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a;
> +DROP FUNCTION f1;
> +DROP TABLE t1;
> +
> +SET NAMES latin1;
> +SET sql_mode='';
> +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a));
> +INSERT INTO t1 VALUES ();
> +--disable_warnings
> +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1;
> +--enable_warnings
> +DROP TABLE t1;
Good that you committed both testcases.
Do you need to reset charset and sql_mode at the end of the test?
> === modified file 'sql/item.h'
> --- a/sql/item.h 2010-06-02 12:23:50 +0000
> +++ b/sql/item.h 2010-06-23 07:39:00 +0000
> @@ -2791,6 +2791,7 @@ protected:
> cached_field_type= item->field_type();
> cached_result_type= item->result_type();
> unsigned_flag= item->unsigned_flag;
> + fixed= item->fixed;
> }
>
> public:
Ok to push.
My curiosity: do you have an idea why this bug started happening at this
push:
bar@stripped
WL#2649 Number-to-string conversions
in trunk, but your fix rather touches 5.1 code?