diff --git a/queries_test.go b/queries_test.go index 679ae184..cf96ef25 100644 --- a/queries_test.go +++ b/queries_test.go @@ -135,6 +135,7 @@ func TestSelect(t *testing.T) { {"cast(cast('abc' as varchar(3)) as sql_variant)", "abc"}, {"cast(cast('abc' as char(3)) as sql_variant)", "abc"}, {"cast(N'abc' as sql_variant)", "abc"}, + {"cast('/' as hierarchyid)", []byte{}}, } for _, test := range values { @@ -1682,6 +1683,9 @@ func TestColumnTypeIntrospection(t *testing.T) { {"cast('abc' as char(3))", "CHAR", reflect.TypeOf(""), true, 3, false, 0, 0}, {"cast(N'abc' as nchar(3))", "NCHAR", reflect.TypeOf(""), true, 3, false, 0, 0}, {"cast(1 as sql_variant)", "SQL_VARIANT", reflect.TypeOf(nil), false, 0, false, 0, 0}, + {"geometry::STGeomFromText('LINESTRING (100 100, 20 180, 180 180)', 0)", "geometry", reflect.TypeOf([]byte{}), true, 2147483647, false, 0, 0}, + {"geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656 )', 4326)", "geograhy", reflect.TypeOf([]byte{}), true, 2147483647, false, 0, 0}, + {"cast('/1/2/3/' as hierarchyid)", "hierarchyid", reflect.TypeOf([]byte{}), true, 892, false, 0, 0}, } conn, logger := open(t) defer conn.Close()