stonedb icon indicating copy to clipboard operation
stonedb copied to clipboard

bug: Executing count(distinct) SQL statements causes service crashes

Open TomeC opened this issue 10 months ago • 0 comments

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • [X] I confirm there is no existing issue for this

Describe the problem

mysql> SELECT "count(distinct 17)_test1", count(distinct d1),count(distinct d2),count(distinct d3) FROM cs1; ERROR 2013 (HY000): Lost connection to MySQL server during query

service crashed

Expected behavior

The service runs normally and returns the correct result

How To Reproduce

USE test;
CREATE TABLE cs1 (d1 DECIMAL(17), d2 DECIMAL(17,10), d3 DECIMAL(17,16), d4 DECIMAL(17),d5 DECIMAL(17),i1 INT) ;
INSERT INTO cs1 VALUES
    (1234,5678,-0.123456789012345,2,1,1),     
    (1234,-5678,0.12345678901234,2,1,1),
    (1234567890123,123456.90123,0.12345678901234,2,1,1),
    (NULL,NULL,NULL,2,1,1),
    (0,0,0,2,1,1),
    (1234,5678,0.123456789,3,2,2),
    (-12345678923,-5678,0.1234567890121,3,2,2),
    (56789012,123856.90,0.12345678909,3,2,2),
    (NULL,NULL,NULL,3,2,2),
    (0,0,0,3,2,2),
    (1234,5678,-0.123456789012345,1111111111,1,1),
    (1234,5678,-0.123456789012345,1111111111,1,1),
    (1234,5678,-0.123456789012345,1111111112,1,1); 

mysql> SELECT "count(distinct 17)_test1", count(distinct d1),count(distinct d2),count(distinct d3) FROM cs1

ERROR 2013 (HY000): Lost connection to MySQL server during query

Environment

centos7 branch stonedb-5.7-dev

Are you interested in submitting a PR to solve the problem?

  • [x] Yes, I will!

TomeC avatar Aug 18 '23 08:08 TomeC