MySQL bug

Tomaso Minelli minni at stat.unipd.it
Wed Aug 22 08:14:10 PDT 2007


On my MySQL5 the indexes cannot be longer than 1000 bytes, than
using utf8 I've modified in storage.php the init function,
forcing indexing by UNIQUE (account(25), url(300)))

I hope to be useful

	Minni

     function _init()
     {
         $sreg_fields_sql = array('nickname VARCHAR(255)',
                                  'email VARCHAR(255)',
                                  'fullname VARCHAR(255)',
                                  'dob DATE',
                                  'gender CHAR(1)',
                                  'postcode VARCHAR(255)',
                                  'country VARCHAR(32)',
                                  'language VARCHAR(32)',
                                  'timezone VARCHAR(255)');

         $personas = "CREATE TABLE personas (id INTEGER AUTO_INCREMENT ".
             "NOT NULL PRIMARY KEY, ".
             "account VARCHAR(255) NOT NULL, ".implode(", ", 
$sreg_fields_sql).")";

         // Create tables for OpenID storage backend.
         $tables = array(
                         "CREATE TABLE identities (id INTEGER 
AUTO_INCREMENT ".
                         "NOT NULL PRIMARY KEY, ".
                         "account VARCHAR(255) NOT NULL, url TEXT NOT 
NULL, ".
                         "UNIQUE (account(25), url(300)))",

                         $personas,

                         "CREATE TABLE sites (account VARCHAR(255) NOT 
NULL, ".
                         "trust_root TEXT, trusted BOOLEAN, ".
                         "UNIQUE (account(25), trust_root(300)))"
                         );

         foreach ($tables as $t) {
             $result = $this->db->query($t);
         }
     }



More information about the Dev mailing list