You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
both ShardingSphere-JDBC and ShardingSphere-Proxy
Reproduce
enviroment:
mysql 5.7
shardingsphere 5.5.0
table: t_user
the following two sql, only the order by statement is differenet, but have diffenrent result;
order by fields is same with group by fields, returns no data
order by fields is different from group by fields, returns one row
they both should returns no data;
Reason analyze
when order by fields is differenet from group by fields, GroupByMemoryMergedResult will be used.
in GroupByMemoryMergedResult, if there is no data, it will try to generate one row, when select fields have count(1), it will renturn 0
The text was updated successfully, but these errors were encountered:
The issue contains only images, which is not conducive to search or code copying by contributors. Could you please recreate an new issue and describe it again using text and code?
Which version of ShardingSphere did you use?
5.5.0
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
both ShardingSphere-JDBC and ShardingSphere-Proxy
Reproduce
enviroment:
mysql 5.7
shardingsphere 5.5.0
table:
t_user
the following two sql, only the order by statement is differenet, but have diffenrent result;
order by fields is same with group by fields, returns no data
![image](https://private-user-images.githubusercontent.com/51293207/375599444-e480f979-66d2-4b38-a428-2155fb5daf43.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODg3NDIsIm5iZiI6MTczOTU4ODQ0MiwicGF0aCI6Ii81MTI5MzIwNy8zNzU1OTk0NDQtZTQ4MGY5NzktNjZkMi00YjM4LWE0MjgtMjE1NWZiNWRhZjQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAzMDA0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViYmY0ZjNlMzJlZmQzNDg4ODBlZjk3Y2Y5YzUzNWVhOTA4MDhmODlmYjE2Yzk4ZTBiYTU0NjQyODEyYzExZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.D4BV401Ts9l9bXI7uaZIBAV6pJFglcsz9gNZnq7m99M)
order by fields is different from group by fields, returns one row
![image](https://private-user-images.githubusercontent.com/51293207/375599110-d30d6e60-26b8-4342-a1dd-c585f6cff02c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODg3NDIsIm5iZiI6MTczOTU4ODQ0MiwicGF0aCI6Ii81MTI5MzIwNy8zNzU1OTkxMTAtZDMwZDZlNjAtMjZiOC00MzQyLWExZGQtYzU4NWY2Y2ZmMDJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAzMDA0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyOTQ0N2UyNDE1YWNiZWU3OTA3MDAxZjQzZTc3M2NhOWYyMjYzZmU4ZjA0NzkxZjk1OWZhMmFkMGVkNTBjZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.H4t1SBgR-eclTWgh8pxitSf-jlT9b-ymhuvh09pbI0Y)
they both should returns no data;
Reason analyze
when order by fields is differenet from group by fields, GroupByMemoryMergedResult will be used.
in GroupByMemoryMergedResult, if there is no data, it will try to generate one row, when select fields have count(1), it will renturn 0
The text was updated successfully, but these errors were encountered: