Skip to content

Commit ee26b4e

Browse files
authored
Temporarily changed to verify if '' is expected
Came across a case where null was expected but empty string ('') was received instead. It's OK if this is expected behavior, but if not, I might attempt to correct the issue.
1 parent c9e5926 commit ee26b4e

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

test/integration/connection/test-binary-longlong.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ var conn = common.createConnection();
77
conn.query(
88
'CREATE TEMPORARY TABLE `tmp_longlong` ( ' +
99
' `id` int(11) NOT NULL AUTO_INCREMENT, ' +
10-
' `ls` BIGINT SIGNED NOT NULL, ' +
11-
' `lu` BIGINT UNSIGNED NOT NULL, ' +
10+
' `ls` BIGINT SIGNED, ' +
11+
' `lu` BIGINT UNSIGNED, ' +
1212
' PRIMARY KEY (`id`) ' +
1313
' ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8'
1414
);
@@ -17,7 +17,8 @@ var values = [
1717
['10', '10'],
1818
['-11', '11'],
1919
['965432100123456789', '1965432100123456789'],
20-
['-965432100123456789', '2965432100123456789']
20+
['-965432100123456789', '2965432100123456789'],
21+
[null, null],
2122
];
2223

2324
conn.connect(function(err) {
@@ -38,21 +39,32 @@ conn.connect(function(err) {
3839
{ id: 1, ls: 10, lu: 10 },
3940
{ id: 2, ls: -11, lu: 11 },
4041
{ id: 3, ls: 965432100123456800, lu: 1965432100123456800 },
41-
{ id: 4, ls: -965432100123456800, lu: 2965432100123457000 }
42+
{ id: 4, ls: -965432100123456800, lu: 2965432100123457000 },
43+
{ id: 5, ls: null, lu: null }
4244
];
4345

4446
var bigNums_bnStringsTrueFalse = [
4547
{ id: 1, ls: 10, lu: 10 },
4648
{ id: 2, ls: -11, lu: 11 },
4749
{ id: 3, ls: '965432100123456789', lu: '1965432100123456789' },
48-
{ id: 4, ls: '-965432100123456789', lu: '2965432100123456789' }
50+
{ id: 4, ls: '-965432100123456789', lu: '2965432100123456789' },
51+
{ id: 5, ls: null, lu: null }
4952
];
5053

51-
var bigNums_bnStringsTrueTrue = [
54+
var bigNums_query_bnStringsTrueTrue = [
5255
{ id: 1, ls: 10, lu: 10 },
5356
{ id: 2, ls: -11, lu: 11 },
5457
{ id: 3, ls: '965432100123456789', lu: '1965432100123456789' },
55-
{ id: 4, ls: '-965432100123456789', lu: '2965432100123456789' }
58+
{ id: 4, ls: '-965432100123456789', lu: '2965432100123456789' },
59+
{ id: 5, ls: '', lu: '' }
60+
];
61+
62+
var bigNums_execute_bnStringsTrueTrue = [
63+
{ id: 1, ls: 10, lu: 10 },
64+
{ id: 2, ls: -11, lu: 11 },
65+
{ id: 3, ls: '965432100123456789', lu: '1965432100123456789' },
66+
{ id: 4, ls: '-965432100123456789', lu: '2965432100123456789' },
67+
{ id: 5, ls: null, lu: null }
5668
];
5769

5870
function check() {
@@ -105,9 +117,9 @@ conn.connect(function(err) {
105117

106118
testQuery(false, false, bigNums_bnStringsFalse);
107119
testQuery(true, false, bigNums_bnStringsTrueFalse);
108-
testQuery(true, true, bigNums_bnStringsTrueTrue);
120+
testQuery(true, true, bigNums_query_bnStringsTrueTrue);
109121

110122
testExecute(false, false, bigNums_bnStringsFalse);
111123
testExecute(true, false, bigNums_bnStringsTrueFalse);
112-
testExecute(true, true, bigNums_bnStringsTrueTrue);
124+
testExecute(true, true, bigNums_execute_bnStringsTrueTrue);
113125
});

0 commit comments

Comments
 (0)