-
Notifications
You must be signed in to change notification settings - Fork 32
Fix varchar limitation when max-len-attr is set #231
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
Fix varchar limitation when max-len-attr is set #231
Conversation
This fixes the result rewriting of the SQLColumns due to varchar limit setting in case the SQL_ATTR_MAX_LENGTH attribute is set. The attribute changes the lenght indicator given by SQLGetData to the value of the attribute (which a setting application expects). Since the rewriting is serialized on the statment, simply reset this attribute's value while doing the writing. The types of the columns in the rewritten result are also corrected (they were copied from ES/SQL output, which are wrong and need fixing).
driver/catalogue.c
Outdated
| wstr_st *lim = &HDRH(stmt)->dbc->varchar_limit_str; | ||
|
|
||
| /* save and reset SQL_ATTR_MAX_LENGTH attribute, it'll interfere with | ||
| * reading lenght of avail data with SQLGetData() otherwise. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: lenght -> length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to install a precommit check for this one. Thanks, fixed them all.
s/lenght/legth/
droberts195
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Fix varchar limitation when max-len-attr is set This fixes the result rewriting of the SQLColumns due to varchar limit setting in case the SQL_ATTR_MAX_LENGTH attribute is set. The attribute changes the lenght indicator given by SQLGetData to the value of the attribute (which a setting application expects). Since the rewriting is serialized on the statment, simply reset this attribute's value while doing the writing. The types of the columns in the rewritten result are also corrected (they were copied from ES/SQL output, which are wrong and need fixing). (cherry picked from commit c6556af)
* Fix varchar limitation when max-len-attr is set This fixes the result rewriting of the SQLColumns due to varchar limit setting in case the SQL_ATTR_MAX_LENGTH attribute is set. The attribute changes the lenght indicator given by SQLGetData to the value of the attribute (which a setting application expects). Since the rewriting is serialized on the statment, simply reset this attribute's value while doing the writing. The types of the columns in the rewritten result are also corrected (they were copied from ES/SQL output, which are wrong and need fixing). (cherry picked from commit c6556af)
This fixes the result rewriting of the SQLColumns due to varchar limit
setting in case the SQL_ATTR_MAX_LENGTH attribute is set. The attribute
changes the length indicator given by SQLGetData to the value of the
attribute (which a setting application expects).
Since the rewriting is serialized on the statement, simply reset this
attribute's value while doing the writing.
The types of the columns in the rewritten result are also corrected
(they were copied from ES/SQL output, which are wrong and need fixing).