Skip to content

Commit 6d0bb6f

Browse files
committed
failing test for geometry typeCast issue
1 parent b534e15 commit 6d0bb6f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var common = require('../../common');
2+
var connection = common.createConnection();
3+
var assert = require('assert');
4+
5+
connection.query({
6+
sql: 'select GeomFromText(\'POINT(11 0)\') as foo',
7+
typeCast: function (field, next) {
8+
if (field.type == 'GEOMETRY') {
9+
return field.geometry();
10+
}
11+
return next();
12+
}
13+
}, function(err, res) {
14+
assert.ifError(err);
15+
assert(Buffer.isBuffer(res[0].foo));
16+
});
17+
18+
19+
connection.query({
20+
sql: 'select GeomFromText(\'POINT(11 0)\') as foo',
21+
typeCast: false
22+
}, function(err, res) {
23+
assert.ifError(err);
24+
assert(Buffer.isBuffer(res[0].foo));
25+
});
26+
27+
connection.end();

0 commit comments

Comments
 (0)