In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Advanced Details Jump to Notes ] Wiki ]  Related Changesets ] View Simple ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0001226 [In-Portal CMS] Database bug report always 2012-03-14 12:31 2012-07-25 05:31
Reporter alex View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Platform
Status closed   OS
  OS Version
ETA none Fixed in Version 5.2.0-B3 Product Version 5.2.0-B2
  Target Version 5.2.0 Product Build
Time EstimateNo estimate
Summary 0001226: Storing function "crc32" results in database problem
Description When web server OS is 32bit, then results of crc32 functions are positive and negative numbers in range, that fits nicely in "signed int" column in MySQL database.

However, when web server OS is 64bit, then same crc32 function produces only positive numbers (internally converts negative results to positive, not by removing sign from them) producing number is no longer fits into "signed it" range and will fit only in:
* unsigned int
* signed/unsigned bigint

Since we can't guess what architecture of web server, that will run In-Portal, would be then we need to:
convert all negative results of crc32 function to positive using $positive_crc = printf('%u', $crc) code
make all db columns, that can store such numbers either "int unsigned" or "bigint"

In 5.2.0-B2 this was noticed after tag <inp2:st_ContentBlock name="logos"/> was executed and produced content block number was stored incorrectly resulting inability to save content block changes.
Steps To Reproduce
Additional Information We have 54 places, where crc32 function is used (across all modules) and each place needs to be inspected.

How to perform conversion in MySQL:
-----------------------------------

ALTER TABLE TableName CHANGE FieldName FieldName BIGINT(11) NOT NULL DEFAULT '0';

UPDATE TableName
SET FieldName = CAST((FieldName & 0xFFFFFFFF) AS UNSIGNED INTEGER)
WHERE FieldName < 0;
Tags No tags attached.
Reference https://groups.google.com/d/topic/in-portal-bugs/stMGddx3KJk/discussion
Change Log Message Fixes problems with crc32 function usage on 64bit web servers
Estimate Points 1
Attached Files patch file icon crc32_signed_problem_core.patch [^] (8,730 bytes) 2012-03-27 06:45 [Show Content]
patch file icon crc32_signed_problem_modules.patch [^] (7,639 bytes) 2012-03-27 06:46 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
parent of 0001223closed (5.2.0)!COMMUNITY Fatal on viewing page in Browse Mode via Catalog with MySQL in Strict mode 

-  Notes
User avatar (0004528)
alex (manager)
2012-03-27 06:46

Will test all together later.
User avatar (0004529)
alex (manager)
2012-03-27 06:51

Fix committed to 5.2.x branch. Commit Message:

Fixes 0001226: Storing function "crc32" results in database problem
User avatar (0004947)
alex (manager)
2012-07-25 05:31

Since 5.2.0 version was released.

- Related Changesets
In-Portal CMS: 5.2.x r15246
Timestamp: 2012-03-27 06:51:06
Author: alex
Details ] Diff ]
Fixes 0001226: Storing function "crc32" results in database problem
mod - /in-portal/branches/5.2.x/core/install/install_schema.sql Diff ] File ]
mod - /in-portal/branches/5.2.x/core/install/upgrades.sql Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/application.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/globals.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/managers/rewrite_url_processor.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/categories/categories_tag_processor.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/helpers/cat_dbitem_export_helper.php Diff ] File ]
Modules :: In-News: 5.2.x r15245
Timestamp: 2012-03-27 06:50:03
Author: alex
Details ] Diff ]
Bug 0001226: Storing function "crc32" results in database problem
mod - /modules/in-news/branches/5.2.x/units/articles/articles_event_handler.php Diff ] File ]
Modules :: In-Commerce: 5.2.x r15244
Timestamp: 2012-03-27 06:48:38
Author: alex
Details ] Diff ]
Bug 0001226: Storing function "crc32" results in database problem
mod - /w/in-commerce/branches/5.2.x/install/install_schema.sql Diff ] File ]
mod - /w/in-commerce/branches/5.2.x/install/upgrades.sql Diff ] File ]
mod - /w/in-commerce/branches/5.2.x/units/product_option_combinations/product_option_combinations_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.2.x/units/product_options/product_options_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.2.x/units/product_options/product_options_helper.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-07-25 05:31 alex Note Added: 0004947
2012-07-25 05:31 alex Status resolved => closed
2012-03-27 06:52 alex Relationship added parent of 0001223
2012-03-27 06:51 alex Note Added: 0004529
2012-03-27 06:51 alex Status reviewed and tested => resolved
2012-03-27 06:51 alex Fixed in Version => 5.2.0-B3
2012-03-27 06:51 alex Resolution open => fixed
2012-03-27 06:51 alex Assigned To !COMMUNITY => alex
2012-03-27 06:51 alex Changeset attached 5.2.x r15246
2012-03-27 06:50 alex Changeset attached 5.2.x r15245
2012-03-27 06:48 alex Changeset attached 5.2.x r15244
2012-03-27 06:47 alex Changeset attached 5.2.x r15243
2012-03-27 06:46 alex Note Added: 0004528
2012-03-27 06:46 alex Status needs testing => reviewed and tested
2012-03-27 06:46 alex Assigned To => !COMMUNITY
2012-03-27 06:46 alex Developer => alex
2012-03-27 06:46 alex Status active => needs testing
2012-03-27 06:46 alex File Added: crc32_signed_problem_modules.patch
2012-03-27 06:45 alex File Added: crc32_signed_problem_core.patch
2012-03-27 06:45 alex Additional Information Updated View Revisions
2012-03-14 12:31 alex New Issue
2012-03-14 12:31 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/stMGddx3KJk/discussion
2012-03-14 12:31 alex Change Log Message => Fixes problems with crc32 function usage on 64bit web servers
2012-03-14 12:31 alex Estimate Points => 1



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker