Skip to content

Larger Long/BIGINT values mangled when passed from server to client #12

@youurayy

Description

@youurayy

Okay, this is quite severe and a show-stopper for us. Resolution would be appreciated.

It only happens with a larger Long values, e.g. 2000000000L. Smaller values are fine, e.g 498498L, but this makes it even more dangerous.

Tested on Mac OS X and Linux, VoltDB 3.7.0.4-0 enterprise. Node.js v0.10.15 (Mac) and v0.10.24 (Linux).

Minimal test case follows.

Test.java

package yourpackage;
import org.voltdb.*;
public class Test extends VoltProcedure {
    public VoltTable[] run() {
        VoltTable test = new VoltTable(
           new VoltTable.ColumnInfo("test", VoltType.BIGINT));
        test.addRow(2000000000L);
        return new VoltTable[] { test };
    }
}

catalog.sql

create procedure from class yourpackage.Test;

test.js

var client = require('voltjs/lib/client');
var configuration = require('voltjs/lib/configuration');
var query = require('voltjs/lib/query');

var cfg = new configuration();
cfg.host = '127.0.0.1';
cfg.messageQueueSize = 0;
var client = new client([ cfg ]);

client.connect(function(err, event, results) {

    var test = new query('Test', []);
    var testQuery = test.getQuery();
    testQuery.setParameters([]);

    client.callProcedure(testQuery, function(err, event, results) {
        // EXPECTED: 2000000000   ACTUAL: 120951808
        console.dir(results.table[0][0].test);
        process.exit(0);
    });

});

(@jpiekos - John, I'm still intent on sending you that proposal, just haven't had time by now.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions