4d / SQLlib_4D

SQL library for 4D
http://4d.github.io/SQLlib_4D
12 stars 7 forks source link

Code does not work with large queries #3

Open ibrewster opened 9 years ago

ibrewster commented 9 years ago

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.