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

panic: runtime error: index out of range [375] with length 0 #79

Closed
aaronmlee opened this issue Jun 30, 2022 · 2 comments
Closed

panic: runtime error: index out of range [375] with length 0 #79

aaronmlee opened this issue Jun 30, 2022 · 2 comments

Comments

@aaronmlee
Copy link

steps:

  1. create a table
    csvq 'CREATE TABLE IF NOT EXISTS common_record (day, sleep_hrs_x, sleep_hrs_y, sleep_hrs_z);'
  2. Try to select into table from an existing CSV
    csvq 'REPLACE INTO common_record (day, sleep_hrs_x) USING (day) select day, total_sleep_duration from x_sleep'

note, day is a string date field.

results:

panic: runtime error: index out of range [375] with length 0

goroutine 67 [running]:
github.com/mithrandie/csvq/lib/query.(*View).replace.func2(0x177)
github.com/mithrandie/csvq/lib/query/view.go:2231 +0x1a0
github.com/mithrandie/csvq/lib/query.(*GoroutineTaskManager).run(0x140001f1880, {0x10338d618, 0x140001f1740}, 0x14000ecac00, 0x0?)
github.com/mithrandie/csvq/lib/query/goroutine_manager.go:156 +0xfc
created by github.com/mithrandie/csvq/lib/query.(*GoroutineTaskManager).Run
github.com/mithrandie/csvq/lib/query/goroutine_manager.go:171 +0xbc
panic: runtime error: index out of range [750] with length 0

goroutine 68 [running]:
github.com/mithrandie/csvq/lib/query.(*View).replace.func2(0x2ee)
github.com/mithrandie/csvq/lib/query/view.go:2231 +0x1a0
github.com/mithrandie/csvq/lib/query.(*GoroutineTaskManager).run(0x140001f1880, {0x10338d618, 0x140001f1740}, 0x14000ecac00, 0x0?)
github.com/mithrandie/csvq/lib/query/goroutine_manager.go:156 +0xfc
created by github.com/mithrandie/csvq/lib/query.(*GoroutineTaskManager).Run
github.com/mithrandie/csvq/lib/query/goroutine_manager.go:171 +0xbc

found on Monterey 12.4 M1

mithrandie added a commit that referenced this issue Jun 30, 2022
- Fix a bug in REPLACE query. ([GitHub #79](#79))
@ondohotola
Copy link

ondohotola commented Jun 30, 2022 via email

@mithrandie
Copy link
Owner

This bug has been fixed in Release v1.17.6.

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

No branches or pull requests

3 participants