dolthub / dolthub/dolt

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

Open
#8,841 0 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
sql sql server
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 9h
Merged PRs (30d)
121

Description

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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.