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

Problems executing huge SQL statements #19

Closed
daniel-kullmann opened this issue Aug 4, 2015 · 2 comments
Closed

Problems executing huge SQL statements #19

daniel-kullmann opened this issue Aug 4, 2015 · 2 comments
Labels

Comments

@daniel-kullmann
Copy link

Hello, I get the following error when trying to execute huge SQL statements (the statement string is 144k large):

Execute error: { [Error: error while parsing protocol: invalid communication buffer structure]
  message: 'error while parsing protocol: invalid communication buffer structure',
  code: 1033,
  sqlState: 'HY000',
  level: 1,
  position: 0 }

The SQL is large due to around 11000 string constants that are put into a hierarchy expression, so it can't be formulated differently (e.g. with a join).

When I reduce the SQL statement to around 126k (using only 5100 string constants), it works and I get the data back.

Is this a limit in the DB server, or does it come from node-hdb?

@holgerkoser
Copy link
Member

The limitation comes from the MAX_PACKET_SIZE constant which is currently set to 131072 bytes.

You can modify the MAX_PACKET_SIZE in lib/protocol/common/Constants.js before you load the hdb module the first time.

// modify MAX_PACKET_SIZE before you load module hdb
require('hdb/lib/protocol/common/Constants').MAX_PACKET_SIZE = Math.pow(2,18);
var hdb = require('hdb');

@holgerkoser
Copy link
Member

I have tested the proposal to modify the MAX_PACKET_SIZE above. It allows you to adapt it to your needs.

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

No branches or pull requests

2 participants