Repository: gocql/gocql (go)

Issue:
Metadata for smallint column is incorrect
Similar to #1255 , 3.x metadata parsing [doesn't consider `smallint`](https://github.com/gocql/gocql/blob/b454769479c6201d26d2a2d7a29ac9a0e6fbc9fc/helpers.go#L76-L125). I'll send a PR today/tomorrow for a fix.

### What version of Cassandra are you using?

3.11.6

### What version of Gocql are you using?

cd4b606dd2fb8920e814a86b2901d062daf388a8

Pull request description:
Parse smallint data type in metadata
Fixes #1430 .

Small fix and added some more coverage for `tinyint` as well.

Patch:
diff --git a/AUTHORS b/AUTHORS
index 4bf368d..e908b94 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -114,3 +114,4 @@ Martin Sucha <martin.sucha@kiwi.com>; <git@mm.ms47.eu>
 Pavel Buchinchik <p.buchinchik@gmail.com>
 Rintaro Okamura <rintaro.okamura@gmail.com>
 Yura Sokolov <y.sokolov@joom.com>; <funny.falcon@gmail.com>
+Jorge Bay <jorgebg@apache.org>
diff --git a/helpers.go b/helpers.go
index 0eb30d0..eb07f4f 100644
--- a/helpers.go
+++ b/helpers.go
@@ -85,14 +85,20 @@ func getCassandraBaseType(name string) Type {
 		return TypeBoolean
 	case "counter":
 		return TypeCounter
+	case "date":
+		return TypeDate
 	case "decimal":
 		return TypeDecimal
 	case "double":
 		return TypeDouble
+	case "duration":
+		return TypeDuration
 	case "float":
 		return TypeFloat
 	case "int":
 		return TypeInt
+	case "smallint":
+		return TypeSmallInt
 	case "tinyint":
 		return TypeTinyInt
 	case "time":


Test patch:
diff --git a/helpers_test.go b/helpers_test.go
index d5d86fb..ff057bd 100644
--- a/helpers_test.go
+++ b/helpers_test.go
@@ -171,6 +171,34 @@ func TestGetCassandraType(t *testing.T) {
 				Elem: NativeType{typ: TypeInt},
 			},
 		},
+		{
+			"set<smallint>", CollectionType{
+				NativeType: NativeType{typ: TypeSet},
+				Elem:       NativeType{typ: TypeSmallInt},
+			},
+		},
+		{
+			"list<tinyint>", CollectionType{
+				NativeType: NativeType{typ: TypeList},
+				Elem:       NativeType{typ: TypeTinyInt},
+			},
+		},
+		{"smallint", NativeType{typ: TypeSmallInt}},
+		{"tinyint", NativeType{typ: TypeTinyInt}},
+		{"duration", NativeType{typ: TypeDuration}},
+		{"date", NativeType{typ: TypeDate}},
+		{
+			"list<date>", CollectionType{
+				NativeType: NativeType{typ: TypeList},
+				Elem:       NativeType{typ: TypeDate},
+			},
+		},
+		{
+			"set<duration>", CollectionType{
+				NativeType: NativeType{typ: TypeSet},
+				Elem:       NativeType{typ: TypeDuration},
+			},
+		},
 	}
 
 	for _, test := range tests {