We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running into an issue with the nodejs driver where one of the bind params was undefined.
undefined
Nodejs insert code:
const insert = "INSERT INTO yb_ecommerce.products " + " (id, name, description, price, author, type, img, category)" + " VALUES" + " (?, ?, ?, ?, ?, ?, ?, ?);" var insert_batch = []; // for loop here insert_batch.push({ query: insert, params: params }); client.batch(insert_batch, { prepare: true }, function(err) { ... });
The error I got back was:
E0308 21:28:51.414309 78086144 process_context.cc:180] SQL Error: Invalid Arguments. Runtime error (yb/yql/cql/cqlserver/cql_message.cc:131): Invalid bind variable kind -2 INSERT INTO yb_ecommerce.products (id, name, description, price, author, type, img, category) VALUES (?, ?, ?, ?, ?, ?, ?, ?);
@kmuthukk pointed out that in the code we do:
case Value::Kind::NOT_SET: break; } return STATUS_SUBSTITUTE( RuntimeError, "Invalid bind variable kind $0", static_cast<int>(v->kind));
where v->kind (an enum)'s value for NOT_SET is -2.
Rather than report the cryptic "-2", we should instead return a clear error and also indicate the bind position.
For example, for the NOT_SET case, we should instead return an error along the lines of:
"No bind specified for bind position %d"
The text was updated successfully, but these errors were encountered:
updated psql to ysqlsh and other misc fixes (#92)
b40bc92
robertpang
No branches or pull requests
Running into an issue with the nodejs driver where one of the bind params was
undefined
.Nodejs insert code:
The error I got back was:
@kmuthukk pointed out that in the code we do:
where v->kind (an enum)'s value for NOT_SET is -2.
Rather than report the cryptic "-2", we should instead return a clear error and also indicate the bind position.
For example, for the NOT_SET case, we should instead return an error along the lines of:
The text was updated successfully, but these errors were encountered: