[SOLVED] G2 issues #2: Can't upgrade Random Highlight module

robinbowes

Joined: 2002-09-20
Posts: 99
Posted: Mon, 2005-04-18 22:49

Hi,

I've having a few problems with G2 and this is the second in a set of posts that will list them.

#2: Can't upgrade Random Highlight module

When I try to upgrade the Random Highlight module from 0.8.6 to 0.9.3 I get the following error:

Error Detail -
Error (ERROR_STORAGE_FAILURE, ERROR_UNKNOWN)

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1190 (gallerystatus::error)
* in modules/core/classes/GalleryStorage.class at line 241 (mysqldatabasestorage::execute)
* in modules/randomhighlight/module.inc at line 97 (gallerystorage::execute)
* in modules/core/classes/GalleryModule.class at line 137 (randomhighlightmodule::upgrade)
* in modules/core/AdminModules.inc at line 85 (randomhighlightmodule::installorupgrade)
* in main.php at line 173 (adminmodulescontroller::handlerequest)
* in main.php at line 79
* in main.php at line 70

Any idea what might cause this? Database structure, possibly?

R.
----

Gallery URL (optional): http://gallery.robinbowes.com
Gallery version: G2 Beta (from CVS) (How do I tell the version no.?)
Webserver (with version): apache 2.0.52
Datatabase (with version): 4.1.7
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional):
Graphics Toolkit(s): NetPBM
Operating system: Fedora Core 3
Web browser/version: Firefox
G1 version (for migration bugs):

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-04-18 22:58

did the error page showing that error have a note about turning on buffered debug output to capture the details of the database error? anyway, please turn on buffered debug output and try again.. look near the bottom of the debug output and post the error message here.

(for version number when using cvs or nightly, just say the date of the nightly build or last cvs update)

 
robinbowes

Joined: 2002-09-20
Posts: 99
Posted: Mon, 2005-04-18 23:20
robinbowes wrote:
Hi,

I've having a few problems with G2 and this is the second in a set of posts that will list them.

#2: Can't upgrade Random Highlight module

When I try to upgrade the Random Highlight module from 0.8.6 to 0.9.3 I get the following error:

Error Detail -
Error (ERROR_STORAGE_FAILURE, ERROR_UNKNOWN)

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1190 (gallerystatus::error)
* in modules/core/classes/GalleryStorage.class at line 241 (mysqldatabasestorage::execute)
* in modules/randomhighlight/module.inc at line 97 (gallerystorage::execute)
* in modules/core/classes/GalleryModule.class at line 137 (randomhighlightmodule::upgrade)
* in modules/core/AdminModules.inc at line 85 (randomhighlightmodule::installorupgrade)
* in main.php at line 173 (adminmodulescontroller::handlerequest)
* in main.php at line 79
* in main.php at line 70

Any idea what might cause this? Database structure, possibly?

R.
----

Gallery URL (optional): http://gallery.robinbowes.com
Gallery version: G2 Beta (from CVS) (How do I tell the version no.?)
Webserver (with version): apache 2.0.52
Datatabase (with version): 4.1.7
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional):
Graphics Toolkit(s): NetPBM
Operating system: Fedora Core 3
Web browser/version: Firefox
G1 version (for migration bugs):

Aha! I just turned on buffered debug output and saw the following error:

mysql error: [1267: Illegal mix of collations (utf8_general_ci,IMPLICIT)
and (latin1_swedish_ci,COERCIBLE) for operation 'concat'] in
EXECUTE("UPDATE g2_Entity
		    SET g_entityType = 'GalleryDerivativeImage',
			g_onLoadHandlers = CONCAT(g2_Entity.g_onLoadHandlers,
'RandomHighlight|')
		  WHERE g2_Entity.g_entityType = 'RandomHighlightDerivativeImage'
		    AND g2_Entity.g_onLoadHandlers IS NOT NULL")

I've seen this before - unless you're explicitly setting the character set to latin1_swedish_ci then I need to use some start-up switch to make MySQL start with the correct default character set so any scripts that run will use it.

Now, how do I do that...

R.

 
robinbowes

Joined: 2002-09-20
Posts: 99
Posted: Mon, 2005-04-18 23:23
mindless wrote:
did the error page showing that error have a note about turning on buffered debug output to capture the details of the database error? anyway, please turn on buffered debug output and try again.. look near the bottom of the debug output and post the error message here.

(for version number when using cvs or nightly, just say the date of the nightly build or last cvs update)

Erm, yes it did - I noticed *after* I'd posted the messages, of course!

Ok, date of CVS is about 30 mins ago!

 
robinbowes

Joined: 2002-09-20
Posts: 99
Posted: Mon, 2005-04-18 23:59
robinbowes wrote:
Aha! I just turned on buffered debug output and saw the following error:

mysql error: [1267: Illegal mix of collations (utf8_general_ci,IMPLICIT)
and (latin1_swedish_ci,COERCIBLE) for operation 'concat'] in
EXECUTE("UPDATE g2_Entity
		    SET g_entityType = 'GalleryDerivativeImage',
			g_onLoadHandlers = CONCAT(g2_Entity.g_onLoadHandlers,
'RandomHighlight|')
		  WHERE g2_Entity.g_entityType = 'RandomHighlightDerivativeImage'
		    AND g2_Entity.g_onLoadHandlers IS NOT NULL")

I've seen this before - unless you're explicitly setting the character set to latin1_swedish_ci then I need to use some start-up switch to make MySQL start with the correct default character set so any scripts that run will use it.

Now, how do I do that...

R.

Answer:

Add the following lines to the [mysqld] section of /etc/my.cnf:
character_set_server=utf8
collation_server=utf8_general_ci

Now, any sql gets executed with utf8 as the default rather than the compiled-in default of latin.

What I find strange is that I only get this problem with two modules - all the others worked fine.

R.