Bug #39644 | Binding SQL_C_BIT to an integer column is not working | ||
---|---|---|---|
Submitted: | 25 Sep 2008 8:24 | Modified: | 23 Oct 2009 14:40 |
Reporter: | Bogdan Degtyariov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 5.1.5 | OS: | Any |
Assigned to: | Bogdan Degtyariov | CPU Architecture: | Any |
Tags: | SQL_C_BIT |
[25 Sep 2008 8:24]
Bogdan Degtyariov
[25 Sep 2008 8:31]
Bogdan Degtyariov
patch and test case
Attachment: patch39644.diff (application/octet-stream, text), 1.80 KiB.
[20 Oct 2008 17:32]
Jess Balint
I don't think value[0] != '0' is the right thing to do here. I'm not sure when it was changed from 3.51 but it looks like we just shouldn't negate the result of the atoi() call. I think it should be something like this: if (value[0] == 1 || atoi(value))
[20 Oct 2008 18:22]
Jess Balint
Bug#36470 was marked as a duplicate of this.
[12 Aug 2009 21:54]
Gerald Schade
Does anybody work on fixing this bug, which is still present?
[10 Sep 2009 9:51]
Lawrenty Novitsky
My opinion that logic should be like this: atoi() != 0 || (any non-zero byte). Because first character can be '0' and string will still render to non-zero number. and first byte can be easily 0 for numeric type, while whole number will be not 0. so patch seems to be correct only if we want to consider 1st byte only. and that doesn't look correct for me.
[1 Oct 2009 11:35]
Tonci Grgin
Bug#47760 was marked as duplicate of this report.
[19 Oct 2009 18:45]
Lawrenty Novitsky
Since current code is absolutely wrong, and this one will work in 99%(if not more) cases, i prefer to approve it and push it so it will get to this coming release.
[19 Oct 2009 20:17]
Lawrenty Novitsky
Patch has been pushed as revision #843. it will be in 5.1.6 release
[23 Oct 2009 14:40]
Tony Bedford
An entry has been added to the 5.1.6 changelog: Binding SQL_C_BIT to an INTEGER column did not work. The sql_get_data() function only worked correctly for BOOLEAN columns that corresponded to SQL_C_BIT buffers.