Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Bad argument at CheckInput #4

Open
kldavis4 opened this issue Aug 20, 2010 · 1 comment
Open

TypeError: Bad argument at CheckInput #4

kldavis4 opened this issue Aug 20, 2010 · 1 comment

Comments

@kldavis4
Copy link

I am having a problem reading data from a database. The table is just a date field and a string field with a JSON object in it. Depending on the date range I select the query returns the data correctly OR I get this error:

/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:283
var message = first.slice(5, 5 + length);
^
TypeError: Bad argument.
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:283:25)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)

I did a little bit of debugging and determined that the call 'int32read(1)' is returning NaN in this line:

function checkInput() {
if (queue.length === 0) { return; }
var first = queue[0];
var code = String.fromCharCode(first[0]);

var length = first.int32Read(1) - 4; <

I can possibly do some more work trying to figure what in the data is causing this to break, but there probably also needs to be a fix in checkInput to make it a little more robust.

@pdelanauze
Copy link

Same. Was able to reproduce this with 0.1.0 tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants