GoogleCloudPlatform / GoogleCloudPlatform/cloud-spanner-emulator

Executing UPDATE statement with subquery results in UNAVAILABLE error

Open
#236 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
334
Forks
77
Avg merge
8m
Merged PRs (30d)
2

Description

Executing the following simple UPDATE statement stalls out and then results in an UNAVAILABLE error. The same statement executed fine on Cloud Spanner. I slimmed down the subquery to what I found to be the minimal example that reproduces the issue, so it's somewhat nonsensical.

```sql
UPDATE Requisitions
SET State = 5
WHERE
State IN (1,2)
AND EXISTS (
SELECT
MeasurementId
FROM
Measurements
LIMIT 1
);
```

The following similar queries don't have this issue:

```sql
UPDATE Requisitions
SET State = 5
WHERE
State IN (1,2)
AND EXISTS ( SELECT TRUE );
```

```sql
UPDATE Requisitions
SET State = 5
WHERE
State IN (1,2)
AND EXISTS ( SELECT FALSE );
```

Emulator version: 1.5.32
Spanner JDBC version: 2.21.0
Java Spanner version: 6.74.0

Attached stack trace.

[stack-trace.txt](https://github.com/user-attachments/files/20236681/stack-trace.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.