[BUG] STAsBinary returns null
for single point
#1073
Labels
Bug
A bug in the driver. A high priority item that one can expect to be addressed quickly.
Driver version
7.3.0.jre-8-preview
SQL Server version
Microsoft SQL Server 2017 (RTM-CU15) (KB4498951) - 14.0.3162.1 (X64)
May 15 2019 19:14:30
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 16.04.6 LTS)
Client Operating System
Mac OS X
JAVA/JVM version
1.8.0
Table schema
CREATE TABLE points (location GEOGRAPHY)
Problem description
STAsBinary()
returnsnull
for single point values.The problem is
STAsBinary()
always returns value ofwkbNoZM
field but if a Geography variable represents a single point thenserializeToWkb
writes towkb
field andwkbNoZM
staysnull
. Here's relevant code in the drivermssql-jdbc/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSpatialDatatype.java
Line 141 in b2ecbdc
JDBC trace logs
Reproduction code
The text was updated successfully, but these errors were encountered: