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

inconsistent behavior of LOAD_FILE depending on whether dolt sql-server is running. #8841

Open
nicktobey opened this issue Feb 10, 2025 · 0 comments
Labels
sql server Issues related to the built in SQL server sql Issue with SQL

Comments

@nicktobey
Copy link
Contributor

When running dolt sql without connecting to an existing engine, Dolt will refuse to load files that exist outside of the repo:

> echo Hello world > test
> dolt sql -q "select LOAD_FILE('test');
+-------------------+
| LOAD_FILE('test') |
+-------------------+
| Hello world       |
|                   |
+-------------------+

> cp test ..
> dolt sql -q "select LOAD_FILE('../test');"
+----------------------+
| LOAD_FILE('../test') |
+----------------------+
| NULL                 |
+----------------------+

However, if the server is running in a separate process, the load is successful:

dolt sql-server &
dolt sql -q "select LOAD_FILE('../test');"
+----------------------+
| LOAD_FILE('../test') |
+----------------------+
| Hello world          |
|                      |
+----------------------+

I'm not sure which behavior is preferred, but we should aim to be consistent. (And if the intent is to block the file read, we might want to record a warning instead of just having LOAD_FILE return NULL.

@nicktobey nicktobey added sql Issue with SQL sql server Issues related to the built in SQL server labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql server Issues related to the built in SQL server sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

1 participant