@@ -1908,7 +1908,7 @@ func TestSchema(t *testing.T) {
1908
1908
if space .Engine != "memtx" {
1909
1909
t .Errorf ("space 616 engine should be memtx" )
1910
1910
}
1911
- if space .FieldsCount != 7 {
1911
+ if space .FieldsCount != 8 {
1912
1912
t .Errorf ("space 616 has incorrect fields count" )
1913
1913
}
1914
1914
@@ -1918,10 +1918,10 @@ func TestSchema(t *testing.T) {
1918
1918
if space .Fields == nil {
1919
1919
t .Errorf ("space.Fields is nill" )
1920
1920
}
1921
- if len (space .FieldsById ) != 6 {
1921
+ if len (space .FieldsById ) != 7 {
1922
1922
t .Errorf ("space.FieldsById len is incorrect" )
1923
1923
}
1924
- if len (space .Fields ) != 6 {
1924
+ if len (space .Fields ) != 7 {
1925
1925
t .Errorf ("space.Fields len is incorrect" )
1926
1926
}
1927
1927
@@ -2045,6 +2045,39 @@ func TestSchema(t *testing.T) {
2045
2045
}
2046
2046
}
2047
2047
2048
+ func TestSchema_IsNullable (t * testing.T ) {
2049
+ conn := test_helpers .ConnectWithValidation (t , server , opts )
2050
+ defer conn .Close ()
2051
+
2052
+ schema := conn .Schema
2053
+ if schema .Spaces == nil {
2054
+ t .Errorf ("schema.Spaces is nil" )
2055
+ }
2056
+
2057
+ var space * Space
2058
+ var ok bool
2059
+ if space , ok = schema .SpacesById [616 ]; ! ok {
2060
+ t .Errorf ("space with id = 616 was not found in schema.SpacesById" )
2061
+ }
2062
+
2063
+ var field , field_nullable * Field
2064
+ for i := 0 ; i <= 5 ; i ++ {
2065
+ name := fmt .Sprintf ("name%d" , i )
2066
+ if field , ok = space .Fields [name ]; ! ok {
2067
+ t .Errorf ("field name = %s was not found" , name )
2068
+ }
2069
+ if field .IsNullable {
2070
+ t .Errorf ("field %s has incorrect IsNullable" , name )
2071
+ }
2072
+ }
2073
+ if field_nullable , ok = space .Fields ["nullable" ]; ! ok {
2074
+ t .Errorf ("field name = nullable was not found" )
2075
+ }
2076
+ if ! field_nullable .IsNullable {
2077
+ t .Errorf ("field nullable has incorrect IsNullable" )
2078
+ }
2079
+ }
2080
+
2048
2081
func TestClientNamed (t * testing.T ) {
2049
2082
var resp * Response
2050
2083
var err error
0 commit comments