| Bug #5975 | InnoDB: error clustered record for sec rec not found | ||
|---|---|---|---|
| Submitted: | 8 Oct 2004 10:05 | Modified: | 8 Oct 2004 12:58 |
| Reporter: | Jan Lindström | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
| Version: | 4.1.6 | OS: | Linux (Linux/Debian 2.4.27-1) |
| Assigned to: | Heikki Tuuri | CPU Architecture: | Any |
[8 Oct 2004 10:05]
Jan Lindström
[8 Oct 2004 10:57]
Heikki Tuuri
Hi!
I assigned Jan Lindström to fix this. The bug suddenly appeared to 4.1 when Monty merged my bug fix from 4.0 to 4.1 on Wednesday :). My bugfix was not aware of multi-byte charsets. The code below in row0row.c should in 4.1 use innobase_get_at_most_n_mbchars() to construct the clustered index column prefix.
Thank you,
Heikki
/* If the primary key contains a column prefix, then the
secondary index may contain a longer prefix of the same
column, or the full column, and we must adjust the length
accordingly. */
clust_col_prefix_len =
dict_index_get_nth_field(clust_index, i)->prefix_len;
if (clust_col_prefix_len > 0) {
if (len != UNIV_SQL_NULL
&& len > clust_col_prefix_len) {
dfield_set_len(dfield, clust_col_prefix_len);
}
}
[8 Oct 2004 12:58]
Heikki Tuuri
http://lists.mysql.com/internals/17496 fixes this in the latest 4.1 source tree, as well as another UTF-8 bug where InnoDB printed in SELECTs to the .err log warnings about a prefix being > 255 bytes long. Regards, Heikki
