pg: respect format codes from Bind message when sending results
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)
正在显示
请
注册
或者
登录
后发表评论