User login

Ensuring no duplicate term descriptions: problem

The mysql data type text cannot be a full unique index. At best a portion (prefix) of it can be indexed. If made a unique index, two entries which start the same for the length of the prefix but have different endings it will cause an incorrect duplicate key error. Which is inconvenient.

Here's the bad news on mysql unique key on longtext:
http://casey.shobe.info/mysql_limitations.html#Text_columns_cannot_be_unique

Here's the official bad news:
http://dev.mysql.com/doc/refman/5.1/en/blob.html

Searching for a workaround didn't work:
ensuring unique blob text using hash
mysql unique text
using a hash to ensure unique text mysql

OK, so another tact...

drupal storing diffs
drupal storing revisions as diffs

I found and posted at DWW's old question "Managing node revisions with a backend like subversion?" (which came up again in this large recent thread on requiring node revisions or not).

I do think revision control should be pursued, or else we should work on a Drupal way (modeled on Mercurial/Git?) of saving revisions as diffs. Even for a little piece of my Community Managed Taxonomy module which allows people to vote on term descriptions, I would have loved versions saved as diffs. This would build in ensuring uniqueness at the same time it saves space and stores, by definition, information about what changed..

Of course, the whole subject of being able to vote on changes to a text could be ten research papers across five disciplines.

I'm not sure what the practical solution to ensuring we don't have duplicate descriptions (which would cause vote counts to be incorrectly separated).

The mysql data type text cannot be a full unique index. At best a portion (prefix) of it can be indexed. If made a unique index, two entries which start the same for the length of the prefix but have different endings it will cause an incorrect duplicate key error. Which is inconvenient.

Here's the bad news on mysql unique key on longtext:
http://casey.shobe.info/mysql_limitations.html#Text_columns_cannot_be_unique

Here's the official bad news:
http://dev.mysql.com/doc/refman/5.1/en/blob.html

Searching for a workaround didn't work:
ensuring unique blob text using hash
mysql unique text
using a hash to ensure unique text mysql

OK, so another tact...

drupal storing diffs
drupal storing revisions as diffs

I found and posted at DWW's old question "Managing node revisions with a backend like subversion?" (which came up again in this large recent thread on requiring node revisions or not).

I do think revision control should be pursued, or else we should work on a Drupal way (modeled on Mercurial/Git?) of saving revisions as diffs. Even for a little piece of my Community Managed Taxonomy module which allows people to vote on term descriptions, I would have loved versions saved as diffs. This would build in ensuring uniqueness at the same time it saves space and stores, by definition, information about what changed..

Of course, the whole subject of being able to vote on changes to a text could be ten research papers across five disciplines.

I'm not sure what the practical solution to ensuring we don't have duplicate descriptions (which would cause vote counts to be incorrectly separated).

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.