|
[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. |
|||
|
08-26-2008, 11:56 AM
Post: #12
|
|||
|
|||
|
RE: [F] Attachments: bug returned
Any new fix that I have to test?
![]() Give us your feedback about MyBB in this thread and become listed on the MyBB website. |
|||
|
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. ![]() My Blog - My Mods |
|||
|
08-27-2008, 05:47 AM
Post: #14
|
|||
|
|||
RE: [F] Attachments: bug returned
(08-27-2008 12:02 AM)Ryan Gordon Wrote:I'll give an example to explain:(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. - 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...) |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help



![[Image: destroyerjf8.jpg]](http://www.urbanus-online.be/forum/uploads/destroyerjf8.jpg)
![[Image: ryangordon.png]](http://files.bellomandesign.com/signatures/mybb/ryangordon.png)