<p dir="auto">The client thread stuck when there have a "重复键违反唯一约束" exception.</p>
<p dir="auto">version: shardingsphere-proxy 5.0.0</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import (
	&quot;fmt&quot;
	&quot;gorm.io/driver/postgres&quot;
	&quot;gorm.io/gorm&quot;
	&quot;testing&quot;
)
func TestShardingSphereTransactionRollback(t *testing.T) {
	dsn := &quot;host=127.0.0.1 user=sharding password=sharding dbname=sharding_db port=3307&quot; +
		&quot; sslmode=disable TimeZone=Asia/Shanghai client_encoding=UTF8&quot;
	db, err := gorm.Open(postgres.Open(dsn), &amp;gorm.Config{})
	if err != nil {
		fmt.Println(err)
		return
	}

	db.Debug().Exec(&quot;insert into t_order(user_id,order_id,info) values(12,12,'9')&quot;)
}"><pre class="notranslate"><code class="notranslate">import (
	"fmt"
	"gorm.io/driver/postgres"
	"gorm.io/gorm"
	"testing"
)
func TestShardingSphereTransactionRollback(t *testing.T) {
	dsn := "host=127.0.0.1 user=sharding password=sharding dbname=sharding_db port=3307" +
		" sslmode=disable TimeZone=Asia/Shanghai client_encoding=UTF8"
	db, err := gorm.Open(postgres.Open(dsn), &amp;gorm.Config{})
	if err != nil {
		fmt.Println(err)
		return
	}

	db.Debug().Exec("insert into t_order(user_id,order_id,info) values(12,12,'9')")
}
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13001038/141931696-72edbd57-2ad7-4213-93a8-de2f4ce30434.png"><img src="https://user-images.githubusercontent.com/13001038/141931696-72edbd57-2ad7-4213-93a8-de2f4ce30434.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13001038/141777535-25c19d6b-6225-4beb-9e7e-a9d44104beca.png"><img src="https://user-images.githubusercontent.com/13001038/141777535-25c19d6b-6225-4beb-9e7e-a9d44104beca.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Thanks for using Atomikos! Evaluate <a href="http://www.atomikos.com/Main/ExtremeTransactions" rel="nofollow">http://www.atomikos.com/Main/ExtremeTransactions</a> for advanced features and professional support<br>
or register at <a href="http://www.atomikos.com/Main/RegisterYourDownload" rel="nofollow">http://www.atomikos.com/Main/RegisterYourDownload</a> to disable this message and receive FREE tips &amp; advice<br>
[INFO ] 2021-11-15 19:44:40.995 [main] o.a.s.p.i.i.AbstractBootstrapInitializer - Database name is <code class="notranslate">PostgreSQL</code>, version is <code class="notranslate">9.2.24</code><br>
[INFO ] 2021-11-15 19:44:41.227 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy start success.<br>
Thanks for using Atomikos! Evaluate <a href="http://www.atomikos.com/Main/ExtremeTransactions" rel="nofollow">http://www.atomikos.com/Main/ExtremeTransactions</a> for advanced features and professional support<br>
or register at <a href="http://www.atomikos.com/Main/RegisterYourDownload" rel="nofollow">http://www.atomikos.com/Main/RegisterYourDownload</a> to disable this message and receive FREE tips &amp; advice<br>
[INFO ] 2021-11-15 19:48:02.450 [main] o.a.s.p.i.i.AbstractBootstrapInitializer - Database name is <code class="notranslate">PostgreSQL</code>, version is <code class="notranslate">9.2.24</code><br>
[INFO ] 2021-11-15 19:48:02.647 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy start success.<br>
[ERROR] 2021-11-15 19:49:19.360 [Connection-2-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur:<br>
org.postgresql.util.PSQLException: 错误: 重复键违反唯一约束"t_order_0_pkey"<br>
详细：键值"(order_id)=(12)" 已经存在<br>
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)<br>
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)<br>
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)<br>
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)<br>
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)<br>
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)<br>
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)<br>
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)<br>
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)<br>
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:1168)<br>
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)<br>
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)<br>
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.impl.ProxyStatementExecutorCallback.execute(ProxyStatementExecutorCallback.java:40)<br>
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:73)<br>
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:66)<br>
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:44)<br>
at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:85)<br>
at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:64)<br>
at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:101)<br>
at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.serialExecute(ExecutorEngine.java:87)<br>
at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:81)<br>
at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)<br>
at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:66)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:170)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:127)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:116)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.doExecute(ProxyLockEngine.java:103)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.execute(ProxyLockEngine.java:81)<br>
at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.execute(DatabaseCommunicationEngine.java:99)<br>
at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:55)<br>
at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:63)<br>
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)<br>
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)<br>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)<br>
at java.lang.Thread.run(Thread.java:748)<br>
Exception in thread "Connection-2-ThreadExecutor" java.lang.IllegalArgumentException: No enum constant org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLMessageSeverityLevel.错误<br>
at java.lang.Enum.valueOf(Enum.java:238)<br>
at org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLMessageSeverityLevel.valueOf(PostgreSQLMessageSeverityLevel.java:25)<br>
at org.apache.shardingsphere.proxy.frontend.postgresql.err.PostgreSQLErrPacketFactory.createErrorResponsePacket(PostgreSQLErrPacketFactory.java:75)<br>
at org.apache.shardingsphere.proxy.frontend.postgresql.err.PostgreSQLErrPacketFactory.newInstance(PostgreSQLErrPacketFactory.java:48)<br>
at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getErrorPacket(PostgreSQLCommandExecuteEngine.java:72)<br>
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.processException(CommandExecutorTask.java:108)<br>
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:75)<br>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)<br>
at java.lang.Thread.run(Thread.java:748)</p>
<p dir="auto">When I using Mybatis-plus PaginationInterceptor plugin, shardingsphere does not work, something wrong has happend. Track it down and find an error at here:<br>
org.apache.shardingsphere.core.optimize.sharding.segment.select.pagination.Pagination</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private int getValue(final PaginationValueSegment paginationValueSegment, final List&lt;Object&gt; parameters) {
        return paginationValueSegment instanceof ParameterMarkerPaginationValueSegment
                ? (int) parameters.get(((ParameterMarkerPaginationValueSegment) paginationValueSegment).getParameterIndex())
                : ((NumberLiteralPaginationValueSegment) paginationValueSegment).getValue();
    }"><pre class="notranslate"><code class="notranslate">private int getValue(final PaginationValueSegment paginationValueSegment, final List&lt;Object&gt; parameters) {
        return paginationValueSegment instanceof ParameterMarkerPaginationValueSegment
                ? (int) parameters.get(((ParameterMarkerPaginationValueSegment) paginationValueSegment).getParameterIndex())
                : ((NumberLiteralPaginationValueSegment) paginationValueSegment).getValue();
    }
</code></pre></div>
<p dir="auto">The Long type parameters of Pagination, such as Long total, Long pageNum, Long pageSize. and then throw an exception at "(int) parameters.get(((ParameterMarkerPaginationValueSegment)  ".<br>
Can someone help with that?</p>