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

vtexplain doesn't handle float columns #3328

Closed
slanning opened this issue Oct 19, 2017 · 2 comments
Closed

vtexplain doesn't handle float columns #3328

slanning opened this issue Oct 19, 2017 · 2 comments

Comments

@slanning
Copy link
Contributor

vtexplain with a simple table succeeds:

$ vtexplain -schema 'CREATE TABLE i (i INT NOT NULL,PRIMARY KEY(i))ENGINE=InnoDB'
-sql 'select 1 from i' -vschema '
{"s":{
"sharded":false,
"vindexes":{"hash":{"type":"hash"}},
"tables":{"i":{"column_vindexes":[{"column":"i","name":"hash"}]}}
}}'

select 1 from i

1 s/-: select 1 from i limit 10001


If I add only an "f float" column, it says it's unimplemented:

$ vtexplain -schema 'CREATE TABLE i (i INT NOT NULL,f float,PRIMARY KEY(i))ENGINE=InnoDB'
-sql 'select 1 from i' -vschema '
{"s":{
"sharded":false,
"vindexes":{"hash":{"type":"hash"}},
"tables":{"i":{"column_vindexes":[{"column":"i","name":"hash"}]}}
}}'
E1019 13:32:41.561362 18012 exit.go:89] panic: unimplemented type float
/usr/lib64/go/src/runtime/asm_amd64.s:509 (0x45c7fa)
call32: CALLFN(·call32, 32)
/usr/lib64/go/src/runtime/panic.go:491 (0x42d992)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
$HOME/go/src/github.com/youtube/vitess/go/vt/sqlparser/ast.go:939 (0x81a7b9)
com/youtube/vitess/go/vt/sqlparser.(*ColumnType).SQLType: panic("unimplemented type " + ct.Type)
$HOME/go/src/github.com/youtube/vitess/go/vt/vtexplain/vtexplain_vttablet.go:266 (0xa654a9)
com/youtube/vitess/go/vt/vtexplain.initTabletEnvironment: Type: col.Type.SQLType(),
$HOME/go/src/github.com/youtube/vitess/go/vt/vtexplain/vtexplain.go:134 (0xa5ee0f)
com/youtube/vitess/go/vt/vtexplain.Init: err = initTabletEnvironment(parsedDDLs, opts)
$HOME/go/src/github.com/youtube/vitess/go/cmd/vtexplain/vtexplain.go:173 (0xa6b81d)
parseAndRun: err = vtexplain.Init(vschema, schema, opts)
$HOME/go/src/github.com/youtube/vitess/go/cmd/vtexplain/vtexplain.go:140 (0xa6b2c0)
main: err := parseAndRun()
/usr/lib64/go/src/runtime/proc.go:185 (0x42f79c)
main: fn()
/usr/lib64/go/src/runtime/asm_amd64.s:2337 (0x45f060)
goexit: BYTE $0x90 // NOP

That line in ast.go seems to want to handle float types, at first glance at least.

@slanning slanning changed the title vttablet doesn't handle float columns vtexplain doesn't handle float columns Oct 19, 2017
@demmer
Copy link
Member

demmer commented Oct 19, 2017

Oops -- this was due to a simple typo due where I used the FLOAT instead of FLOAT_TYPE token id.

I just pushed a PR that should fix this.

@slanning
Copy link
Contributor Author

I just came to the same conclusion. Thanks for the fast fix!

@sougou sougou closed this as completed Oct 19, 2017
systay pushed a commit that referenced this issue Jul 22, 2024
* cherry pick of 14184

* Resolve conflicts

Signed-off-by: Matt Lord <[email protected]>

---------

Signed-off-by: Matt Lord <[email protected]>
Co-authored-by: Matt Lord <[email protected]>
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