Current time: 03-21-2010, 01:47 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Attachments: bug returned
08-26-2008, 07:14 AM
Post: #11
RE: [F] Attachments: bug returned
(08-25-2008 11:48 PM)Ryan Gordon Wrote:  How will it put in a uid with a number higher then 0 if it doesn't even exist? Either way my "if statement" should catch all cases - It's not a strict comparison.
The uid does exist - unless when you delete a user, it sets the uids for all the user's attachments to 0.
Visit this user's website Find all posts by this user
08-26-2008, 11:56 AM
Post: #12
RE: [F] Attachments: bug returned
Any new fix that I have to test?

[Image: destroyerjf8.jpg]

Give us your feedback about MyBB in this thread and become listed on the MyBB website.
Visit this user's website Find all posts by this user
08-27-2008, 12:02 AM (This post was last modified: 08-27-2008 12:03 AM by Ryan Gordon.)
Post: #13
RE: [F] Attachments: bug returned
(08-26-2008 07:14 AM)ZiNgA BuRgA Wrote:  
(08-25-2008 11:48 PM)Ryan Gordon Wrote:  How will it put in a uid with a number higher then 0 if it doesn't even exist? Either way my "if statement" should catch all cases - It's not a strict comparison.
The uid does exist - unless when you delete a user, it sets the uids for all the user's attachments to 0.

Yes, and? We're not doing a strict comparison. The NOT operator (!) will fail on 0, null, false, and probably others too that I don't remember.

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
08-27-2008, 05:47 AM
Post: #14
RE: [F] Attachments: bug returned
(08-27-2008 12:02 AM)Ryan Gordon Wrote:  
(08-26-2008 07:14 AM)ZiNgA BuRgA Wrote:  
(08-25-2008 11:48 PM)Ryan Gordon Wrote:  How will it put in a uid with a number higher then 0 if it doesn't even exist? Either way my "if statement" should catch all cases - It's not a strict comparison.
The uid does exist - unless when you delete a user, it sets the uids for all the user's attachments to 0.

Yes, and? We're not doing a strict comparison. The NOT operator (!) will fail on 0, null, false, and probably others too that I don't remember.
I'll give an example to explain:

- User with UID 5 uploads an attachment
- attachments table will have something like this row:
aid: 2
uid: 5
etc
- You delete the user with UID of 5
- attachments table still has this row:
aid: 2
uid: 5
etc

Thus, uid=5 is still there. I haven't tested anything, but I'm guessing that in disambiguation, since you're putting users.uid and attachments.uid, the former being NULL, the latter will be returned, thus "uid" will be 5. My idea is to separate the disambiguation so that you're testing for the correct value. (MySQL strict mode does help in certain cases ya know...)
Visit this user's website Find all posts by this user


Forum Jump: