Menu

#1050 MSSQL tinyint: problems with values >127

open
nobody
5
2019-08-28
2012-10-05
John Hardin
No

MSSQL tinyint (unsigned byte) data type has problems when the value is > 127.

(1) cannot enter values > 127 when editing data grid

(2) values > 127 displayed as negative numbers
demo:
SELECT TOP (255) CAST(ROW_NUMBER() OVER (ORDER BY object_id) AS tinyint) FROM sys.tables

(3) cannot enter values -1 ... -128 when editing data grid

See related MYSQL and Sybase bugs.

Discussion

  • James Toebes

    James Toebes - 2016-09-13

    Just posted info on https://sourceforge.net/p/squirrel-sql/bugs/1037/#9a95 for this, then found this message. Driver changed behavior, but neither driver works properly.

     
  • James Toebes

    James Toebes - 2016-09-14

    Downloaded SquirrelFX snapshot squirrelsqlfx-snapshot-20160821_1917.zip to compare. It is no where near as ready for daily use as the main Squirrel. It shows proper values above 127 with the same drivers.

     
  • James Toebes

    James Toebes - 2018-05-24

    Confirmed issue still exist in Squirrel 3.8.1

     
  • Gerd Wagner

    Gerd Wagner - 2018-05-31

    Please install the MySQL-Plugin. This fixed the problem for me.

    Some detail:
    I used a table created like that

    CREATE TABLE signedtest
    (
       signedtiny TINYINT,
       unsignedtiny TINYINT UNSIGNED
    )
    

    to test.

    Gerd

     
  • James Toebes

    James Toebes - 2019-02-15

    MySQL Plugin is installed. Same Issue.
    if i query as
    select fldTinyInt from tblValues
    Values are returned as

    ...
    -4
    -2
    -1
    2
    4
    5
    ...
    

    If I query as
    select cast(fldTinyInt as int) from tblValues

    0
    1
    2
    3
    ...
    247
    249
    252
    
     

Log in to post a comment.

Auth0 Logo