TaoK / PoorMansTSqlFormatter

A small free .Net and JS library (with demo UI, command-line bulk formatter, SSMS/VS add-in, notepad++ plugin, winmerge plugin, and demo webpage) for reformatting and coloring T-SQL code to the user's preferences.
http://www.architectshack.com/PoorMansTSqlFormatter.ashx
GNU Affero General Public License v3.0
969 stars 268 forks source link

Having a width shorter than the length of binary data breaks the binary data #257

Open credfeto opened 4 years ago

credfeto commented 4 years ago

Given the input below and a max width of 12

INSERT INTO [dbo.].[BinaryExample] (
    [Name],
    [Data]
    )
VALUES (
    'SmileyFace',
    0x89504e470D0A1A0A0000000D49484452000000640000005C080600000098CB10940000200049444154789C95BD079464577536FADD5
    )

this gets formatted into:

INSERT INTO 
    [dbo.].
    [BinaryExample] 
    (
    [Name]
    ,[Data]
    )
VALUES (
    'SmileyFace'
    ,0x
    89504E470D0A1A0A0000000D49484452000000640000005C080600000098CB10940000200049444154789C95BD079464577536FADD5
    )

validated against poorsql.com the following option and 1.6.16 of the .net command line

image