-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require('../common'); | ||
var Client = require('mysql').Client, | ||
client = Client(TEST_CONFIG), | ||
gently = new Gently(); | ||
|
||
// our test db might not exist yet, so don't try to connect to it | ||
client.database = ''; | ||
client.connect(); | ||
|
||
client.query('SELECT NULL as field_a, NULL as field_b', function(err, results) { | ||
if (err) throw err; | ||
|
||
assert.strictEqual(results[0].field_a, null); | ||
assert.strictEqual(results[0].field_b, null); | ||
client.end(); | ||
}); | ||
|
09df6f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't handle null values; now there is no distinction between null and the empty string. Try:
client.query('SELECT NULL as field_a, NULL as field_b, "" AS field_c', function(err, results) {
if (err) throw err;
assert.strictEqual(results[0].field_a, null);
assert.strictEqual(results[0].field_b, null);
assert.strictEqual(results[0].field_c, '');
client.end();
});
09df6f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in: 10e81c2