Changeset 472

Show
Ignore:
Timestamp:
22/12/07 13:58:56 (12 months ago)
Author:
smoku
Message:

Changed the way UTF-8 is selected on MySQL connection. Fixes #177

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/storage/storage_mysql.c

    r238 r472  
    624624#endif 
    625625 
     626    mysql_options(conn, MYSQL_SET_CHARSET_NAME, "utf8"); 
     627 
    626628    /* connect with CLIENT_INTERACTIVE to get a (possibly) higher timeout value than default */ 
    627629    if(mysql_real_connect(conn, host, user, pass, dbname, atoi(port), NULL, CLIENT_INTERACTIVE) == NULL) { 
     
    631633    } 
    632634 
    633     mysql_query(conn, "SET NAMES 'utf8'"); 
    634  
    635635    /* Set reconnect flag to 1 (set to 0 by default from mysql 5 on) */ 
    636636    conn->reconnect = 1; 
    637637 
    638     data = (drvdata_t) malloc(sizeof(struct drvdata_st)); 
    639     memset(data, 0, sizeof(struct drvdata_st)); 
     638    data = (drvdata_t) calloc(1, sizeof(struct drvdata_st)); 
    640639 
    641640    data->conn = conn;