Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Database upgrade success but has one strange utf8 table

Database upgrade success but has one strange utf8 table

Views: 2,671

Results 1 to 9 of 9
22 Jun 2010, 8:36 PM
#1
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Database upgrade success but has one strange utf8 table

I upgraded from 138a to 139d today. The db upgrade was successful without any errors and the site works ok so far in my testing.

I noticed however that one table "counter_history" is in utf-8_general_ci while all my other other tables are in latin1.

Is this what is suppose to happen? or did I make a mistake somewhere? The counter history is working fine.

here is that table before and after the upgrade (phpmyadmin dump)

Before:

-- Table structure for table `counter_history`
--

DROP TABLE IF EXISTS `counter_history`;
CREATE TABLE IF NOT EXISTS `counter_history` (
  `startdate` char(8) default NULL,
  `counter` int(12) default NULL,
  `session_counter` int(12) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--

After:

-- Table structure for table `counter_history`
--

DROP TABLE IF EXISTS `counter_history`;
CREATE TABLE IF NOT EXISTS `counter_history` (
  `startdate` char(8) character set latin1 NOT NULL default '',
  `counter` int(12) default NULL,
  `session_counter` int(12) default NULL,
  PRIMARY KEY  (`startdate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--

This appears to be the only difference in my dbs.

Before the upgrade I created 2 new "my_db_charset.php" files and defined latin1 as the CHARSET in both: : define('DB_CHARSET', 'latin1'); and left the installer_params.php unchanged as latin1.

or should I do the upgrade again?

22 Jun 2010, 8:59 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Database upgrade success but has one strange utf8 table

There's nothing wrong.
The upgrade intentionally deletes the old counter_history table and recreates it.
And the table was created using the new character set (presumably set by defaults on your server).
It will function just fine.

22 Jun 2010, 9:18 PM
#3
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Database upgrade success but has one strange utf8 table

Ah, I see now....yes my server MySQL client version: 5.0.90 seems to not like latin1 and any chance it gets it defaults to utf8.

If I leave it as is, will I be able to upgrade to ZC 2.0 ok?

22 Jun 2010, 9:39 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Database upgrade success but has one strange utf8 table

Let's deal with 2.0 when that time comes.

2 Nov 2011, 12:50 PM
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Database upgrade success but has one strange utf8 table

I ran into a problem with an upgrade with this same table - only it stopped at that point because of that same scenario.

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

I've never had this happen before on my server and an upgrade so I went back to the original hosting and had the same thing happen on the other server.

So now I'm stuck and don't see a way past this. I've tried a couple of things but it keeps hanging up on this table.

2 Nov 2011, 3:05 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Database upgrade success but has one strange utf8 table

change the DB_CHARSET in the installer_params to 'latin1' instead of 'utf8'

2 Nov 2011, 3:26 PM
#7
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Database upgrade success but has one strange utf8 table

Beautiful! Thanks.

Now can you explain what happened? Or is it just not incredibly important to know?

2 Nov 2011, 3:29 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Database upgrade success but has one strange utf8 table

Your database is latin1, and your ZC upgrader was attempting to treat it as utf8.
If your database isn't utf8, don't treat it as utf8.

2 Nov 2011, 3:54 PM
#9
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Database upgrade success but has one strange utf8 table

aha, thanks!