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: query arguments missing for __vtdbname #7379

Closed
mcronce opened this issue Jan 25, 2021 · 2 comments · Fixed by #7493
Closed

vtgate: query arguments missing for __vtdbname #7379

mcronce opened this issue Jan 25, 2021 · 2 comments · Fixed by #7493

Comments

@mcronce
Copy link

mcronce commented Jan 25, 2021

Overview of the Issue

When testing diesel migration run with one of Diesel's examples, I'm hitting the error from the title:

vtgate: http://78bab1349f40:33574/: query arguments missing for __vtdbname

The query that aggravated it was SELECT database() but when I execute that from the mysql CLI, it returns as normal. I tried setting all the variables that Diesel sets, but it still succeeds. I'll attach a packet capture.

Reproduction Steps

docker run --rm -it --entrypoint=bash gcr.io/planetscale-vitess-testing/frameworks/rust/diesel -c 'export DATABASE_URL=mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE?ssl-mode=DISABLED; cd getting_started_step_1; diesel migration run'

Binary version

Using vttestserver, which doesn't support -version, but here's output from vtcombo in the same container:

$ /vt/bin/vtcombo -version
ERROR: logging before flag.Parse: E0125 18:43:12.741403     754 syslogger.go:149] can't connect to syslog
Version: acb3b4e1d (Git branch 'master') built on Mon Jan 25 16:57:11 UTC 2021 by vitess@6c41847a305c using go1.15.6 linux/amd64

Operating system and Environment details

Inside the vttestserver container:

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
vitess@3e5d5c6a960a:/$ uname -sr 
Linux 5.10.2-2-MANJARO
vitess@3e5d5c6a960a:/$ uname -m
x86_64

Log Fragments

With query logging enabled, I get this:

Prepare 172.17.0.4:48530        root    'userData1'     'root'  2021-01-25 22:16:12.025626      2021-01-25 22:16:12.025678      0.000052        0.000040     0.000012 0.000000        SELECT  "select :__vtdbname as `database()` from dual"  map[]   0       0       "query arguments missing for __vtdbname"        ""   ""       ""

but nothing else

@mcronce
Copy link
Author

mcronce commented Jan 25, 2021

https://drive.google.com/file/d/1DHgCTgTWuPPoyOBPJjnr9b6vkaImpoG1/view has the pcap - packet 79 is the request that causes the error

@harshit-gangal
Copy link
Member

I think it is related to how we handle that query when database is no selected.

mysql:

mysql [localhost:5729] {msandbox} ((none)) > select database();
+------------+
| database() |
+------------+
| NULL       |
+------------+
1 row in set (0.00 sec)

vitess:

+------------+
| database() |
+------------+
|            |
+------------+
1 row in set (0.00 sec)

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.

4 participants