dolt icon indicating copy to clipboard operation
dolt copied to clipboard

`dolt sql` interactive shell can't see changes created in another shell if it is running

Open timsehn opened this issue 1 year ago • 0 comments

Repro sequence:

Shell 1:

test_dolt_sql $ dolt init --new-format
Successfully initialized dolt data repository.
test_dolt_sql $ dolt sql-server
Starting server with Config HP="localhost:3306"|T="28800000"|R="false"|L="info"
2022-09-08T09:51:24-07:00 INFO [conn 1] NewConnection {DisableClientMultiStatements=false}

Then over to shell 2:

test_dolt_sql $ dolt sql
# Welcome to the DoltSQL shell.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
test_dolt_sql>

Now shell 3:

mysql> use test_dolt_sql;
No connection. Trying to reconnect...
Connection id:    1
Current database: *** NONE ***

Database changed
mysql> create table t (c1 int);
Query OK, 0 rows affected (0.00 sec)

Back to shell 2:

test_dolt_sql> show tables;
+-------------------------+
| Tables_in_test_dolt_sql |
+-------------------------+
+-------------------------+

This seems like some sort of state update issue with dolt sql.

Restarting the dolt sql produces the new table.

test_dolt_sql> exit
Bye
test_dolt_sql $ dolt sql
# Welcome to the DoltSQL shell.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
test_dolt_sql> show tables;
+-------------------------+
| Tables_in_test_dolt_sql |
+-------------------------+
| t                       |
+-------------------------+

timsehn avatar Sep 08 '22 17:09 timsehn