Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Decode OIDs as Long #62

Merged
merged 2 commits into from
Nov 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ object ColumnTypes {
final val IntervalArray = 1187
final val Boolean = 16
final val BooleanArray = 1000
final val OID = 26
final val OIDArray = 1028

final val ByteA = 17
final val ByteA_Array = 1001

final val OIDArray = 1028
final val MoneyArray = 791
final val NameArray = 1003
final val UUIDArray = 2951
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class PostgreSQLColumnDecoderRegistry( charset : Charset = CharsetUtil.UTF_8 ) e
case ColumnTypes.Integer => IntegerEncoderDecoder
case IntegerArray => this.integerArrayDecoder

case OID => LongEncoderDecoder
case OIDArray => this.longArrayDecoder

case ColumnTypes.Numeric => BigDecimalEncoderDecoder
case NumericArray => this.bigDecimalArrayDecoder

Expand Down Expand Up @@ -103,7 +106,6 @@ class PostgreSQLColumnDecoderRegistry( charset : Charset = CharsetUtil.UTF_8 ) e
case Interval => PostgreSQLIntervalEncoderDecoder
case IntervalArray => this.intervalArrayDecoder

case OIDArray => this.stringArrayDecoder
case MoneyArray => this.stringArrayDecoder
case NameArray => this.stringArrayDecoder
case UUIDArray => this.stringArrayDecoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper {
time_column time,
boolean_column boolean,
constraint bigserial_column_pkey primary key (bigserial_column)
)"""
) with oids"""

val insert = """insert into type_test_table (
smallint_column,
Expand Down Expand Up @@ -83,7 +83,7 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper {
)
"""

val select = "select * from type_test_table"
val select = "select *, oid from type_test_table"

val preparedStatementCreate = """create temp table prepared_statement_test (
id bigserial not null,
Expand Down Expand Up @@ -151,6 +151,8 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper {
row(10) === DateEncoderDecoder.decode("1984-08-06")
row(11) === TimeEncoderDecoder.Instance.decode("22:13:45.888888")
row(12) === true
row(13) must beAnInstanceOf[java.lang.Long]
row(13).asInstanceOf[Long] must beGreaterThan(0L)


}
Expand Down