Bug #1676 | Prepared statement two-table join returns no rows when one is expected | ||
---|---|---|---|
Submitted: | 27 Oct 2003 8:49 | Modified: | 20 Jan 2004 10:27 |
Reporter: | Per-Erik Martin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | OS: | ||
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[27 Oct 2003 8:49]
Per-Erik Martin
[20 Jan 2004 10:27]
Alexey Botchkov
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Fixed with the big cleanup()-related changeset
[21 Jan 2004 5:25]
Alexey Botchkov
Important note: test program isn't correct. bind[i].buffer_length= sizeof(buffer[i]); bind[i].length= 0; With that settings we get buffer_length as the length of the parameter. That way comparation of strings failed because of different lengths. Should be like that for example (it's not only solution here): int lengths[3] .... for (i = 0 ; i < 3 ; i++) { bind[i].buffer_type= FIELD_TYPE_STRING; bind[i].buffer= buffer[i]; bind[i].buffer_length= sizeof(buffer[i]); bind[i].length= lengths + i; bind[i].is_null= 0; } for (i = 0 ; i < 3 ; i++) { lengths[i]= strlen(buffer[i]); }