JD-Builder icon indicating copy to clipboard operation
JD-Builder copied to clipboard

default table collation

Open shoulders opened this issue 6 years ago • 6 comments

the default collations for the databases might need looking at.

for some reason my default database collation was set at latin1_swedish_ci and becasue of this 3 tables were set to this, but the jdbuilder_pages was set to utf8mb4_unicode. can you set explicit table collations for these 3 tables i.e. utf8_unicode_ci or if you must utf8_general_ci

database-collations

shoulders avatar Oct 02 '19 13:10 shoulders

@shoulders we need to keep collation to utf8mb4_unicode_ci since that'll allow the tables to store multibyte data including emoji's, Chinese language characters and others.

Newer version so Joomla's default tables are now utf8mb4_unicode_ci unless I am mistaken. I just checked #__content.

chetanmadaan avatar Oct 03 '19 17:10 chetanmadaan

@chetanmadaan

Newer version so Joomla's default tables are now utf8mb4_unicode_ci unless I am mistaken. I just checked #__content.

This might just be for the core joomla tables. I cant speak directly about joomla but i know wordpress does a test to see if it can use utf8mb4 collation before it installs and if it can does use it, otherwise it defaults back to normal utf8. I would guess joomla 4 would be the same. I dont know about the install mechanism for the Joomla 4 to know whether it sets the collation or that the default collation for the database is used unless specfied in the mysql query. I think joomla 3 used the default databases collation though.

other way around. Keep utf8mb4_unicode_ci for the greater character range/emojis, this is fine.

It is the other tables I am concerned with. They would be better as utf8_unicode_ci or utf8_general_ci as this seems to be a standard collation and I am sure it is what wordpress uses for all of its tables when you do a default install.

as you can guess utf8_unicode_ci is the 3 byte version of utf8mb4_unicode_ci (4 byte)

when people have badly configured servers latin1_swedish_ci is used because this is the default collation. (p.s. I wish database developers would change this in their releases). Setting the collation for these tables prevents the wrong collation being used.

I dont know if you have a preference as to explicity set the collation or not. I personally manually change the tables to utf8_unicode_ci if I find any latin1_swedish_ci ones

shoulders avatar Oct 03 '19 18:10 shoulders

Thanks Jon for the through explanation. I am not an expert on this are and I'll do my research and then get back here.

chetanmadaan avatar Oct 03 '19 20:10 chetanmadaan

some notes i did a while ago, they might help.

https://quantumwarp.com/kb/articles/23-mysql/392-what-mysql-database-collation-should-i-use

shoulders avatar Oct 03 '19 22:10 shoulders

Thanks that's very helpful Jon.

chetanmadaan avatar Oct 05 '19 14:10 chetanmadaan

I read your post Jon and I think we'll keep utf8mb4_unicode_ci for _#_jdbuilder_layouts and _#_jdbuilder_templates and utf8_unicode_ci for the everything else.

chetanmadaan avatar Oct 06 '19 20:10 chetanmadaan