You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the length of a request_tag is [limited to 50 characters](https://github.com/googleapis/googleapis/blob/150b4079b6441ea8b3d7f9a71d0be7bbacbb4e3a/google/spanner/v1/spanner.proto#L466-L476), request tags, especially SQL Text embedded at the end of a request tag, may be truncated.
276
282
277
283
```
278
284
# Read-write transaction
@@ -281,27 +287,28 @@ The tag will also be used as request tags within the transaction.
281
287
| BEGIN RW TAG tx1; |
282
288
| |
283
289
| SELECT val |
284
-
| FROM tab1 +-----request_tag = tx1
290
+
| FROM tab1 +-----request_tag = tx1_1_SELECT val...
285
291
| WHERE id = 1; |
286
292
| |
287
293
| UPDATE tab1 |
288
-
| SET val = 10 +-----request_tag = tx1
294
+
| SET val = 10 +-----request_tag = tx1_2_UPDATE tab1...
289
295
| WHERE id = 1; |
290
296
| |
291
297
| COMMIT; |
292
298
+--------------------+
293
299
```
294
300
295
301
In a read-only transaction, you can add a tag following `BEGIN RO TAG <tag>`.
296
-
Since read-only transaction doesn't support transaction tag, spanner-cli adds the tag set in `BEGIN RO TAG` as request tags.
302
+
Since read-only transaction doesn't support transaction tag, spanner-cli adds the tag set in `BEGIN RO TAG` as the prefix of request tags.
303
+
297
304
```
298
305
# Read-only transaction
299
306
# transaction_tag = N/A
300
307
+--------------------+
301
308
| BEGIN RO TAG tx2; |
302
309
| |
303
310
| SELECT SUM(val) |
304
-
| FROM tab1 +-----request_tag = tx2
311
+
| FROM tab1 +-----request_tag = tx2_1_SELECT SUM(val)...
0 commit comments