You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "ytrlmy521 (via GitHub)" <gi...@apache.org> on 2023/05/27 07:39:43 UTC
[GitHub] [shardingsphere] ytrlmy521 opened a new issue, #25913: Using JPA queries, the following statement limit fails
ytrlmy521 opened a new issue, #25913:
URL: https://github.com/apache/shardingsphere/issues/25913
When I upgrade the compile "io.shardingsphere:sharding-jdbc-spring-boot-starter version from 3.0.0 to 3.1.0, all my previous pagination is invalid, and the data found by the limit is wrong, but if I don't upgrade the version, the same SQL will prompt syntax and the like that are not compatible with sharding, please help give a reply
使用版本:compile "io.shardingsphere:sharding-jdbc-spring-boot-starter:3.1.0"
1. The following statement: limit invalidates
select * from ad_space s where (:openDate = '' OR (:openDate BETWEEN s.start_time AND s.end_time) OR (s.start_time is null and :openDate <= s.end_time) ) and s.ad_id = :adId and s.deleted = 0 order by start_time desc,end_time desc **limit :page,:size**
2. In the following statement, the given value of limit takes effect
select * from ad_space s where (:openDate = '' OR (:openDate BETWEEN s.start_time AND s.end_time) OR (s.start_time is null and :openDate <= s.end_time) ) and s.ad_id = :adId and s.deleted = 0 order by start_time desc,end_time desc **limit 100,10**
3.use this version ------》compile "io.shardingsphere:sharding-jdbc-spring-boot-starter:3.0.0" limit takes effect
--
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] ytrlmy521 commented on issue #25913: Using JPA queries, the following statement limit fails
Posted by "ytrlmy521 (via GitHub)" <gi...@apache.org>.
ytrlmy521 commented on issue #25913:
URL: https://github.com/apache/shardingsphere/issues/25913#issuecomment-1566408194
> Hi @ytrlmy521 , use version `5.3.2`, it could be cleaner and simpler, refer to [JDBC Driver - Spring Boot](https://shardingsphere.apache.org/document/5.3.2/en/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/spring-boot/) for more details.
thank you for replay,Can you give me an official 5.3.2 demo link, I want to configure tables and separate services for reading and writing,Please @strongduanmu @sandynz
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on issue #25913: Using JPA queries, the following statement limit fails
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25913:
URL: https://github.com/apache/shardingsphere/issues/25913#issuecomment-1566363598
Hi @ytrlmy521 , use version `5.3.2`, it could be cleaner and simpler, refer to [JDBC Driver - Spring Boot]( https://shardingsphere.apache.org/document/5.3.2/en/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/spring-boot/ ) for more details.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] ytrlmy521 commented on issue #25913: Using JPA queries, the following statement limit fails
Posted by "ytrlmy521 (via GitHub)" <gi...@apache.org>.
ytrlmy521 commented on issue #25913:
URL: https://github.com/apache/shardingsphere/issues/25913#issuecomment-1566410952
> > Hi @ytrlmy521 , use version `5.3.2`, it could be cleaner and simpler, refer to [JDBC Driver - Spring Boot](https://shardingsphere.apache.org/document/5.3.2/en/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/spring-boot/) for more details.
>
> thank you for replay,Can you give me an official 5.3.2 demo link, I want to configure tables and separate services for reading and writing,Please @strongduanmu @sandynz
And I want to integrate directly with springboot-start, 5.3.2 need to manually switch the data source?
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] ytrlmy521 commented on issue #25913: Using JPA queries, the following statement limit fails
Posted by "ytrlmy521 (via GitHub)" <gi...@apache.org>.
ytrlmy521 commented on issue #25913:
URL: https://github.com/apache/shardingsphere/issues/25913#issuecomment-1565924967
> Hi @ytrlmy521, can you try latest 5.3.2? 3.x is too old.
ok,thank you for reply,But when I execute this simple SQL statement, an error is reported again. I did not use any keywords, and the execution on the mysql terminal is completely successful.
version:5.1.1 ` implementation 'org.apache.shardingsphere:shardingsphere-jdbc-core-spring-boot-starter:5.1.1'`
SQL:`select admaterial0_.id as id1_2_, admaterial0_.created_by as created_2_2_, admaterial0_.created_time as created_3_2_, admaterial0_.deleted as deleted4_2_, admaterial0_.deleted_time as deleted_5_2_, admaterial0_.updated_by as updated_6_2_, admaterial0_.updated_time as updated_7_2_, admaterial0_.ad_type_id as ad_type_8_2_, admaterial0_.advertiser_id as advertis9_2_, admaterial0_.android_media_url as android10_2_, admaterial0_.bit_rate as bit_rat11_2_, admaterial0_.duration as duratio12_2_, admaterial0_.full_url as full_ur13_2_, admaterial0_.horizontal_resolution as horizon14_2_, admaterial0_.ios_media_url as ios_med15_2_, admaterial0_.link as link16_2_, admaterial0_.link_param as link_pa17_2_, admaterial0_.link_type as link_ty18_2_, admaterial0_.media_fail as media_f19_2_, admaterial0_.media_file_md5 as media_f20_2_, admaterial0_.media_id as media_i21_2_, admaterial0_.media_url as media_u22_2_, admaterial0_.name as name23_2_, admaterial0_.remarks as remarks24_2_, admaterial0_
.skip as skip25_2_, admaterial0_.upload_type as upload_26_2_, admaterial0_.vertical_resolution as vertica27_2_ from ad_material admaterial0_ where admaterial0_.media_fail=0 and admaterial0_.deleted=0 and (admaterial0_.media_url is null) and (admaterial0_.media_id is not null)`
@strongduanmu
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on issue #25913: Using JPA queries, the following statement limit fails
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25913:
URL: https://github.com/apache/shardingsphere/issues/25913#issuecomment-1567120828
You could have a look at [Quick Start]( https://shardingsphere.apache.org/document/5.3.2/en/quick-start/ ), there's `examples` directory in source code.
> 5.3.2 need to manually switch the data source?
I think not, just define ShardingSphere data source and use it, similar with connection pool.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #25913: Using JPA queries, the following statement limit fails
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25913:
URL: https://github.com/apache/shardingsphere/issues/25913#issuecomment-1565269908
Hi @ytrlmy521, can you try latest 5.3.2? 3.x is too old.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Using JPA queries, the following statement limit fails [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #25913: Using JPA queries, the following statement limit fails
URL: https://github.com/apache/shardingsphere/issues/25913
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org