CatalogNodes.OrderBy type "short" too short

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
crockettdunn
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Sun Oct 26, 2008 6:32 pm
Contact:

CatalogNodes.OrderBy type "short" too short

Post by crockettdunn » Fri Nov 01, 2013 9:17 pm

Anyone else run into the issue when they have too many items in a category, and the OrderBy field gets populated with -32768 repeatedly. This is the lower bound of the SmallInt (short) datatype.

On one hand, I'd like to have "real" values in the orderby field.

OTOH, if it's not going to cause problems for the orderby values to all be identical for items that don't need explicit sorting, I don't want to mess with the DB design and C# variable types.

Anyone with more experience care to comment or offer guidance?

Thanks,
Crockett

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: CatalogNodes.OrderBy type "short" too short

Post by ForumsAdmin » Mon Nov 04, 2013 11:34 pm

Although this issue hasn't come up often we do have an enhancement bug registered in our database about updating the 'short' type fields to 'int'. There are two such locations where limit of 'short' datatype can be reached. One is the orderby field as you have mentioned. It can happen if a category has more than 32,767 nodes. The workround for this is to sub-categorize such a huge category. The other field is the quantity field. It is very rare for the quantity field to exceed 32,767, but special situations can always occur. We are considering to update these fields to 'int' in future.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: CatalogNodes.OrderBy type "short" too short

Post by AbleMods » Thu Nov 07, 2013 7:25 am

ForumsAdmin wrote:It is very rare for the quantity field to exceed 32,767, but special situations can always occur.
The bigger issue is not quantity data being persisted, it's the quantity data in reports. Without type conversion, the developer is forced to use shorts for report totals of quantity, which can (and does) easily exceed the max value.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: CatalogNodes.OrderBy type "short" too short

Post by ForumsAdmin » Tue Nov 19, 2013 12:16 am

A bug has been loged to increase the size of 'short' fields to 'int'. What is preventing us from getting this done straight away is the amount of changes it will require throughout the code base. We are trying to access the best course of action.

User avatar
crockettdunn
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Sun Oct 26, 2008 6:32 pm
Contact:

Re: CatalogNodes.OrderBy type "short" too short

Post by crockettdunn » Tue May 27, 2014 10:02 am

thanks.

Post Reply