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

*api.QueryTableResult TableChanged and TablePosition not working #399

Open
paulheg opened this issue Mar 6, 2024 · 1 comment
Open

*api.QueryTableResult TableChanged and TablePosition not working #399

paulheg opened this issue Mar 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@paulheg
Copy link

paulheg commented Mar 6, 2024

Specifications

  • Client Version: v2.12.4
  • InfluxDB Version: v2.7.5
  • Platform: Linux

Steps to reproduce

  1. Write a query with different tables
  2. Try to scan them:
res, err := q.api.Query(context.Background(), query)
if err != nil {
	return nil, err
}

for res.Next() {

	// should be true if table position changes?
	if res.TableChanged() {

	}

	// table position
	i1 := res.TablePosition()

        valueMap := res.Record().Values()
	i2 := valueMap["table"].(int64)

	if i1 != i2 {
		log.Printf("Table positions differ: %d, %d", i1, i2)
	}
}

Expected behavior

TableChanged should be true if the table number changes and TablePosition should contain the current table number.

Actual behavior

TableChanged returns true only once TablePosition is stuck at 0.

Additional info

Im not shure if this is the intended behaviour.
As a workaroud I used:

valueMap := res.Record().Values()
tablePosition := valueMap["table"].(int64)
@paulheg paulheg added the bug Something isn't working label Mar 6, 2024
@bednar
Copy link
Contributor

bednar commented Mar 7, 2024

Hi @paulheg,

Thank you for using our client and taking the time to report the issue you've encountered. Your feedback is invaluable to us as it helps improve the quality and reliability of our software.

To address the issue more effectively, we would greatly appreciate your assistance. If you're open to contributing, we welcome Pull Requests (PRs) and would be more than happy to review your submission.

Alternatively, if you could provide a unit test case that simulates the issue, it would greatly aid us in diagnosing and addressing the problem more efficiently.

Best Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants