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

First time querying a server with dolt_show_system_tables enabled produces error #8671

Open
timsehn opened this issue Dec 11, 2024 · 2 comments
Labels
bug Something isn't working no repro Bugs that can't be reproduced easily sql server Issues related to the built in SQL server version control

Comments

@timsehn
Copy link
Contributor

timsehn commented Dec 11, 2024

Repro:

  1. Define {"dolt_show_system_tables": 1} in the sysvars section of config.yaml
$ grep system_variables config.yaml 
system_variables: {"dolt_show_system_tables": 1}
  1. Start the server:
$ dolt sql-server --config=config.yaml
Starting server with Config HP="127.0.0.1:3310"|T="28800000"|R="false"|L="debug"
INFO[0000] Server ready. Accepting connections.   
  1. Connect a client and run show tables:
$ mysql -h localhost -P 3310 -u root
WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 8.0.33 Dolt

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> use config_blog;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MySQL [config_blog]> show tables;
ERROR: 

First time it errors.

Subsequent runs succeed.

MySQL [config_blog]> show tables;
+------------------------------+
| Tables_in_config_blog        |
+------------------------------+
| dolt_branches                |
| dolt_commit_ancestors        |
| dolt_commit_diff_t           |
| dolt_commits                 |
| dolt_conflicts               |
| dolt_conflicts_t             |
| dolt_constraint_violations   |
| dolt_constraint_violations_t |
| dolt_diff_t                  |
| dolt_history_t               |
| dolt_log                     |
| dolt_remote_branches         |
| dolt_remotes                 |
| dolt_status                  |
| dolt_workspace_t             |
| t                            |
+------------------------------+
16 rows in set (0.000 sec)

Error in the debug logs suggest this may be the culprit:

D=3 error="error querying table dolt_commit_diff_t: dolt_commit_diff_* tables must be filtered to a single 'to_commit'" query="SELECT * FROM `dolt_commit_diff_t` LIMIT 0;"

But that error is in every run of show tables.

@timsehn
Copy link
Contributor Author

timsehn commented Dec 11, 2024

Having this behavior ion is kind of buggy in general with query results being "off by one":

MySQL [config_blog]> select @@dolt_show_system_tables;
+------------------------------+
| Tables_in_config_blog        |
+------------------------------+
| dolt_branches                |
| dolt_commit_ancestors        |
| dolt_commit_diff_t           |
| dolt_commits                 |
| dolt_conflicts               |
| dolt_conflicts_t             |
| dolt_constraint_violations   |
| dolt_constraint_violations_t |
| dolt_diff_t                  |
| dolt_history_t               |
| dolt_log                     |
| dolt_remote_branches         |
| dolt_remotes                 |
| dolt_status                  |
| dolt_workspace_t             |
| t                            |
+------------------------------+
16 rows in set (0.000 sec)

MySQL [config_blog]> select @@dolt_show_system_tables;
+---------------------------+
| @@dolt_show_system_tables |
+---------------------------+
|                         1 |
+---------------------------+
1 row in set (0.000 sec)

MySQL [config_blog]> select @@dolt_show_system_tables;
+---------------------------+
| @@dolt_show_system_tables |
+---------------------------+
|                         1 |
+---------------------------+
1 row in set (0.000 sec)

MySQL [config_blog]> show tables;
+---------------------------+
| @@dolt_show_system_tables |
+---------------------------+
|                         1 |
+---------------------------+
1 row in set (0.000 sec)

MySQL [config_blog]> show tables;
+------------------------------+
| Tables_in_config_blog        |
+------------------------------+
| dolt_branches                |
| dolt_commit_ancestors        |
| dolt_commit_diff_t           |
| dolt_commits                 |
| dolt_conflicts               |
| dolt_conflicts_t             |
| dolt_constraint_violations   |
| dolt_constraint_violations_t |
| dolt_diff_t                  |
| dolt_history_t               |
| dolt_log                     |
| dolt_remote_branches         |
| dolt_remotes                 |
| dolt_status                  |
| dolt_workspace_t             |
| t                            |
+------------------------------+
16 rows in set (0.000 sec)

@timsehn timsehn added bug Something isn't working sql server Issues related to the built in SQL server version control no repro Bugs that can't be reproduced easily labels Dec 11, 2024
@timsehn
Copy link
Contributor Author

timsehn commented Dec 17, 2024

I can repro this but @jycor cannot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no repro Bugs that can't be reproduced easily sql server Issues related to the built in SQL server version control
Projects
None yet
Development

No branches or pull requests

1 participant