Bug #12070 | Cannot bind new VARCHAR result column | ||
---|---|---|---|
Submitted: | 20 Jul 2005 19:56 | Modified: | 2 Mar 2006 2:04 |
Reporter: | Dean Ellis | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Embedded Library ( libmysqld ) | Severity: | S2 (Serious) |
Version: | 5.0 | OS: | |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[20 Jul 2005 19:56]
Dean Ellis
[29 Sep 2005 18:12]
Will Miles
I ran in to this problem on 5.0.13rc (custom compile for QNX 6.3.1, not that it turned out to be relevant). I tracked this problem to a change in the client-server protocol that hadn't been mirrored in the embedded server protocol: in Protocol::send_fields (protocol.cc) there was an explicit switch of MYSQL_TYPE_VARCHAR to MYSQL_TYPE_VAR_STRING when sending fields to the client. Protocol::send_fields (lib_sql.cc) did not perform this step. Copying the code across seems to resolve the issue. I did not perform a deeper analysis of any other changes to the client-server protocol that might need to be replicated on the embedded side. I've attached a patch with this fix.
[29 Sep 2005 18:13]
Will Miles
Well, that serves me right to comment without clicking 'attach file' first. Sorry! I'm not sure what the policy is here - should I post a diff inline?
[5 Oct 2005 10:58]
Gary Ashford
Hi. I can verify that I have tried Will Miles' suggested fix to lib_sql.cc and this indeed worked. I hope this gets integrated for 5.0 release!
[21 Nov 2005 8:44]
Noam Ambar
This workaround also worked from me. However, it seems to crash the system when a field from type VARCHAR is returned. For example "SHOW TABLES LIKE...". Any Idea how to got over it?
[2 Mar 2006 2:04]
Paul DuBois
Noted in 5.0.19 changelog. The embedded server did not allow binding of columns to the <literal>MYSQL_TYPE_VAR_STRING</literal> data type in prepared statements. (Bug #12070)