New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSSQL Heidi crashes when there is a field with propery datetimeoffset, see's it as bit #496

mkeus opened this Issue Jan 24, 2019 · 6 comments


None yet
3 participants
Copy link

mkeus commented Jan 24, 2019


Steps to reproduce this issue

  1. have datatable with a column with type datetimeoffset(7) (in msssql management studio)
  2. select * from table; or click on TAB-Data
  3. application crashes

If you select all columns except the datetimeoffset column it works fine works fine, no crashes on table

strange thing.
If you do a view of the table columns (TAB: table) it shows the datetimeoffset(7) column as a BIT also shows BIT

Current behavior

See steps to reproduce, application crashes.

Expected behavior

show all data from table including the datetimeoffset column

Possible solution


  • HeidiSQL version:

  • Database system and version:
    MS SQL (EXPRESS) 14.0.2002
    MS SQL (Azure)

  • Operating system:
    WINDOWS 10


This comment has been minimized.

Copy link

ansgarbecker commented Jan 28, 2019

Relevant part of the crash callstack:

exception number   : 1
exception class    : EOleException
exception message  : Multiple-step operation generated errors. Check each status value.

main thread ($af80):
00aaa142 heidisql32.exe Data.Win.ADODB            TCustomADODataSet.GetFieldData
00a58c80 heidisql32.exe Data.DB                   TField.GetData
00a59120 heidisql32.exe Data.DB                   TField.GetIsNull
00b07457 heidisql32.exe dbconnection    6472   +7 TAdoDBQuery.IsNull
00db8d22 heidisql32.exe Main            8663  +10 TMainForm.AnyGridGetText
00949f46 heidisql32.exe VirtualTrees   33939   +8 TCustomVirtualStringTree.DoGetText
00948833 heidisql32.exe VirtualTrees   33413   +4 TCustomVirtualStringTree.GetText
00949e63 heidisql32.exe VirtualTrees   33923  +27 TCustomVirtualStringTree.DoGetNodeWidth
00939b28 heidisql32.exe VirtualTrees   26979  +85 TBaseVirtualTree.GetDisplayRect
00dbbb89 heidisql32.exe Main            9245  +28 TMainForm.AutoCalcColWidth
00da4b97 heidisql32.exe Main            5089 +175 TMainForm.DataGridBeforePaint

@ansgarbecker ansgarbecker added this to the v10.2 milestone Jan 28, 2019


This comment has been minimized.

Copy link

ansgarbecker commented Feb 10, 2019

I "silenced" that error for the next builds, so you should not get it any more, in any situation. Not sure if that's a good idea, you should definitely check that twice and report back.


This comment has been minimized.

Copy link

mkeus commented Feb 11, 2019

I still see the error when I select the DATA tab.
If I only select the field with type datetimeoffset I see a resultset with 'node' as value.

More info: when is select the datetimeoffset as last item in the query it returns fieldcount-1 so the datetimeoffset field is never selected. When there is a field behind the datetimeoffset field, it crashes.


This comment has been minimized.

Copy link

ansgarbecker commented Feb 11, 2019

The error is now not in .IsNull but in .GetValue, which renders my solution useless, I should even revert it.

I have no clue what this "Multiple-step operation generated errors" means. Can you shed some light on that?

@ansgarbecker ansgarbecker reopened this Feb 11, 2019


This comment has been minimized.

Copy link

mkeus commented Feb 11, 2019

It does not matter if I query 1 row with a null value for the field or an actual value. MS SQL management studio (MSMS) shows it as a datetime value.

I think the problem lies in the size of the field,
( --scenario 6

According to MSMS, The datetimeoffset field has the following properties:

Length = 10
precision = 34
numeric scale = 7


This comment has been minimized.

Copy link

bruce965 commented Feb 12, 2019

I noticed that in the "Table" tab, HeidiSQL does not correctly detect DATETIMEOFFSET fields.

The detected datatype is the same as the first previous non-DATETIMEOFFSET field.
I tested various tables and HeidiSQL versions, this behaviour is consistent.


I think the problem described by this bugreport is that:

  • In the "Data" tab, HeidiSQL tried to render the DATETIMEOFFSET field as the previous non-DATETIMEOFFSET field
  • This field happens to be a BIT (or maybe there is no previous non-DATETIMEOFFSET field at all)
  • DATETIMEOFFSET is not convertible to BIT

HeidiSQL never crashed on me when erroneously detecting DATETIMEOFFSET fields as NVARCHAR.
Only when detecting them as other values like BIT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment