#8841·dolt

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

Author: nicktobeyCreated Feb 10, 2025Updated Sep 14, 2026
Labelssqlsql server

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.