$this->is_multiple = $info->multiple_key;
$this->is_key = ( $this->is_pk || $this->is_unique || $this->is_multiple );
$this->type = $info->type;
+ $this->flags = $info->flags;
$this->binary = isset( $info->binary ) ? $info->binary : false;
}
return $this->is_multiple;
}
+ /**
+ * @return int
+ */
+ function flags() {
+ return $this->flags;
+ }
+
function isBinary() {
return $this->binary;
}
array( 'dropTable', 'hitcounter' ),
array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
+ array( 'doUserNewTalkUseridUnsigned' ),
);
}
'Making iwl_prefix_title_from index non-UNIQUE'
);
}
+
+ protected function doUserNewTalkUseridUnsigned() {
+ if ( !$this->doTable( 'user_newtalk' ) ) {
+ return true;
+ }
+
+ $info = $this->db->fieldInfo( 'user_newtalk', 'user_id' );
+ if ( $info === false ) {
+ return true;
+ }
+ if ( ( $info->flags() & 32 /*MYSQLI_UNSIGNED_FLAG*/ ) ) {
+ $this->output( "...user_id is already unsigned int.\n" );
+
+ return true;
+ }
+
+ return $this->applyPatch(
+ 'patch-user-newtalk-userid-unsigned.sql',
+ false,
+ 'Making user_id unsigned int'
+ );
+ }
}
--
CREATE TABLE /*_*/user_newtalk (
-- Key to user.user_id
- user_id int NOT NULL default 0,
+ user_id int unsigned NOT NULL default 0,
-- If the user is an anonymous user their IP address is stored here
-- since the user_id of 0 is ambiguous
user_ip varbinary(40) NOT NULL default '',