Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Sharding-Proxy to insert orrcurs error when using JDBC PreparedStatement in backend database PostgreSQL #3419

Closed
haetao opened this issue Oct 31, 2019 · 8 comments

Comments

@haetao
Copy link
Contributor

haetao commented Oct 31, 2019

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response more than 7 days 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?

4.0.0-rc3

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-Proxy

Expected behavior

Successfully inserted a record

Actual behavior

No this record in table

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

- use database: postgresql
- sql to execute: INSERT INTO t_encrypt(pwd,content) VALUES(?,?)
- Statement: PreparedStatement

config:
微信截图_20191031104012

exception:
微信截图_20191031104221

Example codes for reproduce this issue (such as a github link).

DataSource source = DataSourceFactory.newRawJDBCDataSource() .dbType(DatabaseType.POSTGRESQL) .dataSourceName("MyEncrypt") .host("localhost") .port(3307) .userName("root") .password("root") .create(); Connection connection = source.getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO t_encrypt(pwd,content) VALUES(?,?)"); statement.setString(1,"password"); statement.setString(2,"this is encrypt test"); statement.executeUpdate();

@haetao haetao changed the title Using Sharding-Proxy to insert error when using PreparedStatement in backen database PostgreSQL Using Sharding-Proxy to insert error when using PreparedStatement in backend database PostgreSQL Oct 31, 2019
@haetao haetao changed the title Using Sharding-Proxy to insert error when using PreparedStatement in backend database PostgreSQL Using Sharding-Proxy to insert orrcurs error when using JDBC PreparedStatement in backend database PostgreSQL Oct 31, 2019
@RaigorJiang
Copy link
Contributor

I will try to reproduce this exception first.

@terrymanu
Copy link
Member

Thank you, I just assign to you.

@RaigorJiang
Copy link
Contributor

RaigorJiang commented Nov 15, 2019

Hi, here are current test results:

  1. use postgres 12.0 and the latest sharding-proxy, statement and prepared statement both can insert successful.
    (but the Response client got has some problem, we may discuss in another issue. )
  2. use postgres 12.0 and the proxy compiled from commit version 'ae2ede4bf01bb2cae6a89ae74d506c7fe338ea39' , ArrayIndexOutOfBoundsException occured.

@haetao can you try the latest sharding-proxy

@haetao
Copy link
Contributor Author

haetao commented Nov 15, 2019

Ok, I 'll try the latest Proxy later. Thank you!

@haetao
Copy link
Contributor Author

haetao commented Nov 19, 2019

Another error occured!!! @RaigorJiang
This error is the same as the one you sent to the mailing list.
org.postgresql.util.PSQLException: at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:120) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)

@RaigorJiang
Copy link
Contributor

Yes, it's a different error, let's open a new issue.

@RaigorJiang
Copy link
Contributor

Hi, @haetao , new issue is #3555.

can this issue be closed?

@haetao
Copy link
Contributor Author

haetao commented Nov 19, 2019

Yes! #3419 can be closed!

@haetao haetao closed this as completed Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants