# Use of JSON utf8mb4 column without utf8mb4 server\_collation when using JSON\_EXTRACT\_STRING can require cluster restart

**URL:** <https://www.singlestore.com/forum/t/use-of-json-utf8mb4-column-without-utf8mb4-server-collation-when-using-json-extract-string-can-require-cluster-restart/6323>\
**Category:** Support Bulletins\
**Created:** [December 19, 2022, 11:28pm UTC](https://www.singlestore.com/forum/t/use-of-json-utf8mb4-column-without-utf8mb4-server-collation-when-using-json-extract-string-can-require-cluster-restart/6323 "2022-12-19T23:28:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [December 19, 2022, 11:28pm UTC](https://www.singlestore.com/forum/t/use-of-json-utf8mb4-column-without-utf8mb4-server-collation-when-using-json-extract-string-can-require-cluster-restart/6323/1 "2022-12-19T23:28:04Z")

</div>

Using all of the features listed below together in SingleStoreDB (at or before versions 7.5.23, 7.6.25, 7.8.20, 7.9.15 and 8.0.6) can cause a query to execute forever, and become unkillable.

- create a JSON column with any kind of utf8mb4 collation
- not have collation\_server set to a utf8mb4 collation
- use JSON\_EXTRACT\_STRING on the JSON column in a query
- set the json\_extract\_string\_collation variable to a value other than `'json'`
- store extended (non-utf8mb3) characters in the JSON column accessed with JSON\_EXTRACT\_STRING

This will require the cluster to be restarted to end the query and bring the cluster back to normal operation.

After the versions listed, it’s recommended that you set `json_extract_string_collation` to SERVER\_V2 to avoid this issue. Available settings are discussed [in the documentation](https://docs.singlestore.com/managed-service/en/reference/configuration-reference/engine-variables/list-of-engine-variables.html#json_extract_string_collation).

If you are using JSON\_EXTRACT\_STRING in a computed column that’s part of a shard key, and the source column has a utf8mb4 collation (such as utf8mb4\_bin), it will not be possible to use the SERVER\_V2 setting. In this case, if the system will allow it, you can instead use the SERVER\_V1 setting. However, if using SERVER\_V1, be aware that persisted computed column values might change when recomputed, so it is safest to double-check the values in the persisted computed columns for correctness after changing this setting. You may need to delete and re-insert rows with incorrect (e.g. truncated) computed column values.

If you must work with a version prior to the ones patched to fix the issue, consider working around the issue by:

1. restarting the cluster to kill all non-terminating queries
2. run “`SET GLOBAL json_extract_string_collation = 'json'`” to prevent the issue from recurring

However, be aware that setting [json\_extract\_string\_collation](https://docs.singlestore.com/db/v8.0/en/reference/configuration-reference/engine-variables/list-of-engine-variables.html#json_extract_string_collation) = `'json'` causes the extracted string to use the collation of the JSON object rather than the value of collation\_server.

Releases before 7.5 are unaffected because utf8mb4 support began in 7.5.

If you are using the JSON data type and utf8mb4 collations, it is recommended that you apply the appropriate patch and consider using the SERVER\_V2 setting. Please monitor the [release notes](https://docs.singlestore.com/db/v8.0/en/release-notes/singlestoredb-memsql.html) for your release version for the arrival of this patch.
