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

vtgate panic - select 1 as one from dual #9653

Closed
jakon89 opened this issue Feb 8, 2022 · 1 comment · Fixed by #9969
Closed

vtgate panic - select 1 as one from dual #9653

jakon89 opened this issue Feb 8, 2022 · 1 comment · Fixed by #9969

Comments

@jakon89
Copy link

jakon89 commented Feb 8, 2022

Overview of the Issue

vtgate panics when trying to execute below query:

select 1 as one
from dual
where exists (
  select 1 as one
  from information_schema.TABLES
  where (
    information_schema.TABLES.TABLE_NAME = 'proc'
    and information_schema.TABLES.TABLE_SCHEMA = 'mysql'
  )
)

The above query is sent by JOOQ library when reading DB schema (that schema is used then to generate java classes)

This happens for both shared and unsharded keyspaces.

Reproduction Steps

* login to mysql
* mysql> select 1 as one from dual where exists (   select 1 as one   from information_schema.TABLES   where (     information_schema.TABLES.TABLE_NAME = 'proc'     and information_schema.TABLES.TABLE_SCHEMA = 'mysql'   ) );
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
Connection id:    57
Current database: cloudsync_db

ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
Connection id:    58
Current database: cloudsync_db

ERROR 2013 (HY000): Lost connection to MySQL server during query

Binary Version

vitess@vitess:/vt/vtdataroot/tmp$ vtgate -version
ERROR: logging before flag.Parse: E0208 19:40:39.319003    1368 syslogger.go:149] can't connect to syslog
Version: 13.0.0-SNAPSHOT (Git revision 727d8fe893 branch 'main') built on Tue Feb  1 15:49:03 UTC 2022 by vitess@buildkitsandbox using go1.17.6 linux/amd64


### Operating System and Environment details

```shell
docker/linux

Log Fragments

vtgate:

E0208 19:41:12.424888     401 server.go:319] mysql_server caught panic:
assignment to entry in nil map
runtime/map_faststr.go:204 (0x41306e)
vitess.io/vitess/go/vt/vtgate/planbuilder/route.go:383 (0xe5c56e)
vitess.io/vitess/go/vt/vtgate/planbuilder/expr.go:134 (0xe34a24)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:407 (0xe612c9)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:208 (0xe5fc44)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:55 (0xe5f679)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:64 (0xe5f402)
vitess.io/vitess/go/vt/vtgate/planbuilder/builder.go:148 (0xe2ad19)
vitess.io/vitess/go/vt/vtgate/planbuilder/builder.go:160 (0xe2ae95)
vitess.io/vitess/go/vt/vtgate/planbuilder/builder.go:84 (0xe2a7d7)
vitess.io/vitess/go/vt/vtgate/executor.go:1449 (0xec9f9d)
vitess.io/vitess/go/vt/vtgate/plan_execute.go:63 (0xeced1d)
vitess.io/vitess/go/vt/vtgate/executor.go:360 (0xebe958)
vitess.io/vitess/go/vt/vtgate/executor.go:175 (0xebcf46)
vitess.io/vitess/go/vt/vtgate/vtgate.go:382 (0xef5e9c)
vitess.io/vitess/go/vt/vtgate/plugin_mysql_server.go:223 (0xed145a)
vitess.io/vitess/go/mysql/conn.go:1260 (0xc124f5)
vitess.io/vitess/go/mysql/conn.go:1245 (0xc1217d)
vitess.io/vitess/go/mysql/conn.go:882 (0xc0f1ce)
vitess.io/vitess/go/mysql/server.go:494 (0xc2d817)
vitess.io/vitess/go/mysql/server.go:302 (0xc2c35e)
runtime/asm_amd64.s:1581 (0x4691e0)

vttablets:

==> vttablet_0000000300_querylog.txt <==
Execute	172.30.0.19:59920:/queryservice.Query/Execute(gRPC)	gRPC	'userData1'	'root'	2022-02-08 19:41:12.382781	2022-02-08 19:41:12.383673	0.000892	Show	"show tables"	map[]	1	"show tables"	mysql	0.000754	0.000007	0	0	491	""

==> vttablet_0000000400_querylog.txt <==
Execute	172.30.0.19:35346:/queryservice.Query/Execute(gRPC)	gRPC	'userData1'	'root'	2022-02-08 19:41:12.331501	2022-02-08 19:41:12.332518	0.001017	Show	"show tables"	map[]	1	"show tables"	mysql	0.000859	0.000008	0	0	491	""
@jakon89 jakon89 added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Feb 8, 2022
@jakon89
Copy link
Author

jakon89 commented Feb 8, 2022

doesn't seem to be regression, the result for 12.0.3:

E0208 20:00:14.631824    4517 server.go:303] mysql_server caught panic:
assignment to entry in nil map
runtime/map_faststr.go:204 (0x412e0e)
vitess.io/vitess/go/vt/vtgate/planbuilder/route.go:402 (0xd8f064)
vitess.io/vitess/go/vt/vtgate/planbuilder/expr.go:134 (0xd6a104)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:375 (0xd9ef69)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:191 (0xd9db57)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:50 (0xd9d5d9)
vitess.io/vitess/go/vt/vtgate/planbuilder/select.go:59 (0xd9d3af)
vitess.io/vitess/go/vt/vtgate/planbuilder/builder.go:152 (0xd600d9)
vitess.io/vitess/go/vt/vtgate/planbuilder/builder.go:164 (0xd60259)
vitess.io/vitess/go/vt/vtgate/planbuilder/builder.go:117 (0xd5fdb7)
vitess.io/vitess/go/vt/vtgate/executor.go:1383 (0xe045dd)
vitess.io/vitess/go/vt/vtgate/plan_execute.go:52 (0xe09132)
vitess.io/vitess/go/vt/vtgate/executor.go:218 (0xdf847e)
vitess.io/vitess/go/vt/vtgate/executor.go:182 (0xdf80c4)
vitess.io/vitess/go/vt/vtgate/vtgate.go:371 (0xe2e55c)
vitess.io/vitess/go/vt/vtgate/plugin_mysql_server.go:222 (0xe0b59a)
vitess.io/vitess/go/mysql/conn.go:1255 (0xbaa995)
vitess.io/vitess/go/mysql/conn.go:1240 (0xbaa61d)
vitess.io/vitess/go/mysql/conn.go:877 (0xba766e)
vitess.io/vitess/go/mysql/server.go:474 (0xbc5f07)
vitess.io/vitess/go/mysql/server.go:286 (0xbc4a5e)
runtime/asm_amd64.s:1581 (0x468f80)

My first idea was this is regression introduced in https://github.com/vitessio/vitess/pull/9543/files but apparently its not.

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

Successfully merging a pull request may close this issue.

3 participants