Due to the way that message buffers are created (char msg[MAX_HEADER_SIZE]), any query strings that exceed [MAX_HEADER_SIZE] are truncated, causing the server to return an error. Instead, the message buffers should be malloc'd as needed, to a large enough size to handle the entire query. This has the dual benefit of using less memory for smaller queries, while still allowing larger queries.
On a related note, the same issue exists when creating the PARAMETER_TYPE variable used in the EXECUTE string.
Due to the way that message buffers are created (char msg[MAX_HEADER_SIZE]), any query strings that exceed [MAX_HEADER_SIZE] are truncated, causing the server to return an error. Instead, the message buffers should be malloc'd as needed, to a large enough size to handle the entire query. This has the dual benefit of using less memory for smaller queries, while still allowing larger queries.
On a related note, the same issue exists when creating the PARAMETER_TYPE variable used in the EXECUTE string.