Forums / Upgrading from 1.3.x to 1.3.9 / Collation problem upgrading from 1.3.8 to 1.3.9

Collation problem upgrading from 1.3.8 to 1.3.9

Locked

Started by artcoder on 24 Nov 2010, 5:57 AM · Views: 3,482

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
24 Nov 2010, 5:57 AM
#1
artcoder avatar

artcoder

Zen Follower

Join Date:
Jan 2007
Posts:
166
Plugin Contributions:
0

Collation problem upgrading from 1.3.8 to 1.3.9

I'm running the database upgrade from zc_install and got the following error ...

1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
in:
[CREATE TABLE zen_counter_history_clean as SELECT * FROM zen_counter_history WHERE 1 GROUP BY startdate COLLATE latin1_general_ci;]

I see in phpMyAdmin that my tables are utf8_unicode_ci and type MyISAM.

What is your recommendation on getting the database upgraded?

24 Nov 2010, 6:02 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Collation problem upgrading from 1.3.8 to 1.3.9

You will have to edit the upgrade sql and change latin1_general_ci to utf8

Zen-Venom Get Bitten

24 Nov 2010, 6:21 AM
#3
artcoder avatar

artcoder

Zen Follower

Join Date:
Jan 2007
Posts:
166
Plugin Contributions:
0

Re: Collation problem upgrading from 1.3.8 to 1.3.9

Or could I use phpMyAdmin and change all my tables from utf8 to latin1_general_ci instead? Not sure if doing that would corrupt my data or not.

And then run the script as is.

24 Nov 2010, 6:31 AM
#4
artcoder avatar

artcoder

Zen Follower

Join Date:
Jan 2007
Posts:
166
Plugin Contributions:
0

Re: Collation problem upgrading from 1.3.8 to 1.3.9

Because I'm not seeing how to edit the mysql_upgrade_zencart_138_to_139.sql file.

The line in question is ...

# fix counter_history race condition
#NEXT_X_ROWS_AS_ONE_COMMAND:5
CREATE TABLE counter_history_clean as 
SELECT * FROM counter_history WHERE 1 GROUP BY startdate;
DROP TABLE counter_history;
RENAME TABLE counter_history_clean 
TO counter_history;

And I don't see the mention of "latin" anywhere in this file. I don't find the word "collate" in the script either.

I also wonder... If the above sql statement fails, does it abort the script? Or do the subsequent sql statements get run nevertheless?

24 Nov 2010, 6:47 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Collation problem upgrading from 1.3.8 to 1.3.9

Which 1.3.9 version are you upgrading to?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Nov 2010, 6:48 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Collation problem upgrading from 1.3.8 to 1.3.9

Because I'm not seeing how to edit the mysql_upgrade_zencart_138_to_139.sql file.
My bad should have stated installer
DrByte:

Evidently you've created the table with UTF8 character set. If that's what you want to continue using, then change the DB_CHARSET in /zc_install/includes/installer_params.php to 'utf8' before using zc_install.
Post#6
http://www.zen-cart.com/forum/showthread.php?t=157297

Zen-Venom Get Bitten

24 Nov 2010, 7:01 AM
#7
artcoder avatar

artcoder

Zen Follower

Join Date:
Jan 2007
Posts:
166
Plugin Contributions:
0

Re: Collation problem upgrading from 1.3.8 to 1.3.9

Upgrading to 1.3.9h.

And yes, setting DB_CHARSET from latin1 to utf8 appears to work. Database upgraded successfully.

Thanks.

29 Apr 2011, 2:31 PM
#8
stuffdone avatar

stuffdone

Zen Follower

Join Date:
Jul 2007
Posts:
156
Plugin Contributions:
0

Re: Collation problem upgrading from 1.3.8 to 1.3.9

So this is the Easy 3 step Upgrade ! :laugh:

28 years web design and counting.
https://stuffdone.com

29 Apr 2011, 2:39 PM
#9
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,189
Plugin Contributions:
0

Re: Collation problem upgrading from 1.3.8 to 1.3.9

stuffdone:

So this is the Easy 3 step Upgrade ! :laugh:

@stuffdone,
Maybe you would like to donate your time and help with the zencart community for detailed instructions on upgrading.. > Nothing is easy when you procrastinate 10 versions behind schedule...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.