EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB20675: Incorrect report results are returned against a MySQL database using the unsigned integer datatype in MicroStrategy


Community Admin

• Strategy


SYMPTOM:
Incorrect results are returned through Strategy Developer and Strategy DB Query Tool against a MySQL database using the "Unsigned Int" datatype.
 
STEPS TO REPRODUCE:
Follow the steps below to reproduce this issue:
 

  1. Create a table with an attribute of data type `Unsigned Int` using Strategy DB Query Tool against a MySQL database.
    CREATE TABLE Unsigned_Int1 (
    'transaction_key' INTEGER UNSIGNED NOT NULL,
    'amount' DECIMAL NOT NULL,
    PRIMARY KEY (`transaction_key`)
    )
  2. Insert values into Unsigned_Int1 table:
    INSERT into Unsigned_Int1 values (
    4000000000, 100.00
    )
  3. Incorrect results are obtained through Developer and DB Query Tool (note the screenshot below depicts results in the former version of the DB Query Tool):
ka04W000000OhCsQAK_0EM440000002JI1.jpeg

 
CAUSE:
The issue may be caused by a difference between signed and unsigned integers. Unsigned integer ranges from 0 to 2 ^ (N - 1) while a signed integer ranges between - 2 ^ (N - 1) and .
 
For N=32 which is typical for long integers (or just integer datatype in general), the range is as follows:
 
Unsigned: 0 to 4294967295
 
Signed: -2147483648 to +2147483647
 
The "Unsigned Int" value in the database is represented by the driver as SQL_INTEGER and Strategy only allocates 4 bytes to store this data. Because of this, the data is incorrect.
 
 
ACTION:
Edit the metric in question and set the metric column alias to 'Big Decimal'. With this change, Strategy is able to assign the correct datatype internally and store the data correctly.
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

May 30, 2017

Last Updated:

May 30, 2017