Index: branches/5.2.x/install/install_schema.sql =================================================================== diff -u -N -r14884 -r15244 --- branches/5.2.x/install/install_schema.sql (.../install_schema.sql) (revision 14884) +++ branches/5.2.x/install/install_schema.sql (.../install_schema.sql) (revision 15244) @@ -89,26 +89,26 @@ ); CREATE TABLE OrderItems ( - OrderItemId int(11) NOT NULL auto_increment, - OrderId int(11) NOT NULL default '0', - ProductId int(11) NOT NULL default '0', - ProductName varchar(255) NOT NULL default '', - Quantity int(11) NOT NULL default '0', - QuantityReserved int(11) default NULL, - FlatPrice decimal(10,4) NOT NULL default '0.0000', - Price decimal(10,4) NOT NULL default '0.0000', - Cost double(10,4) NOT NULL default '0.0000', - BackOrderFlag tinyint(4) default '0', - Weight double default NULL, - ShippingTypeId varchar(255) default NULL, + OrderItemId int(11) NOT NULL AUTO_INCREMENT, + OrderId int(11) NOT NULL DEFAULT '0', + ProductId int(11) NOT NULL DEFAULT '0', + ProductName varchar(255) NOT NULL DEFAULT '', + Quantity int(11) NOT NULL DEFAULT '0', + QuantityReserved int(11) DEFAULT NULL, + FlatPrice decimal(10,4) NOT NULL DEFAULT '0.0000', + Price decimal(10,4) NOT NULL DEFAULT '0.0000', + Cost double(10,4) NOT NULL DEFAULT '0.0000', + BackOrderFlag tinyint(4) DEFAULT '0', + Weight double DEFAULT NULL, + ShippingTypeId varchar(255) DEFAULT NULL, ItemData text, - OptionsSalt int(11) default '0', - SplitShippingGroup int(11) NOT NULL default '0', - PackageNum int(11) NOT NULL default '0', - ReturnType tinyint(3) unsigned NOT NULL default '0', - ReturnAmount decimal(10,2) NOT NULL default '0.00', - ReturnedOn int(10) unsigned default NULL, - PRIMARY KEY (OrderItemId), + OptionsSalt bigint(11) DEFAULT '0', + SplitShippingGroup int(11) NOT NULL DEFAULT '0', + PackageNum int(11) NOT NULL DEFAULT '0', + ReturnType tinyint(3) unsigned NOT NULL DEFAULT '0', + ReturnAmount decimal(10,2) NOT NULL DEFAULT '0.00', + ReturnedOn int(10) unsigned DEFAULT NULL, + PRIMARY KEY (OrderItemId), KEY OrderId (OrderId), KEY ProductId (ProductId), KEY BackOrderFlag (BackOrderFlag), @@ -672,7 +672,7 @@ CombinationId int(11) NOT NULL AUTO_INCREMENT, ProductId int(11) NOT NULL DEFAULT '0', Combination text, - CombinationCRC int(11) NOT NULL DEFAULT '0', + CombinationCRC bigint(11) NOT NULL DEFAULT '0', PriceType tinyint(1) DEFAULT '3', Price float DEFAULT NULL, WeightType tinyint(1) DEFAULT '3', Index: branches/5.2.x/units/product_options/product_options_helper.php =================================================================== diff -u -N -r14702 -r15244 --- branches/5.2.x/units/product_options/product_options_helper.php (.../product_options_helper.php) (revision 14702) +++ branches/5.2.x/units/product_options/product_options_helper.php (.../product_options_helper.php) (revision 15244) @@ -1,6 +1,6 @@ CatalogReviews review_table WHERE review_table.ItemId = main_table.ResourceId); # ===== v 5.2.0-B3 ===== +ALTER TABLE OrderItems CHANGE OptionsSalt OptionsSalt BIGINT(11) NULL DEFAULT '0'; +UPDATE OrderItems +SET OptionsSalt = CAST((OptionsSalt & 0xFFFFFFFF) AS UNSIGNED INTEGER) +WHERE OptionsSalt < 0; + +ALTER TABLE ProductOptionCombinations CHANGE CombinationCRC CombinationCRC BIGINT(11) NOT NULL DEFAULT '0'; +UPDATE ProductOptionCombinations +SET CombinationCRC = CAST((CombinationCRC & 0xFFFFFFFF) AS UNSIGNED INTEGER) +WHERE CombinationCRC < 0; Index: branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php =================================================================== diff -u -N -r15149 -r15244 --- branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 15149) +++ branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php (.../product_option_combinations_event_handler.php) (revision 15244) @@ -1,6 +1,6 @@ GetDBField('Combination')); ksort($options); - $object->SetDBField('CombinationCRC', crc32(serialize($options))); + $object->SetDBField('CombinationCRC', kUtil::crc32(serialize($options))); break; case 'OnMassDelete': @@ -97,7 +97,7 @@ $salt = $fields['Combination']; ksort($salt); - $object->Load(crc32(serialize($salt)), 'CombinationCRC'); + $object->Load(kUtil::crc32(serialize($salt)), 'CombinationCRC'); $object->SetFieldsFromHash($fields); $this->customProcessing($event,'before'); if ( $object->isLoaded() ) { // Update if such combination already exists @@ -142,7 +142,7 @@ $salt = $fields['Combination']; ksort($salt); // try to load combination by salt - if loaded, it will update the combination - $object->Load(crc32(serialize($salt)), 'CombinationCRC'); + $object->Load(kUtil::crc32(serialize($salt)), 'CombinationCRC'); if ( !$object->isLoaded() ) { $object->Load($edit_id); } @@ -350,7 +350,7 @@ ksort($n_combs); $n_combs = serialize($n_combs); - $n_crc = crc32($n_combs); + $n_crc = kUtil::crc32($n_combs); $object->SetDBField('Combination', $n_combs); $object->SetDBField('CombinationCRC', $n_crc); } Index: branches/5.2.x/units/product_options/product_options_event_handler.php =================================================================== diff -u -N -r15149 -r15244 --- branches/5.2.x/units/product_options/product_options_event_handler.php (.../product_options_event_handler.php) (revision 15149) +++ branches/5.2.x/units/product_options/product_options_event_handler.php (.../product_options_event_handler.php) (revision 15244) @@ -1,6 +1,6 @@ Conn->qstr($n_combs) . ',