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

Streaming insert fails silently on 8.0 #6934

Closed
aquarapid opened this issue Oct 23, 2020 · 0 comments · Fixed by #6949
Closed

Streaming insert fails silently on 8.0 #6934

aquarapid opened this issue Oct 23, 2020 · 0 comments · Fixed by #6949
Assignees
Milestone

Comments

@aquarapid
Copy link
Contributor

aquarapid commented Oct 23, 2020

Setup local unsharded example with 7.0:

$ sh -x 101_initial_cluster.sh
.
.

Now, observe the behavior of trying to do a streaming (OLAP mode) insert:

$ mysql -c -h 127.0.0.1 -P 15306 -u root -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
.
.

mysql> use commerce;
Database changed
mysql> select * from product;
Empty set (0.00 sec)

mysql> set workload=olap;                                                                            
Query OK, 0 rows affected (0.00 sec)

mysql> select * from product;
Empty set (0.00 sec)

mysql> insert into product (sku,description, price) values ("12345678","1234",100);                     
ERROR 1105 (HY000): vtgate: http://localhost:15001/: query "insert into product(sku, description, price) values (:vtg1, :vtg2, :vtg3)" cannot be used for streaming

All good so far; inserts are not supported in OLAP/streaming mode. However, on 8.0 (approximately, current master d6c9ddf), the insert will "succeed"; and then the client will get disconnected, but that only becomes apparent on the next command issued by the client:

$ mysql -c -h 127.0.0.1 -P 15306 -u root -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
.
.

mysql> use commerce;
Database changed

mysql> set workload=olap;
Query OK, 0 rows affected (0.01 sec)

mysql> select @@workload;
+------------+
| @@workload |
+------------+
| OLAP       |
+------------+
1 row in set (0.00 sec)

mysql> insert into product (sku,description, price) values ("12345","1234",100);
Query OK, 0 rows affected (0.00 sec)

mysql> select * from product;
ERROR 2013 (HY000): Lost connection to MySQL server during query
  • Note the 0 rows affected from the insert.
  • From the vtgate logs:
E1023 14:28:17.958999   30917 vtgate.go:454] StreamExecute: query "insert into product(sku, description, price) values (:vtg1, :vtg2, :vtg3)" cannot be used for streaming, request: map[BindVariables:map[vtg1:type:VARBINARY value:"12345"  vtg2:type:VARBINARY value:"1234"  vtg3:type:INT64 value:"100" ] Session:autocommit:true target_string:"commerce" options:<included_fields:ALL workload:OLAP > row_count:-1 Sql:insert into product (sku,description, price) values ("12345","1234",100)]
E1023 14:28:17.959161   30917 conn.go:1276] Error in the middle of a stream to client 9 (127.0.0.1:52938): vtgate: http://localhost:15001/: query "insert into product(sku, description, price) values (:vtg1, :vtg2, :vtg3)" cannot be used for streaming (errno 1105) (sqlstate HY000)
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