You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup local examples, unsharded commerce keyspace:
$ cd examples/local/
$ sh 101_initial_cluster.sh
.
.
Connect to vtgate, and first see the behavior in normal (oltp) workload mode, and then in OLAP/streaming mode:
$ mysql -u root -P 15306 -h 127.0.0.1 -u root -A commerce
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.9-Vitess MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select * from product;
Empty set (0.01 sec)
mysql> select * from product order by price;
Empty set (0.00 sec)
mysql> select * from product order by col_does_not_exist;
ERROR 1054 (42S22): vtgate: http://localhost:15001/: target: commerce.0.master, used tablet: zone1-100 (localhost): vttablet: rpc error: code = NotFound desc = Unknown column 'col_does_not_exist' in 'order clause' (errno 1054) (sqlstate 42S22) (CallerID: userData1): Sql: "select * from product order by col_does_not_exist asc", BindVars: {}
mysql>
mysql> set workload=olap;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from product order by price;
Empty set (0.00 sec)
mysql> select * from product order by col_does_not_exist;
Query OK, 0 rows affected (0.00 sec) <---- This should not happen
mysql> select * from product order by price;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> select * from product order by price;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 5
Current database: commerce
Empty set (0.00 sec)
Note the "Lost connection". If you look at the vtgate logs, it becomes evident what happened:
During the select * from product order by col_does_not_exist; query in OLAP mode, vtgate reports the error:
E0912 14:36:20.284310 12811 conn.go:1184] Error in the middle of a stream to client 4 (127.0.0.1:53098): vtgate: http://localhost:15001/: target: commerce.0.master, used tablet: zone1-100 (localhost): vttablet: rpc error: code = NotFound desc = Unknown column 'col_does_not_exist' in 'order clause' (errno 1054) (sqlstate 42S22) (CallerID: userData1): Sql: "select * from product order by col_does_not_exist asc", BindVars: {} (errno 1054) (sqlstate 42S22)
However, this error does not make it to the client, but only on the next query does it become evident that there was an issue (Lost connection)
The text was updated successfully, but these errors were encountered:
Should also note that the same error occurs in OLAP/streaming mode when you use a column that does not exist in the SELECT clause, instead of the ORDER BY, e.g.: select col_does_not_exist from product;
TL;DR: If you use column names in streaming (workload=OLAP) queries, you can get strange results.
Setup:
commerce
keyspace:Note the "Lost connection". If you look at the vtgate logs, it becomes evident what happened:
select * from product order by col_does_not_exist;
query in OLAP mode, vtgate reports the error:The text was updated successfully, but these errors were encountered: