peachyy commented on issue #24207:
URL: 
https://github.com/apache/shardingsphere/issues/24207#issuecomment-1551152589

   I had the same problem 。version shardingsphere 5.1.1 
   at sql column  subquery `(SELECT count(1) FROM con_article_likes WHERE 
user_id = ? AND art_id = t2.art_id AND con_article_likes.tenant_id = '1') AS 
artIsLike`  current is  SubqueryProjection
   
   ---------screenshot-----------
   
   
![1684319538686](https://github.com/apache/shardingsphere/assets/8952611/5b6ce49b-9cd1-4e43-9f46-66958938d9ad)
   
   
   ----------------sql -------------
   
   `
   Actual SQL: s1 :::  SELECT * FROM (SELECT t1.link_id AS linkId, t1.type AS 
rType, t2.art_id, t2.type AS artType, t2.keyword AS artKeyword, t2.title AS 
artTitle, t2.summary AS artSummary, t2.user_id AS artUserId, t2.content AS 
artConetent, t2.share_count AS artShareCount, (t2.views_count_base) AS 
artViewsCount, t2.comment_count AS artCommentcount, (t2.likes_count_base) AS 
artLikesCount, t2.collect_count AS artCollectCount, t2.publish_time AS 
artPublishTime, t2.create_time AS artCreateTime, t2.special_topic_id AS 
artSpecialTopicId, t2.special_topic_title AS artSpecialTopicTitle, 
t2.is_special_topic AS artIsSpecialTopic, t2.video_url AS artVideoUrl, 
t2.video_time AS artVideoTime, t2.pics AS artPics, (SELECT count(1) FROM 
con_article_likes WHERE user_id = ? AND art_id = t2.art_id AND 
con_article_likes.tenant_id = '1') AS artIsLike, t3.posts_id AS postsId, 
t3.plate AS postsPlate, t3.topic_id AS postsTopicId, t4.`name` AS 
postsTopicName, t3.circle_id AS postsCircleId, t3.user_id AS post
 sUserId, t3.type AS postsType, t3.keywords AS postsKeywords, t3.title AS 
postsTitle, t3.content AS postsContent, t3.pics AS postsPics, t3.is_publish AS 
postsIsPublish, t3.publish_time AS postsPublishTime, t3.create_time AS 
postsCreateTime, t3.share_count AS postsShareCount, t3.views_count_base AS 
postsViewsCount, t3.comment_count AS postsCommentCount, t3.likes_count_base AS 
postsLikesCount, t3.collect_count AS postsCollectCount, t3.is_recommend AS 
postsIsRecommend, t3.is_top AS postsIsTop, t3.is_good AS postsIsGood, 
t3.is_check AS postsIsCheck, t3.is_hot AS postsIsHot, t3.is_private AS 
postsIsPrivate, t3.video_url AS postsVideoUrl, t3.video_time AS postsVideoTime, 
(SELECT count(1) FROM con_posts_likes WHERE user_id = ? AND posts_id = 
t3.posts_id AND con_posts_likes.tenant_id = '1') AS postsIsLike, t1.title AS 
title, t1.pic AS pic, t3.city AS city, t3.province AS province, t3.city_code AS 
cityCode, t3.province_code AS provinceCode, t3.lon AS lon, t3.lat AS lat, 
t3.address AS address,
  t1.pic AS activityImgUrl, t1.sort_order, t1.create_time, (if(find_in_set(?, 
t1.car_group_code) > 0, 1, 0) + ?) AS car_group_code_order FROM con_recommend 
t1 LEFT JOIN con_article t2 ON t1.link_id = t2.art_id AND t2.tenant_id = '1' 
LEFT JOIN con_posts t3 ON t1.link_id = t3.posts_id AND t3.tenant_id = '1' LEFT 
JOIN con_posts_topic t4 ON t4.topic_id = t3.topic_id AND t1.type = 2 AND 
t4.tenant_id = '1' WHERE ((t1.type = 1 AND t2.is_deleted = 0 AND t2.status = 1 
AND t2.is_special_topic = 0 AND t2.check_sataus = 1) OR (t1.type = 2 AND 
t3.is_deleted = 0 AND t3.is_private = 1 AND t3.is_check = 1)) AND t1.tenant_id 
= '1') temp ORDER BY temp.sort_order DESC, temp.create_time DESC LIMIT ?, ?    
::: [null, null, null, null, 0, 10
   `


-- 
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