Error -2147024362 When Logging to MySQL DB on TestStand

Updated Jan 3, 2025

Reported In

Software

  • TestStand

Operating System

  • Windows

Issue Details

I recently updated Windows 10 to build version 19045.5011. This was an automatic Windows Update KB5044273. Now when I use a MySQL database in TestStand, I receive the following error:

 

An error occurred calling 'LogResults' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred executing a statement.
Schema: MySQL Insert (NI)
Statement: PROP_BINARY.
Description: Arithmetic result exceeded 32 bits.
Number: -2147024362
NativeError: -2147024362
SQLState:
Reported by: Provider

 

How do I get around this error?

Solution

This is a bug that has been reported and is being investigated. This affected all TestStand 64-bit versions after 2014 and began occurring after Windows Update KB5044273 for Windows 10, and KB5044285 for Windows 11. 

 

To resolve this issue, follow these steps as a workaround:

  1. Take a backup of the existing DBLog.dll from path C:\Program Files\National Instruments\TestStand 2023\Components\Models\TestStandModels\Database\DBLog\x64
  2. Open C:\Program Files\National Instruments\TestStand 2023\Components\Models\TestStandModels\Database\DBLog\DBLog.vcxproj in Visual Studio.
  3. Open DBLog Project properties and include the following directories in Additional Include Directories.
    • C:\Program Files\National Instruments\TestStand 2023\Bin
    • C:\Program Files\National Instruments\TestStand 2023\API\VC
       
  4. From the solution explorer, right-click on DBLog.rc file and select View code.
  5. Make changes to lines 57 and 58 as shown in the below image and save the file.
  6. Open Columns.cpp and go to line 1012, make the change as shown below, and save the file.
  7. Rebuild the project.

The following step is only to be done if you receive an error related to Intellisence during the build.

  1. Open DBLog.vcxproj as a file, find and delete the line <ForcedIncludeFiles>x64_IntellisenseIssueWorkaround.h</ForcedIncludeFiles>
  2. Rebuild the project

Additional Information

A non-NI workaround for this is to simply uninstall the Windows Update.

This bug affects builds 19044.5011 and 19045.5011 on Windows 10 and builds 22621.4317 and 22631.4317 on Windows 11. To check the build of your Windows do the following:

  1. Go to the Start Menu and type winver
  2. Run the command
  3. The second line in the dialog box that opens shows the current build version