Description:
In different partition tables, the precision of division is inconsistent.
mysql> create table bug22555 (id smallint, s1 smallint, s2 smallint, o1 double, o2 double, e1 decimal, e2 decimal) engine=innodb
-> partition by key(id) partitions 10;
Query OK, 0 rows affected (0.59 sec)
mysql> insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
Query OK, 3 rows affected (0.02 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select STD(s1/s2) from bug22555;
+---------------------+
| STD(s1/s2) |
+---------------------+
| 0.21325763593256278 |
+---------------------+
1 row in set (0.00 sec)
mysql> select STD(e1/e2) from bug22555;
+---------------------+
| STD(e1/e2) |
+---------------------+
| 0.21325763593256278 |
+---------------------+
1 row in set (0.00 sec)
mysql> drop table bug22555;
Query OK, 0 rows affected (0.31 sec)
mysql> create table bug22555 (id smallint, s1 smallint, s2 smallint, o1 double, o2 double, e1 decimal, e2 decimal) engine=innodb
-> partition by key(id) partitions 8;
Query OK, 0 rows affected (0.39 sec)
mysql> insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
Query OK, 3 rows affected (0.02 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select STD(s1/s2) from bug22555;
+--------------------+
| STD(s1/s2) |
+--------------------+
| 0.2132576359325628 |
+--------------------+
1 row in set (0.00 sec)
mysql> select STD(e1/e2) from bug22555;
+--------------------+
| STD(e1/e2) |
+--------------------+
| 0.2132576359325628 |
+--------------------+
1 row in set (0.00 sec)
IN partition 8, the results of S1 and S2 have different precision.
How to repeat:
source test:
let $i=11;
while ($i > 0)
{
eval
create table bug22555 (i smallint, s1 smallint, s2 smallint, o1 double, o2 double, e1 decimal, e2 decimal) engine=innodb
partition by key(i) partitions $i;
insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
select std(s1/s2) from bug22555; #error
select std(e1/e2) from bug22555; #error
drop table bug22555;
dec $i;
}