Fix crash when issuing SQL "COPY" command

This involved upgrade of node-postgresql module.
See https://github.com/brianc/node-postgres/issues/242
This commit is contained in:
Sandro Santilli 2013-01-17 09:59:48 +01:00
parent ef729a027f
commit 19fc0e5854
4 changed files with 26 additions and 22 deletions

View File

@ -2,6 +2,7 @@
----- -----
* Improve mixed-geometry export error message (#78) * Improve mixed-geometry export error message (#78)
* Remove NULL the_geom features from topojson output (#80) * Remove NULL the_geom features from topojson output (#80)
* Fix crash when issuing SQL "COPY" command
1.3.3 (11/01/13) 1.3.3 (11/01/13)
----- -----

10
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "cartodb_api", "name": "cartodb_api",
"version": "1.3.3", "version": "1.3.4",
"dependencies": { "dependencies": {
"cluster2": { "cluster2": {
"version": "0.3.5-cdb02", "version": "0.3.5-cdb02",
@ -185,8 +185,12 @@
} }
}, },
"pg": { "pg": {
"version": "0.8.7-cdb1", "version": "0.11.2",
"from": "git://github.com/CartoDB/node-postgres.git#cdb_production" "dependencies": {
"generic-pool": {
"version": "2.0.2"
}
}
}, },
"generic-pool": { "generic-pool": {
"version": "1.0.12" "version": "1.0.12"

View File

@ -13,7 +13,7 @@
"express": "~2.5.11", "express": "~2.5.11",
"underscore" : "1.1.x", "underscore" : "1.1.x",
"underscore.string": "1.1.5", "underscore.string": "1.1.5",
"pg": "git://github.com/CartoDB/node-postgres.git#cdb_production", "pg": "~0.11.2",
"generic-pool": "1.0.x", "generic-pool": "1.0.x",
"redis": "0.7.1", "redis": "0.7.1",
"hiredis": "*", "hiredis": "*",

View File

@ -330,24 +330,23 @@ test('CREATE TABLE with GET and auth', function(done){
}); });
}); });
// TODO: test COPY // Test effects of COPY
//test('COPY TABLE with GET and auth', function(done){ // See https://github.com/Vizzuality/cartodb-management/issues/1502
// assert.response(app, { test('COPY TABLE with GET and auth', function(done){
// url: "/api/v1/sql?" + querystring.stringify({ assert.response(app, {
// q: 'COPY TABLE test_table FROM stdin; 1\n\\.\n', url: "/api/v1/sql?" + querystring.stringify({
// api_key: 1234 q: 'COPY test_table FROM stdin;',
// }), api_key: 1234
// headers: {host: 'vizzuality.cartodb.com'}, }),
// method: 'GET' headers: {host: 'vizzuality.cartodb.com'},
// },{}, function(res) { method: 'GET'
// assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); },{}, function(res) {
// // Check cache headers // We expect a problem, actually
// // See https://github.com/Vizzuality/CartoDB-SQL-API/issues/43 assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body);
// assert.equal(res.headers['x-cache-channel'], 'NONE'); assert.deepEqual(JSON.parse(res.body), {"error":["COPY from stdin failed: No source stream defined"]});
// assert.equal(res.headers['cache-control'], expected_cache_control); done();
// done(); });
// }); });
//});
test('ALTER TABLE with GET and auth', function(done){ test('ALTER TABLE with GET and auth', function(done){
assert.response(app, { assert.response(app, {