Closed tboothman closed 7 years ago
Figured out how to compile it and I've tried changing the C to not modify sqlvar->sqllen but that didn't help .. I don't think I've quite understood what this is all doing.
Fixed in v0.5.8.
Thanks for looking at this, but now CHAR columns are all clipped to 1 character in length.
Bummer, I knew there was something I missed. I'll take another look.
Released v0.5.9 and this should be fixed now (hopefully 😬)
If you have a column length of 5 and you insert some data with a length of 3 data chars it gets padded with spaces to match the length of the column. For example if you inserted the word how into a column with a length of 5 the code returns "how ".
@jberry92, yes that is correct, this is because of how ESQL/C behaves (Informix CSDK v4.10 - The char data type).
I'd suggest trimming it within your code if you are sure you won't have any trailing spaces.
That's great, thanks @uditha-atukorala - It looks to be all working now
If you re-use a prepared statement on a table with a character column the column length increases by 1 with each execution with ' ' making up the rest of the string. The problem does not occur if you create a new prepared statement for each query.
Here's some sample code:
The result is something like:
and if you logged the actual string it'd be:
I suspect it's something to do with https://github.com/nukedzn/node-informix/blob/master/src/ifx/ifx.cpp#L389 but I don't know how to compile the C to check