Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.2, 1.5.2
-
None
-
2020-7
Description
In working_dml/misc/subupd003.sql, we find the following query:
set autocommit=0;
UPDATE sub1 SET c2 = (SELECT SUM(sub2.c3) FROM sub2 where sub1.c1=sub2.c1);
// And to see what happened:
select * from sub1;
rollback;
In Columnstore 1.5 when run from clent, we get:
ERROR 1264 (22003): CAL0002: IDB-2025: Data truncated for column 'c2'
In columnstore 1.2 and in 1.5 when run in the test suite, we get:
---------------------------------+
c1 | c2 | c3 | s1 | s2 | s3 |
---------------------------------+
1 | -2147483646 | 1 | 1 | 1 | 1 |
2 | -2147483646 | 2 | 2 | 2 | 2 |
3 | -2 | 3 | 3 | 3 | 3 |
4 | -2 | 1 | 1 | 1 | 1 |
5 | -2 | 99 | 99 | 99 | 99 |
6 | -2147483646 | NULL | NULL | NULL | NULL |
---------------------------------+
This is incorrect. The correct answer is (gleaned from a reference innodb):
--------------------------+
c1 | c2 | c3 | s1 | s2 | s3 |
--------------------------+
1 | 6 | 1 | 1 | 1 | 1 |
2 | 9 | 2 | 2 | 2 | 2 |
3 | NULL | 3 | 3 | 3 | 3 |
4 | NULL | 1 | 1 | 1 | 1 |
5 | NULL | 99 | 99 | 99 | 99 |
6 | 2 | NULL | NULL | NULL | NULL |
--------------------------+