Assertion fail crash when no records satisfy DELETE clause #69

Closed
elarcent opened this Issue Sep 2, 2012 · 11 comments

Comments

Projects
None yet
4 participants
@elarcent

elarcent commented Sep 2, 2012

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...";

sql.open(connectionString, function (error, conn) {
  if(!error) {
      conn.queryRaw("DELETE FROM dbo.testTable1 WHERE ID=1", function(err, result) {
        console.log('ok');
      });
  }
});

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

@ghost ghost assigned wread Sep 2, 2012

@jguerin

This comment has been minimized.

Show comment Hide comment
@jguerin

jguerin Sep 2, 2012

Contributor

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?

Contributor

jguerin commented Sep 2, 2012

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?

@elarcent

This comment has been minimized.

Show comment Hide comment
@elarcent

elarcent Sep 3, 2012

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 commented Sep 3, 2012

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.

@jguerin

This comment has been minimized.

Show comment Hide comment
@jguerin

jguerin Sep 3, 2012

Contributor

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

Contributor

jguerin commented Sep 3, 2012

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

@elarcent

This comment has been minimized.

Show comment Hide comment
@elarcent

elarcent Sep 3, 2012

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 http://www.microsoft.com/en-us/download/details.aspx?id=29065
It turns out to be serious problems for me, as I supposed to deploy my application on Windows Server VM

elarcent commented Sep 3, 2012

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 http://www.microsoft.com/en-us/download/details.aspx?id=29065
It turns out to be serious problems for me, as I supposed to deploy my application on Windows Server VM

@jguerin

This comment has been minimized.

Show comment Hide comment
@jguerin

jguerin Sep 3, 2012

Contributor

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?

Contributor

jguerin commented Sep 3, 2012

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?

@elarcent

This comment has been minimized.

Show comment Hide comment
@elarcent

elarcent Sep 3, 2012

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.

elarcent commented Sep 3, 2012

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.

@jguerin

This comment has been minimized.

Show comment Hide comment
@jguerin

jguerin Sep 3, 2012

Contributor

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?

Contributor

jguerin commented Sep 3, 2012

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?

@elarcent

This comment has been minimized.

Show comment Hide comment
@elarcent

elarcent Sep 3, 2012

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:

Install:
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

elarcent commented Sep 3, 2012

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:

Install:
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

@jguerin

This comment has been minimized.

Show comment Hide comment
@jguerin

jguerin Sep 3, 2012

Contributor

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

Contributor

jguerin commented Sep 3, 2012

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

@jkint

This comment has been minimized.

Show comment Hide comment
@jkint

jkint Sep 27, 2012

Contributor

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.

Contributor

jkint commented Sep 27, 2012

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.

@wread

This comment has been minimized.

Show comment Hide comment
@wread

wread Sep 28, 2012

Contributor

verified with latest sync

Contributor

wread commented Sep 28, 2012

verified with latest sync

@wread wread closed this Sep 28, 2012

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