Skip to content

Commit

Permalink
1. driver needs to send empty string correctly rather than null.
Browse files Browse the repository at this point in the history
2. add tests for empty string / null.
3. build binaries for release of null fix
  • Loading branch information
TimelordUK committed May 28, 2016
1 parent 2837214 commit b6ac57e
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 3 deletions.
Binary file modified lib/bin/sqlserverv8.v0.12.14.ia32.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v0.12.14.x64.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v4.4.3.ia32.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v4.4.3.x64.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v5.11.1.ia32.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v5.11.1.x64.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v6.1.0.ia32.node
Binary file not shown.
Binary file modified lib/bin/sqlserverv8.v6.1.0.x64.node
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/sqlserver.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
//
//---------------------------------------------------------------------------------------------------------------------------------

debugLoad();
//liveLoad();
//debugLoad();
liveLoad();

function debugLoad() {
var binaryDir= __dirname ;
Expand Down
13 changes: 13 additions & 0 deletions test/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ suite('params', function () {
});
});

test('verify single char string param', function(test_done) {
sql.open(conn_str, function (err, conn) {
conn.query("declare @s NVARCHAR(MAX) = ?; select @s as data", ['p'], function (err, res) {
assert.ifError(err);
var expected = [{
data: 'p'
}];
assert.deepEqual(expected, res);
test_done();
});
});
});

test('verify bool (true) to sql_variant', function(test_done) {
sql.open(conn_str, function (err, conn) {
conn.query("select cast(CAST('TRUE' as bit) as sql_variant) as data;", function (err, res) {
Expand Down
2 changes: 1 addition & 1 deletion test/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var useTrustedConnection = false;
//var conn_str = "Driver={" + driver + "};Server=" + server + ";" + (useTrustedConnection == true ? "Trusted_Connection={Yes};" : "UID=" + user + ";PWD=" + pwd + ";") + "Database={" + database + "};";

//var conn_str = "Driver={ODBC Driver 13 for SQL Server};Server=np:\\\\.\\pipe\\LOCALDB#52B903B5\\tsql\\query;Database={scratch};Trusted_Connection=Yes;";
var conn_str = "Driver={SQL Server Native Client 11.0};Server=np:\\\\.\\pipe\\LOCALDB#F2FD3F19\\tsql\\query;Database={scratch};Trusted_Connection=Yes;";
var conn_str = "Driver={SQL Server Native Client 11.0};Server=np:\\\\.\\pipe\\LOCALDB#1EC6D212\\tsql\\query;Database={scratch};Trusted_Connection=Yes;";

// The following need to be exported for building connection strings within a test...
exports.database = database;
Expand Down

0 comments on commit b6ac57e

Please sign in to comment.