Fatal Error: DatabaseException - SELECT SQL_CACHE- The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0.
wdebusschere opened this issue · 6 comments
Affected Symphony version(s) : 2.7.10 - 3.0.0
PHP version(s) : 7.1 - 7.3
MySQL version(s): 8.0
OS(es) :
To be able for symphonycms to work with MySql 8.0 i need to disable 'query_caching'.
- For installation: the
installer/config_default.php 'query_caching' => 'off', did not work, i need to disable it in the symphony code:$query = preg_replace('/^SELECT\s+/i', 'SELECT SQL_CACHE ', $query);
Error:
Fatal Error: DatabaseException 0 - MySQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.name, t2.page, t2.delegate, t2.callback
FROM `sym_extensions` a' at line 1 in query: SELECT SQL_CACHE t1.name, t2.page, t2.delegate, t2.callback
FROM `sym_extensions` as t1 INNER JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id
WHERE t1.status = 'enabled'
ORDER BY t2.delegate, t1.name
- Running symphony:
In the config.php 'query_caching' => 'off', works.
Yeah I already left a comment in the code regarding that ;)
Can you var_dump(Symphony::Database()->getVersion());
please ?
Symphony::Database()->getVersion() = Symphony Fatal Error: Call to undefined method MySQL::getVersion()
MySQL version | 8.0.19
@wdebusschere Did run ran composer install and uploaded all file ? Because the Symphony::Database()
instance does not return a MySQL class anymore.
Can't test anymore, getting now Symphony Notice: Undefined index errors.
Symphony Notice: Undefined index: data_sources
An error occurred in /Users/xxx/Sites/symphonycms3/symphony/content/content.blueprintspages.php around line 696
691 $types = preg_split('/\s*,\s*/', $fields['type'], -1, PREG_SPLIT_NO_EMPTY);
692 $types = array_map('trim', $types);
693 unset($fields['type']);
694
695 $fields['parent'] = ($fields['parent'] != __('None') ? $fields['parent'] : null);
696 $fields['data_sources'] = is_array($fields['data_sources']) ? implode(',', $fields['data_sources']) : null;
697 $fields['events'] = is_array($fields['events']) ? implode(',', $fields['events']) : null;
698 $fields['path'] = null;
699
700 if ($fields['parent']) {
@wdebusschere 763305c should take care of this
@wdebusschere Also check the other 2 commits ^^^ which should take care of mysql 8 if mysql's doc is right.