Skip to content

Commit c8a8034

Browse files
christophdbclaude
andcommitted
Add 3 SQL-related API issues (#32-#34)
Discovered during systematic SQL function testing against SeaTable 6.1.8: - #32: SQL INSERT via api-gateway returns "base not found" (Medium) UPDATE/DELETE work, only INSERT fails through the same endpoint. - #33: SQL JOIN results ignore convert_keys: true (Low) JOIN results use internal column key IDs instead of column names. - #34: SQL constants pi/e not recognized standalone (Low) Work inside functions but not as standalone SELECT expressions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e689019 commit c8a8034

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

tests/API_ISSUES.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Issues discovered during automated API testing against SeaTable 6.0.10 and 6.1.
1111
| 29 | markBaseNotificationsAsSeen rejects JSON boolean | Medium | Yes — accept JSON boolean for `seen` |
1212
| 30 | sendToastNotification rejects request body | Medium | Yes — align request body with spec |
1313
| 31 | Python scheduler endpoints return 406 | Low | Investigate — may require feature flag |
14+
| 32 | SQL INSERT via api-gateway returns "base not found" | Medium | Yes — fix INSERT handling in api-gateway |
15+
| 33 | SQL JOIN results ignore `convert_keys: true` | Low | Yes — apply convert_keys to JOIN results |
16+
| 34 | SQL constants `pi`/`e` not recognized standalone | Low | No — document workaround |
1417

1518
### 27. appendColumns fails with link-formula columns
1619

@@ -58,6 +61,51 @@ The Python scheduler statistics endpoints (e.g., `GET /admin/statistics/by-day/`
5861

5962
**Assessment:** Not necessarily a bug. If the scheduler is an optional component, the endpoints should return `503 Service Unavailable` or a clear error message instead of `406`.
6063

64+
### 32. SQL INSERT via api-gateway returns "base not found"
65+
66+
**Severity:** Medium — SQL INSERT broken via api-gateway
67+
68+
`POST /api-gateway/api/v2/dtables/{base_uuid}/sql/` with an `INSERT INTO` statement returns `400` with `{"error_message": "base {uuid} not found: insert on non-existent base"}`, even though the base exists and is accessible.
69+
70+
`UPDATE` and `DELETE` statements work correctly through the same endpoint. Only `INSERT` fails. A preceding `SELECT` on the same base does not resolve the issue.
71+
72+
```
73+
SQL: INSERT INTO `table` (`col`) VALUES ('value')
74+
Result: 400 — "base {uuid} not found: insert on non-existent base"
75+
```
76+
77+
**Tested on:** SeaTable 6.1.8
78+
79+
**Recommendation:** Fix INSERT handling in the api-gateway to match UPDATE/DELETE behavior.
80+
81+
### 33. SQL JOIN results ignore `convert_keys: true`
82+
83+
**Severity:** Low — inconsistent behavior
84+
85+
When executing an implicit JOIN query via `POST /api-gateway/api/v2/dtables/{base_uuid}/sql/` with `convert_keys: true`, the result rows use internal column key IDs (e.g., `rLfY`, `kz15`) instead of column names. For non-JOIN SELECT queries, `convert_keys: true` correctly returns column names as keys.
86+
87+
```
88+
Query: SELECT `orders`.`product`, `customers`.`name` FROM `orders`, `customers` WHERE ...
89+
Result: [{"rLfY": "Widget", "kz15": "Alice"}, ...] ← internal keys instead of names
90+
```
91+
92+
The column names are available in the response `metadata` array, so callers can manually map keys to names. But this is an inconsistency with non-JOIN queries where `convert_keys` works as expected.
93+
94+
**Recommendation:** Apply `convert_keys` mapping to JOIN result rows, consistent with non-JOIN queries.
95+
96+
### 34. SQL constants `pi` and `e` not recognized as standalone expressions
97+
98+
**Severity:** Low — parser limitation
99+
100+
The documented constants `pi` and `e` work correctly as function arguments (e.g., `SELECT multiply(pi, 2)` returns `6.28...`), but fail when used as standalone SELECT expressions. The parser interprets them as column names.
101+
102+
```
103+
SELECT pi FROM `table` → 400: "no such column: pi"
104+
SELECT multiply(pi, 2) FROM `table` → 200: 6.28318...
105+
```
106+
107+
**Assessment:** Edge case with a simple workaround. Document that constants must be used inside function calls.
108+
61109
---
62110

63111
## Previous Issues (reported to developers)

0 commit comments

Comments
 (0)