Bug #69891 | since 5.1.31 REPLACE() function concats it's results under certain conditions | ||
---|---|---|---|
Submitted: | 1 Aug 2013 6:33 | ||
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.1.31 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression, REPLACE |
[1 Aug 2013 6:33]
Shane Bester
[17 May 2014 8:51]
MySQL Verification Team
still affects 5.7.5....
[18 Sep 2014 21:25]
MySQL Verification Team
This haunts my highspeed random tests. consider this testcase: ------- drop table if exists t1; create table t1(c int)engine=innodb; insert into t1 values (1),(1),(1),(1),(1); select @@global.max_allowed_packet as a, version() as v; select 1 from t1 where replace(now(),0,cast(c is null as datetime)); ------- mysql> select @@global.max_allowed_packet as a, version() as v; +---------+-----------+ | a | v | +---------+-----------+ | 1048576 | 5.7.6-m16 | +---------+-----------+ 1 row in set (0.00 sec) mysql> select 1 from t1 where replace(now(),0,cast(c is null as datetime)); +---+ | 1 | +---+ | 1 | | 1 | | 1 | | 1 | +---+ 4 rows in set, 1 warning (3.17 sec) mysql> mysql> show warnings; +---------+------+------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------------------------------------------+ | Warning | 1301 | Result of replace() was larger than max_allowed_packet (1048576) - truncated | +---------+------+------------------------------------------------------------------------------+ 1 row in set (0.00 sec)