Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Assertion fail crash when no records satisfy DELETE clause #69

elarcent opened this Issue · 11 comments

4 participants


Win64 system built driver, node 0.8.8
when executing DELETE, and no records satisfy WHERE clause, driver crashes with assertion error:

Assertion failed!

Program c:\node\node.exe
File: ..\src\OdbcException.cpp
Line: 34

Expression: false

For example, any empty table, with ID column. "DELETE from testTable1 WHERE ID=1" triggers the error and driver crashes.
Sample code:

var sql = require('node-sqlazure');
var connectionString = "...skipped...";, function (error, conn) {
  if(!error) {
      conn.queryRaw("DELETE FROM dbo.testTable1 WHERE ID=1", function(err, result) {

The same obviously happens when DELETE affects zero rows on any real table.

@wread wread was assigned

Assigning to @wread to see if he can reproduce this. Just FYI, we have not tested Node.js 0.8.x with this driver. Are you on the develop branch? Do you think you'd be able to attach a C++ debugger and let us know where it is crashing in the driver code?


No, I'm on master branch. Unfortunately I've got none of C++ knowledge/experience, so I'm not sure if I will be any help with debugging.
I tried to reproduce the problem on Azure VM with Windows Server 2008 and 2012, I managed to compile the driver from scratch, however any attempt to run the code resulted in

[Error: IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified]

error. My connection string is correct, and the same code runs without this error on my local machine.


@elarcent could you please try the Develop branch? Also, it looks like you haven't installed the SQL Server Native Client?


OK, I can confirm there is no DELETE clause bug in Develop branch.

I just re-installed SQL Server Native Client on the Windows Server 2012 Azure VM, and still receive "[Error: IM002: [Microsoft][ODBC Driver Manager] Data source name not found.." error message with both develop and master branches. Maybe something specific needs to be done when installing on Windows Server comparing to regular Windows 7 installation? I downloaded and installed it from here
It turns out to be serious problems for me, as I supposed to deploy my application on Windows Server VM


Did you download the 64-bit package, or the 32-bit one? Why do you need to run Node.js in 64-bit? Are you able to try 32-bit?


Yes, 64-bit
Well, Windows Server 2008/2012 VM is 64-bit system by default, even on small virtual machine. 32-bit version of SQL Server Native Client just wouldn't install there.


The 64-bit version of the Native Client installs both 32 and 64 bit libraries. Could you please try running Node.js in 32-bit and compiling the driver also in 32-bit? Actually, come to think of it, HOW are you compiling the driver?


OK, I will try to rebuild the driver on 32-bit everything and report on results.

For the compilation process on 64-bit system, I just follow instructions listed in readme:

node.js 0.8.8 64-bit,
node-gyp(npm install -g node-gyp) + Windows 7 64-bit SDK(required for node-gyp),
python 2.7.x 64-bit, add it to PATH,
Visual C++ 2010 Express edition,
SQL Server Native Client 11.0 64-bit,

then from Windows 7 SDK Command Prompt(otherwise it wont compile) node-gyp configure and build.

I want to stress it works locally on Windows 7 machine, the problem arises when installed on Windows Server 2008 or 2012 installed on Azure VM


Ok, thanks. Let us know how it goes...


This was a known issue that was fixed on the develop branch by commit 5fd2821

If you can verify that this issue is fixed, we may close it.


verified with latest sync

@wread wread closed this
@wread wread was unassigned by elarcent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.