Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while fetching the data with column type "Array(Nullable(String))" #783

Closed
haudoing opened this issue Apr 1, 2024 · 1 comment
Closed

Comments

@haudoing
Copy link
Contributor

haudoing commented Apr 1, 2024

What happened:
The column type "Array(Nullable(String))" is not tested in either pkg/converters/converters_test.go or pkg/plugin/driver_test.go. I made one test case in file pkg/plugin/driver_test.go on my local then sometimes I found the error below on line 280.

sql: Scan error on column index 0, name "col1": unsupported Scan, storing driver.Value type []*string into type *string

The function I wrote looks like this

func TestArrayNullableString(t *testing.T) {
	for name, protocol := range Protocols {
		t.Run(fmt.Sprintf("using %s", name), func(t *testing.T) {
			var val []*string
			conn, close := setupTest(t, "col1 Array(Nullable(String))", protocol, nil)
			defer close(t)
			v := "48"
			val = append(val, &v, nil)
			insertData(t, conn, val)
			checkRows(t, conn, 1, val)
		})
	}
}

What you expected to happen:
Expecting no error while using the plugin with the column type "Array(Nullable(String))"

How to reproduce it (as minimally and precisely as possible):

Screenshots

Anything else we need to know?:
This error does not always appear.

Environment:

  • Grafana version:
  • Plugin version: v4.0.3
  • OS Grafana is installed on:
  • User OS & Browser: Linux mint 21.3
  • Others:
@haudoing
Copy link
Contributor Author

haudoing commented Apr 1, 2024

The PR above fixes my problem and all the tests are running fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants