VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: extonjaez on June 08, 2016, 14:01:49 PM

Title: Illegal mix of collations (error 500, RuntimeException) after Update to 3.0.17
Post by: extonjaez on June 08, 2016, 14:01:49 PM
Hello,

I have this error (Illegal mix of collations (error 500, RuntimeException)) when i click on products details after update from 3.0.16 to 3.0.17.
see the picture :
https://gyazo.com/7d84567049519254df012b205fcd02d6
Many thanks for your help
Best Regards
Arnaud

System Information
PHP Built On    Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
Database Version    5.1.73-1+deb6u1
Database Collation    latin1_swedish_ci
Database Connection Collation    utf8_general_ci
PHP Version    5.5.36
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 3.5.1 Stable [ Unicorn ] 05-April-2016 22:45 GMT
Joomla! Platform Version    Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent    Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Title: Re: Illegal mix of collations (error 500, RuntimeException) after Update to 3.0.17
Post by: GJC Web Design on June 08, 2016, 15:11:45 PM
well, I guess it is as the error says .. you have a mix of collations and mysqli doesn't like it

FYI .. all my tables are utf8_general_ci
Title: Re: Illegal mix of collations (error 500, RuntimeException) after Update to 3.0.17
Post by: extonjaez on June 08, 2016, 15:46:20 PM
Hello,

what is your advice to fix it?
Many thanks for your help.. ;D
Title: Re: Illegal mix of collations (error 500, RuntimeException) after Update to 3.0.17
Post by: jenkinhill on June 08, 2016, 16:38:43 PM
Firstly VM3.0.17 is a test/development version for experienced users, and if you used the release on http://dev.virtuemart.net/projects/virtuemart/files it has already had several fixes and updates - if you really want to test it the latest fiiles are on SVN, http://dev.virtuemart.net/projects/virtuemart/repository

I have never seen anyone have a  collation issue before with VM, but it is a relatively simple matter to change collation using phpMyAdmin - Google for a "how to" with your host setup. Test on a copy of the db, of course!!!
Title: Re: Illegal mix of collations (error 500, RuntimeException) after Update to 3.0.17
Post by: franzpeter on June 14, 2016, 19:01:22 PM
@extonjaez
The error comes with the db query LEFT JOIN #__users. It is in /admininistrator/components/com_virtuemart/models/ratings.php on line 182.
You can try to exchange the line 182 where it reads:
private static $_select = ' `u`.*,`pr`.*,`l`.`product_name`,`rv`.`vote`, IFNULL(`u`.`name`, `pr`.`customer`) AS customer ';

with:
private static $_select = ' `u`.*,`pr`.*,`l`.`product_name`,`rv`.`vote`, IFNULL(`u`.`name` COLLATE utf8mb4_unicode_ci, `pr`.`customer`) AS customer ';

if that is not enough, it is possible too in addition to replace it like that:
private static $_select = ' `u`.*,`pr`.*,`l`.`product_name`,`rv`.`vote`, IFNULL(`u`.`name` COLLATE utf8mb4_unicode_ci, `pr`.`customer` COLLATE utf8_general_ci) AS customer ';
Hope it will help!
Title: Re: Illegal mix of collations (error 500, RuntimeException) after Update to 3.0.17
Post by: Milbo on July 20, 2016, 11:35:04 AM
Please test the latest version 3.0.17.2, it should contain a fix for this problem. http://dev.virtuemart.net/projects/virtuemart/files