SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'JSON)' at line 1 (Connection: flarum,
SQL: update `users` set `preferences_json` = CAST(CONVERT(`preferences` USING utf8mb4) AS JSON))
It originates from: framework/framework/core/migrations/2024_05_05_000001_convert_preferences_to_json_in_users.php
I tried investigating why CAST as JSON doesn't work, but it seems MariaDB does not support this at all? https://mariadb.com/kb/en/cast/
Steps to Reproduce
.
Expected Behavior
.
Screenshots
No response
Environment
Flarum version: 2.x
MariaDB, (from docker image mariadb:10)
# mysql --version
mysql Ver 15.1 Distrib 10.8.3-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
Hosting environment: dev
PHP version:
PHP 8.2.18 (cli) (built: Apr 24 2024 09:17:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.18, Copyright (c) Zend Technologies
with Zend OPcache v8.2.18, Copyright (c), by Zend Technologies
Current Behavior
I receive this error when migrating:
It originates from: framework/framework/core/migrations/2024_05_05_000001_convert_preferences_to_json_in_users.php
I tried investigating why
CAST as JSON
doesn't work, but it seems MariaDB does not support this at all? https://mariadb.com/kb/en/cast/Steps to Reproduce
.
Expected Behavior
.
Screenshots
No response
Environment
mariadb:10
)Output of
php flarum info
Possible Solution
No response
Additional Context
No response