malachany opened a new issue, #30764:
URL: https://github.com/apache/shardingsphere/issues/30764

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   Tested in v5.41 and v5.4.2-SNAPSHOT
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Expected to return a list of recent chat_messages 
   ### Actual behavior
   
   In 5.41: `General error: 30000 Unknown exception: Cannot convert 
2022-09-14T18:25:06 to long`
   In 5.4.2-SNAPSHOT: `SQL federation doesn't support SQL`
   
   ### Reason analyze (If you can)
   
   It looks like the MAX(created_at) isn't working correctly, and instead of 
showing the max DATETIME, it's trying to convert it to LONG.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   This is the query:
   ```
   SELECT
     members.chat_id,
     mess_max.created_at message_sent
   FROM chats_members members 
   JOIN (
     SELECT
       MAX(id) max_id,
       chat_id,
       MAX(created_at) created_at
     FROM chats_messages
     GROUP BY chat_id
   ) mess_max on mess_max.chat_id = members.chat_id
   LEFT JOIN chats_messages_read_by_recipient is_read
     ON mess_max.max_id = is_read.chat_message_id AND is_read.created_by = 5094
   WHERE (members.user_id = 5094 OR members.group_id IN('13'))
     AND is_read.id IS NULL;
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to