From 5f678665210cd0bf3d5ab36120573f79906a807e Mon Sep 17 00:00:00 2001 From: Minglei Tu Date: Tue, 7 Feb 2017 21:46:26 +0800 Subject: [PATCH] fix #327 - Null string-literals not working within Arrays --- .../scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala | 2 +- .../scala/com/github/tminglei/slickpg/PgArraySupportSuite.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala b/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala index 80b7d6a7..2fbbcf3b 100644 --- a/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala +++ b/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala @@ -94,7 +94,7 @@ object PgTokenHelper { /// def isMarkRequired(token: Token): Boolean = token match { case g: GroupToken => true - case Chunk(v) => v.trim.isEmpty || v.find(MARK_REQUIRED_CHAR_LIST.contains).isDefined + case Chunk(v) => v.trim.isEmpty || "NULL".equalsIgnoreCase(v) || v.find(MARK_REQUIRED_CHAR_LIST.contains).isDefined case _ => false } diff --git a/src/test/scala/com/github/tminglei/slickpg/PgArraySupportSuite.scala b/src/test/scala/com/github/tminglei/slickpg/PgArraySupportSuite.scala index c798f3d4..4f308487 100644 --- a/src/test/scala/com/github/tminglei/slickpg/PgArraySupportSuite.scala +++ b/src/test/scala/com/github/tminglei/slickpg/PgArraySupportSuite.scala @@ -72,7 +72,7 @@ class PgArraySupportSuite extends FunSuite { val uuid2 = UUID.randomUUID() val uuid3 = UUID.randomUUID() - val testRec1 = ArrayBean(33L, List(101, 102, 103), Buffer(1L, 3L, 5L, 7L), List(1,7), List("robert}; drop table students--"), + val testRec1 = ArrayBean(33L, List(101, 102, 103), Buffer(1L, 3L, 5L, 7L), List(1,7), List("robert}; drop table students--", "NULL"), Some(Vector("str1", "str3", "", " ")), List(uuid1, uuid2), List(Institution(113)), None) val testRec2 = ArrayBean(37L, List(101, 103), Buffer(11L, 31L, 5L), Nil, List(""), Some(Vector("str11", "str3")), List(uuid1, uuid2, uuid3), List(Institution(579)), Some(List(MarketFinancialProduct("product1"))))