Opened 16 years ago
Last modified 16 years ago
#580 released defect
Unique key for crop_trait_observation / crop_trait_observation_data too long
| Reported by: | bweaver | Owned by: | bweaver |
|---|---|---|---|
| Priority: | blocker | Milestone: | Release Candidate 3 |
| Component: | Database, Data Updates | Version: | 2.0.1600 |
| Severity: | Keywords: | ||
| Cc: | Database Engine: | N/A | |
| Operating System: | N/A |
Description
To make sure the latest AT changes for Oracle did not adversely affect all engines, I went to install the latest db in mysql and postgresql. Mysql install failed due to unique key being to long for crop_trait_observation. I'm assuming crop_trait_observation_data will be too long as well.
Mysql max unique key length is 767 bytes. Actual character count varies since we use UTF8 (which is a multibyte character set, and the amount of bytes a character uses can be between 1 and 3 depending on which character it is).
We need to shorten at least one of the fields so the unique key is under the 767 length restriction.
SQL Server's length restriction is 900 bytes, which is why we haven't run into this since the last round of db testing (we added this unique key since then). Mysql is the shortest allowed length of 767.
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
postponed until later Since mysql limitation of 255 char, data needs to be reviewed and another solution proposed for unique key.
comment:3 by , 16 years ago
| Status: | new → addressed |
|---|
comment:4 by , 16 years ago
| Status: | addressed → released |
|---|

string_value field is currently defined as being 400 characters. Trial-and-error in mysql shows that a maximum of 255 characters works. So for the unique key to work in mysql, string_value cannot be longer than 255 characters.