Page 1 of 1

CatalogNodes.OrderBy type "short" too short

Posted: Fri Nov 01, 2013 9:17 pm
by crockettdunn
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

Re: CatalogNodes.OrderBy type "short" too short

Posted: Mon Nov 04, 2013 11:34 pm
by ForumsAdmin
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.

Re: CatalogNodes.OrderBy type "short" too short

Posted: Thu Nov 07, 2013 7:25 am
by AbleMods
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.

Re: CatalogNodes.OrderBy type "short" too short

Posted: Tue Nov 19, 2013 12:16 am
by ForumsAdmin
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.

Re: CatalogNodes.OrderBy type "short" too short

Posted: Tue May 27, 2014 10:02 am
by crockettdunn
thanks.