Changeset 4860
- Timestamp:
- 02/02/2007 12:04:35 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-schema.php
r4832 r4860 1 1 <?php 2 2 // Here we keep the DB structure and option values 3 4 $charset_collate = ''; 5 6 if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) { 7 if ( ! empty($wpdb->charset) ) 8 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 9 if ( ! empty($wpdb->collate) ) 10 $charset_collate .= " COLLATE $wpdb->collate"; 11 } 3 12 4 13 $wp_queries="CREATE TABLE $wpdb->categories ( … … 14 23 PRIMARY KEY (cat_ID), 15 24 KEY category_nicename (category_nicename) 16 ) ;25 ) $charset_collate; 17 26 CREATE TABLE $wpdb->comments ( 18 27 comment_ID bigint(20) unsigned NOT NULL auto_increment, … … 34 43 KEY comment_approved (comment_approved), 35 44 KEY comment_post_ID (comment_post_ID) 36 ) ;45 ) $charset_collate; 37 46 CREATE TABLE $wpdb->link2cat ( 38 47 rel_id bigint(20) NOT NULL auto_increment, … … 41 50 PRIMARY KEY (rel_id), 42 51 KEY link_id (link_id,category_id) 43 ) ;52 ) $charset_collate; 44 53 CREATE TABLE $wpdb->links ( 45 54 link_id bigint(20) NOT NULL auto_increment, … … 60 69 KEY link_category (link_category), 61 70 KEY link_visible (link_visible) 62 ) ;71 ) $charset_collate; 63 72 CREATE TABLE $wpdb->options ( 64 73 option_id bigint(20) NOT NULL auto_increment, … … 75 84 PRIMARY KEY (option_id,blog_id,option_name), 76 85 KEY option_name (option_name) 77 ) ;86 ) $charset_collate; 78 87 CREATE TABLE $wpdb->post2cat ( 79 88 rel_id bigint(20) NOT NULL auto_increment, … … 82 91 PRIMARY KEY (rel_id), 83 92 KEY post_id (post_id,category_id) 84 ) ;93 ) $charset_collate; 85 94 CREATE TABLE $wpdb->postmeta ( 86 95 meta_id bigint(20) NOT NULL auto_increment, … … 91 100 KEY post_id (post_id), 92 101 KEY meta_key (meta_key) 93 ) ;102 ) $charset_collate; 94 103 CREATE TABLE $wpdb->posts ( 95 104 ID bigint(20) unsigned NOT NULL auto_increment, … … 120 129 KEY post_name (post_name), 121 130 KEY type_status_date (post_type,post_status,post_date,ID) 122 ) ;131 ) $charset_collate; 123 132 CREATE TABLE $wpdb->users ( 124 133 ID bigint(20) unsigned NOT NULL auto_increment, … … 134 143 PRIMARY KEY (ID), 135 144 KEY user_login_key (user_login) 136 ) ;145 ) $charset_collate; 137 146 CREATE TABLE $wpdb->usermeta ( 138 147 umeta_id bigint(20) NOT NULL auto_increment, … … 143 152 KEY user_id (user_id), 144 153 KEY meta_key (meta_key) 145 ) ;";154 ) $charset_collate;"; 146 155 147 156 function populate_options() { -
trunk/wp-config-sample.php
r4424 r4860 5 5 define('DB_PASSWORD', 'password'); // ...and password 6 6 define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value 7 define('DB_CHARSET', 'utf8'); 8 define('DB_COLLATE', 'utf8_general_ci'); 7 9 8 10 // You can have multiple installations in one database if you give each a unique prefix -
trunk/wp-includes/version.php
r4859 r4860 4 4 5 5 $wp_version = '2.2-bleeding'; 6 $wp_db_version = 48 59;6 $wp_db_version = 4860; 7 7 8 8 ?> -
trunk/wp-includes/wp-db.php
r4832 r4860 36 36 var $postmeta; 37 37 38 var $charset; 39 var $collate; 40 38 41 /** 39 42 * Connects to the database server and selects a database … … 49 52 function __construct($dbuser, $dbpassword, $dbname, $dbhost) { 50 53 register_shutdown_function(array(&$this, "__destruct")); 54 55 if ( defined('DB_CHARSET') ) 56 $this->charset = DB_CHARSET; 57 58 if ( defined('DB_COLLATE') ) 59 $this->collate = DB_COLLATE; 51 60 52 61 $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword); … … 63 72 "); 64 73 } 74 75 if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') ) 76 $this->query("SET NAMES '$this->charset'"); 65 77 66 78 $this->select($dbname);
Note: See TracChangeset
for help on using the changeset viewer.