Annoying notice: SET NAMES 'latin1'

Author Message

Felipe Jaramillo

Tuesday 17 January 2006 7:05:17 am

Hi,
In a recent installation of 3.7.2 in a production enviroment we are getting this message on every page view:

Notice: eZMySQLDB::query(0.000 ms) query number per page:0 Jan 16 2006 15:54:51
SET NAMES 'latin1'

Anyone knows why this is? The site works perfectly, but we don't want the log files getting filled up with this message.

Thanks in advance,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Hans Melis

Tuesday 17 January 2006 9:35:45 am

Hi Felipe,

That's a MySQL command to signal which character set to use in communications with the client. Taken from the MySQL manual:

NAMES {'charset_name' | DEFAULT}

SET NAMES sets the three session system variables character_set_client, character_set_connection, and character_set_results to the given character set. Setting character_set_connection to charset_name also sets collation_connection to the default collation for charset_name. See Section 10.4, “Connection Character Sets and Collations”.

The default mapping can be restored by using a value of DEFAULT.

Note that the syntax for SET NAMES differs from that for setting most other options. This statement is available as of MySQL 4.1.0.

http://dev.mysql.com/doc/refman/4.1/en/set-option.html

IIRC, this statement is executed before most of the ini settings are read. That would explain why disabling SQLOutput doesn't get rid of that message.

Hans
http://blog.hansmelis.be

Felipe Jaramillo

Wednesday 18 January 2006 3:08:40 pm

Thanks for your input.

We are using Mysql 4.1, so the message is reasonable.

Is there a way to prevent the notices from showing up in the logs?

Thanks a lot,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Marc Boon

Sunday 22 January 2006 6:45:28 am

If you really don't want that notice to appear, you could comment out line 198 of lib/ezdb/classes/ezmysqldb.php:

$query = "SET NAMES '" . $charset . "'";
$status = @mysql_query( $query, $connection );
// $this->reportQuery( 'eZMySQLDB', $query, false, false );

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.