Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5192

"Parameter value unbound" thrown when use PrepareStatement to getParamMetaData

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0.0
    • None
    • None
    • None

    Description

      I use QueryServer in phoenix 5.x version, Test code is as follows´╝Ü

      
      Connection connection = DriverManager.getConnection("jdbc:phoenix:thin:http://localhost:8765;serialization=PROTOBUF");
      
      PreparedStatement ptst = connection.prepareStatement("SELECT A.EVIDENCE_ID, A.APP_ID, A.APP_NAME FROM BIZ_DATA A JOIN EVIDENCE_AUTH_RECORD B ON A.EVIDENCE_ID=B.EVIDENCE_ID WHERE B.APP_ID in (?) AND A.APP_ID in (?)");
      
      ptst.setString(1, "1111");
      ptst.setString(2, "1234");
      
      ptst.executeQuery();
      

      this will throws Exception:
      ~
      java.lang.RuntimeException: java.sql.SQLException: ERROR 2004 (INT05): Parameter value unbound. Parameter at index 1 is unbound
      at org.apache.calcite.avatica.jdbc.JdbcMeta.propagate(JdbcMeta.java:700)
      at org.apache.calcite.avatica.jdbc.JdbcMeta.prepare(JdbcMeta.java:726)
      at org.apache.calcite.avatica.jdbc.PhoenixJdbcMeta.prepare(PhoenixJdbcMeta.java:54)
      at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:195)
      at org.apache.calcite.avatica.remote.Service$PrepareRequest.accept(Service.java:1215)
      at org.apache.calcite.avatica.remote.Service$PrepareRequest.accept(Service.java:1186)
      at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:94)
      at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46)
      at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:127)
      at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
      at org.eclipse.jetty.server.Server.handle(Server.java:534)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
      at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
      at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
      at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
      at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: java.sql.SQLException: ERROR 2004 (INT05): Parameter value unbound. Parameter at index 1 is unbound
      at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:518)
      at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
      at org.apache.phoenix.jdbc.PhoenixParameterMetaData.getParam(PhoenixParameterMetaData.java:89)
      at org.apache.phoenix.jdbc.PhoenixParameterMetaData.isSigned(PhoenixParameterMetaData.java:138)
      at org.apache.calcite.avatica.jdbc.JdbcMeta.parameters(JdbcMeta.java:276)
      at org.apache.calcite.avatica.jdbc.JdbcMeta.signature(JdbcMeta.java:288)
      at org.apache.calcite.avatica.jdbc.JdbcMeta.prepare(JdbcMeta.java:721)
      ... 21 more

      ~

      create table sql attached!

      Attachments

        1. CreateTable
          1 kB
          shining

        Activity

          People

            swaroopa Swaroopa Kadam
            shining shining
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: