Deleting System..

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Deleting System..

Post by Dragosvr92 »

Hello,

When you delete a topic, post, user, it deletes an id which is lost.
Here is what i thought on fixing that a bit..

When you delete a user (1081), phpbb should check if there are any users registered after it (1082).
If there hasnt been any registered user, it should go in the autoincreament and lower the number which was just deleted.

So to be more explicit, if you are trying to delete the latest user, it should decrease the autoincreament number, as it was the last user and other users can register on that id.

After i delete the latest topics,posts,users i have to manually go in the database and run something like this:

Code: Select all

ALTER TABLE phpbb_topics AUTO_INCREMENT =2021;
ALTER TABLE phpbb_posts AUTO_INCREMENT =4165;
ALTER TABLE phpbb_users AUTO_INCREMENT =1082;
 
Yes, i know someone, probably nox might rant at me again.. :P
Previous user: TheKiller
Avatar on Memberlist 1.0.3

User avatar
ameeck
Registered User
Posts: 86
Joined: Sun Nov 13, 2005 6:43 pm
Location: Prague, Czech Republic
Contact:

Re: Deleting System..

Post by ameeck »

Why would you do this? Are you running out of IDs? You've got at least a few billions of them, so I see no pressure there...
Please think before you post.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: Deleting System..

Post by callumacrae »

TheKiller wrote:Hello,

When you delete a topic, post, user, it deletes an id which is lost.
Here is what i thought on fixing that a bit..

When you delete a user (1081), phpbb should check if there are any users registered after it (1082).
If there hasnt been any registered user, it should go in the autoincreament and lower the number which was just deleted.

So to be more explicit, if you are trying to delete the latest user, it should decrease the autoincreament number, as it was the last user and other users can register on that id.

After i delete the latest topics,posts,users i have to manually go in the database and run something like this:

Code: Select all

ALTER TABLE phpbb_topics AUTO_INCREMENT =2021;
ALTER TABLE phpbb_posts AUTO_INCREMENT =4165;
ALTER TABLE phpbb_users AUTO_INCREMENT =1082;
 
Yes, i know someone, probably nox might rant at me again.. :P
So every time a new user is deleted, every link to a user dies?

I can think of a few very obvious disadvantages of this, and no advantages.
Made by developers, for developers!
My blog

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Deleting System..

Post by imkingdavid »

callumacrae wrote:So every time a new user is deleted, every link to a user dies?

I can think of a few very obvious disadvantages of this, and no advantages.
No, because it doesn't change any of the user ID's in the database. All it does is updates the autoincrement to act as if the most recent user (which is now deleted) had never registered.

One issue I see is what if someone new registers at the exact same time as the user is being deleted, but before the auto increment is changed. They will have the ID after the latest user but the auto increment will move back a step, resulting in a duplicate user ID.

Anyway, I don't see any real benefit to this, tbh. Since when does the average user care what their user ID is, or if it is not consecutive to the previously registered/activated user's ID?
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: Deleting System..

Post by A_Jelly_Doughnut »

This request comes up every so often... apparently some people really do care that their IDs have no empty spots :|
A_Jelly_Doughnut

User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Re: Deleting System..

Post by Dragosvr92 »

imkingdavid wrote: No, because it doesn't change any of the user ID's in the database. All it does is updates the autoincrement to act as if the most recent user (which is now deleted) had never registered.

One issue I see is what if someone new registers at the exact same time as the user is being deleted, but before the auto increment is changed. They will have the ID after the latest user but the auto increment will move back a step, resulting in a duplicate user ID.

Anyway, I don't see any real benefit to this, tbh. Since when does the average user care what their user ID is, or if it is not consecutive to the previously registered/activated user's ID?
That is Exactly What i've meant, Thank you for making it clearer !

I knew that might have been an issue, and i thought about it. What if, while it deletes the user and updates the autoincreament, it puts an stop on the registration ? Just make it load more till it does the changse, and after that thing is done it submits the registration? This will also fix this suggestion/improvement

As the user is probably a spammer and didnt stay registered for much time, why no just set the increament back as if he has never registered on your board.... I will leave a "mark" on his registration forever by leting that empty number :?
Previous user: TheKiller
Avatar on Memberlist 1.0.3

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Deleting System..

Post by Oleg »

First, you are opening yourself to all kinds of race conditions by trying to implement auto increment logic in an application. Short version is no.

Second, if the user was deleted but before that happened did something naughty, the user id in question might be associated with the naughtiness. Even if the board wiped all traces of said user there may be external links/bookmarks to this user's profile, etc. By reusing ids like you suggest the next user registering will appear to be said naughty user.

User avatar
Dr. Deejay
Registered User
Posts: 12
Joined: Thu Sep 22, 2011 12:19 pm

Re: Deleting System..

Post by Dr. Deejay »

I agree with Oleg, I don't see any reason for changing it as most people just don't care about IDs. Perhaps it would fit into a mod, no?

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Deleting System..

Post by DavidIQ »

Why would you even suggest such a change for 3.0? :?
Image

Danielx64
Registered User
Posts: 304
Joined: Mon Feb 08, 2010 3:42 am

Re: Deleting System..

Post by Danielx64 »

Oleg wrote:First, you are opening yourself to all kinds of race conditions by trying to implement auto increment logic in an application. Short version is no.

Second, if the user was deleted but before that happened did something naughty, the user id in question might be associated with the naughtiness. Even if the board wiped all traces of said user there may be external links/bookmarks to this user's profile, etc. By reusing ids like you suggest the next user registering will appear to be said naughty user.
+1 to what Oleg said -1 for the idea of changing the deleting system.
Dr. Deejay wrote:I agree with Oleg, I don't see any reason for changing it as most people just don't care about IDs. Perhaps it would fit into a mod, no?
No, it shouldn't even be a mod at all

Post Reply