@@ -2415,18 +2415,19 @@ func TestAggregateMetadata(t *testing.T) {
24152415 t .Fatal ("expected two aggregates" )
24162416 }
24172417
2418+ protoVer := byte (session .cfg .ProtoVersion )
24182419 expectedAggregrate := AggregateMetadata {
24192420 Keyspace : "gocql_test" ,
24202421 Name : "average" ,
2421- ArgumentTypes : []TypeInfo {NativeType {typ : TypeInt }},
2422+ ArgumentTypes : []TypeInfo {NativeType {proto : protoVer , typ : TypeInt }},
24222423 InitCond : "(0, 0)" ,
2423- ReturnType : NativeType {typ : TypeDouble },
2424+ ReturnType : NativeType {proto : protoVer , typ : TypeDouble },
24242425 StateType : TupleTypeInfo {
2425- NativeType : NativeType {typ : TypeTuple },
2426+ NativeType : NativeType {proto : protoVer , typ : TypeTuple },
24262427
24272428 Elems : []TypeInfo {
2428- NativeType {typ : TypeInt },
2429- NativeType {typ : TypeBigInt },
2429+ NativeType {proto : protoVer , typ : TypeInt },
2430+ NativeType {proto : protoVer , typ : TypeBigInt },
24302431 },
24312432 },
24322433 stateFunc : "avgstate" ,
@@ -2465,28 +2466,29 @@ func TestFunctionMetadata(t *testing.T) {
24652466 avgState := functions [1 ]
24662467 avgFinal := functions [0 ]
24672468
2469+ protoVer := byte (session .cfg .ProtoVersion )
24682470 avgStateBody := "if (val !=null) {state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue());}return state;"
24692471 expectedAvgState := FunctionMetadata {
24702472 Keyspace : "gocql_test" ,
24712473 Name : "avgstate" ,
24722474 ArgumentTypes : []TypeInfo {
24732475 TupleTypeInfo {
2474- NativeType : NativeType {typ : TypeTuple },
2476+ NativeType : NativeType {proto : protoVer , typ : TypeTuple },
24752477
24762478 Elems : []TypeInfo {
2477- NativeType {typ : TypeInt },
2478- NativeType {typ : TypeBigInt },
2479+ NativeType {proto : protoVer , typ : TypeInt },
2480+ NativeType {proto : protoVer , typ : TypeBigInt },
24792481 },
24802482 },
2481- NativeType {typ : TypeInt },
2483+ NativeType {proto : protoVer , typ : TypeInt },
24822484 },
24832485 ArgumentNames : []string {"state" , "val" },
24842486 ReturnType : TupleTypeInfo {
2485- NativeType : NativeType {typ : TypeTuple },
2487+ NativeType : NativeType {proto : protoVer , typ : TypeTuple },
24862488
24872489 Elems : []TypeInfo {
2488- NativeType {typ : TypeInt },
2489- NativeType {typ : TypeBigInt },
2490+ NativeType {proto : protoVer , typ : TypeInt },
2491+ NativeType {proto : protoVer , typ : TypeBigInt },
24902492 },
24912493 },
24922494 CalledOnNullInput : true ,
@@ -2503,16 +2505,16 @@ func TestFunctionMetadata(t *testing.T) {
25032505 Name : "avgfinal" ,
25042506 ArgumentTypes : []TypeInfo {
25052507 TupleTypeInfo {
2506- NativeType : NativeType {typ : TypeTuple },
2508+ NativeType : NativeType {proto : protoVer , typ : TypeTuple },
25072509
25082510 Elems : []TypeInfo {
2509- NativeType {typ : TypeInt },
2510- NativeType {typ : TypeBigInt },
2511+ NativeType {proto : protoVer , typ : TypeInt },
2512+ NativeType {proto : protoVer , typ : TypeBigInt },
25112513 },
25122514 },
25132515 },
25142516 ArgumentNames : []string {"state" },
2515- ReturnType : NativeType {typ : TypeDouble },
2517+ ReturnType : NativeType {proto : protoVer , typ : TypeDouble },
25162518 CalledOnNullInput : true ,
25172519 Language : "java" ,
25182520 Body : finalStateBody ,
@@ -2616,15 +2618,16 @@ func TestKeyspaceMetadata(t *testing.T) {
26162618 if flagCassVersion .Before (3 , 0 , 0 ) {
26172619 textType = TypeVarchar
26182620 }
2621+ protoVer := byte (session .cfg .ProtoVersion )
26192622 expectedType := UserTypeMetadata {
26202623 Keyspace : "gocql_test" ,
26212624 Name : "basicview" ,
26222625 FieldNames : []string {"birthday" , "nationality" , "weight" , "height" },
26232626 FieldTypes : []TypeInfo {
2624- NativeType {typ : TypeTimestamp },
2625- NativeType {typ : textType },
2626- NativeType {typ : textType },
2627- NativeType {typ : textType },
2627+ NativeType {proto : protoVer , typ : TypeTimestamp },
2628+ NativeType {proto : protoVer , typ : textType },
2629+ NativeType {proto : protoVer , typ : textType },
2630+ NativeType {proto : protoVer , typ : textType },
26282631 },
26292632 }
26302633 if ! reflect .DeepEqual (* keyspaceMetadata .UserTypes ["basicview" ], expectedType ) {
0 commit comments