Disallowing edits to posts

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Disallowing edits to posts
« Reply #30, on February 13th, 2012, 05:54 PM »
Quote from Arantor on February 13th, 2012, 11:55 AM
Quote
Suggesting to simply check for modified_member when deleting a member, and if found, unserialize data and serialize with last known member name.
Which still means doing it every row, as opposed to UPDATE wedge_messages SET modified_name = 'name' WHERE modified_member = id...
Well... The question would be, would someone who edited a LOT of posts, be likely to be removing their account later...? Plus, it's only done once per account removal... i.e. not exactly common business...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Disallowing edits to posts
« Reply #31, on February 13th, 2012, 06:03 PM »
Therein lies the thing... it only requires said person to have edited 2 posts and already it's slower by a significant margin (since it's one big query and then one query per row minimum, versus one query to just deal with it)

It might not be done very often but if it were done that way I could see it causing big problems with prolific users who did this, like timeouts and white screens and database inconsistencies.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Disallowing edits to posts
« Reply #32, on February 13th, 2012, 06:35 PM »
I don't see how the DB would be inconsistent if every single query dealt with member_id_whatever and the member name data var at the same time...
Oh well, anyway :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Disallowing edits to posts
« Reply #33, on February 13th, 2012, 09:18 PM »
That's the point. If you have to do it row by row, you absolutely must be done inside one page load, or schedule it across page loads, but you have to be much, much more careful than the alternative.

If you can do it in a single query, the query runs atomically and doesn't affect anything else, but if you do it row by row, you have to do it row by row and be sure to be finished before actually deleting the member row.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Disallowing edits to posts
« Reply #34, on February 14th, 2012, 12:09 AM »
Or we could just store somewhere a list of lost ids along with corresponding member name. If member not found, retrieve name from list...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Disallowing edits to posts
« Reply #35, on February 14th, 2012, 12:12 AM »
I think that's creeping into the realms of over-engineering the solution to something. When you have to keep track of whether you actually made your own changes because of the complexity of making changes, it seems like it's a step too far down a murky road.

The simplest solution, technically, would be to handle it as a transaction but they're not supported on MyISAM and that's almost creating another problem in its own right.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Disallowing edits to posts
« Reply #36, on February 14th, 2012, 12:37 AM »
You want to know my solution?

No mem name.
Last edited by (account deleted)

Who cares, after all?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Disallowing edits to posts
« Reply #37, on February 14th, 2012, 12:39 AM »
In that case, guess I need to make sure the list of member ids who've edited a post is pushed into the posters query and drop the column.

Mind you, it's going to make imported entries very messy >_<

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Disallowing edits to posts
« Reply #39, on February 14th, 2012, 08:22 AM »
Because imported entries won't have the id, only a name, so every edited post will be last edited by (deleted) even if the user is very much not deleted.

TE

  • Posts: 286
Re: Disallowing edits to posts
« Reply #40, on February 14th, 2012, 08:35 AM »
unless the display name wasn't changed we could pick up the member's id within the import process.(one extra sql query per row in wedge_messages)

Would slow down the import, but shouldn't be a problem at all..
Thorsten "TE" Eurich - Former SMF Developer & Converters Guru

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278