[Geoserver-users] Geoserver support for bit and uniqueidentifier field types in SQL Server ?

Hi list.

I’ve been looking into the limitations of using the field types “bit” (boolean) and “uniqueidentifier” (GUID) in SQL Server (2016), and publishing them via Geoserver (2.16.2).

We have had those limitations when displaying and editing them for a while in earlier versions, but it looks somewhat better in 2.16.2.

I’m using QGIS 3.10.3 as my testing client.

It seems that editing uniqueidentifiers (GUIDs) works, at least sometimes.

When I use Oracle JVM 1.8 for my Tomcat installation, it seems to work. It fails however with a java null pointer exception when I’m instead using AdoptOpenJDK JVM v 11.0.

Editing “bit” (boolean) type values still don’t work.

QGIS displays the value 1 as “true” (and 0 as “false”).

But when it’s edited, the entered raw value is sent in the transaction to Geoserver. I’ve tried both “false” and “0” (without quotes).

However, regardless of whether QGIS sends “0” or “false” to Geoserver, it always tries to update the SQL Server table field with the value “false”. I.e. it actively interprets “0” as “false”.

But this is unfortunately syntactically wrong. Bit values in SQL Server only have values 0 and 1.

Can anyone verify these findings ?

Med venlig hilsen

Lars I. Nielsen, LIFA A/S
GIS-kons., FME+Python Certified Professional
Geoinformatik

image002.png

···


T



6313 6800



@



lin@anonymised.com0084…



D



6313 6849



W



www.lifa.dk



M



CVR



20937289


Følg os på LinkedIn og læs de seneste nyheder fra LIFA A/S

From a quick glance it looks to be handled in the base FilterToSQL writeLiteral function (https://github.com/geotools/geotools/blob/master/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/FilterToSQL.java#L1512) it would need the SQLServerFilterToSQL to add an exception to it’s write literal function - https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerFilterToSQL.java#L176

Ian

image001.gif

image002.png

···

Ian Turton