• Konstantin Shaposhnikov's avatar
    pg: respect format codes from Bind message when sending results · 696a50ed
    Konstantin Shaposhnikov 提交于
    From https://www.postgresql.org/docs/9.1/static/protocol-message-formats.html:
    
      Bind (F)
    
      ...
    
      After the last parameter, the following fields appear:
    
      Int16
    
        The number of result-column format codes that follow (denoted R
        below). This can be zero to indicate that there are no result
        columns or that the result columns should all use the default
        format (text); or one, in which case the specified format code is
        applied to all result columns (if any); or it can equal the actual
        number of result columns of the query.
    
      Int16[R]
    
        The result-column format codes. Each must presently be zero (text)
        or one (binary).
    
    Also fix testBinaryTypes test:
    
    - force binary by setting prepareThreshold to -1
    - handle REAL type as float
    
    Without the fix the corrected test testBinaryTypes fails:
    
      05:25:02 21:55:02.666 org.h2.test.unit.TestPgServer Expected: 12345678 actual: 825373492
      Exception in thread "main" java.lang.AssertionError: Expected: 12345678 actual: 825373492
          at org.h2.test.TestBase.fail(TestBase.java:464)
          at org.h2.test.TestBase.assertEquals(TestBase.java:617)
          at org.h2.test.unit.TestPgServer.testBinaryTypes(TestPgServer.java:404)
          at org.h2.test.unit.TestPgServer.test(TestPgServer.java:51)
          at org.h2.test.unit.TestPgServer.main(TestPgServer.java:41)
    696a50ed
名称
最后提交
最后更新
..
.mvn/wrapper Loading commit data...
service Loading commit data...
src Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
MAVEN.md Loading commit data...
build.bat Loading commit data...
build.sh Loading commit data...
mvnw Loading commit data...
mvnw.cmd Loading commit data...
pom.xml Loading commit data...