[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2014-01-31 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Nemo  changed:

   What|Removed |Added

 CC||federicol...@tiscali.it

--- Comment #22 from Nemo  ---
Having fixed this bug allegedly unblocks
https://gerrit.wikimedia.org/r/#/c/98045/

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2014-01-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Tyler Romeo  changed:

   What|Removed |Added

 Status|PATCH_TO_REVIEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|wikibugs-l@lists.wikimedia. |tylerro...@gmail.com
   |org |

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2014-01-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #21 from Gerrit Notification Bot  ---
Change 107112 merged by jenkins-bot:
Changed FOR UPDATE handling in Postgresql

https://gerrit.wikimedia.org/r/107112

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2014-01-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #20 from Gerrit Notification Bot  ---
Change 69767 merged by jenkins-bot:
Changed FOR UPDATE handling in Postgresql

https://gerrit.wikimedia.org/r/69767

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2014-01-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #19 from Gerrit Notification Bot  ---
Change 107112 had a related patch set uploaded by MarkAHershberger:
Changed FOR UPDATE handling in Postgresql

https://gerrit.wikimedia.org/r/107112

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-12-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Nemo  changed:

   What|Removed |Added

 CC||gla...@hallowelt.biz,
   ||hexm...@gmail.com
Version|1.21.0  |1.22.0
   Target Milestone|--- |1.22.x release

--- Comment #18 from Nemo  ---
Update per
https://www.mediawiki.org/w/index.php?title=MediaWiki_1.22/Known_issues&oldid=847749
which seems to be the master list.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-11-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Marcin Cieślak  changed:

   What|Removed |Added

 Blocks||57724

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-11-03 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #17 from Gerrit Notification Bot  ---
Change 69767 restored by Parent5446:
Changed FOR UPDATE handling in Postgresql

Reason:
Why was this abandoned? It's my change.

https://gerrit.wikimedia.org/r/69767

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-10-16 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #16 from Fred Houweling  ---
I agree with Marc,
It is broken the wrong way, there is still an issue that needs to be resolved.

(In reply to comment #15)
> (In reply to comment #10)
> > PostgreSQL has an
> > extended FOR UPDATE syntax. You can do "FOR UPDATE OF mytable", which will
> > only
> > lock that table.
> 
> Hmm, no.  FOR UPDATE OF isn't a postgres extension, but a part SQL which
> mysql
> doesn't implement fully (SQL:2003 14.1.).
> 
> But yeah, trying to lock on an outer join is fundamentally nonsensical, and
> mysql not throwing an exception is a standard compliance bug at best - it's
> unwise to rely on that kind of behaviour.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-10-15 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #15 from Marc A. Pelletier  ---
(In reply to comment #10)
> PostgreSQL has an
> extended FOR UPDATE syntax. You can do "FOR UPDATE OF mytable", which will
> only
> lock that table.

Hmm, no.  FOR UPDATE OF isn't a postgres extension, but a part SQL which mysql
doesn't implement fully (SQL:2003 14.1.).

But yeah, trying to lock on an outer join is fundamentally nonsensical, and
mysql not throwing an exception is a standard compliance bug at best - it's
unwise to rely on that kind of behaviour.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-10-15 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #14 from Gerrit Notification Bot  ---
Change 69767 abandoned by coren:
Changed FOR UPDATE handling in Postgresql

Reason:
Worked only because it was broken the right way.  :-)

https://gerrit.wikimedia.org/r/69767

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-07-25 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Andre Klapper  changed:

   What|Removed |Added

   Keywords|patch-in-gerrit |
 Status|NEW |PATCH_TO_REVIEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-07-17 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Marcin Cieślak  changed:

   What|Removed |Added

 CC||marcin.cies...@gmail.com

--- Comment #13 from Marcin Cieślak  ---
What about if we require callers to explicitly specify list of tables to be
locked (by using additional parameters and not $options[]) ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-07-17 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Marcin Cieślak  changed:

   What|Removed |Added

   See Also||https://bugzilla.wikimedia.
   ||org/show_bug.cgi?id=46594

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-07-17 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Marcin Cieślak  changed:

   What|Removed |Added

 Blocks||49523

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-20 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #12 from Gerrit Notification Bot  ---
Related URL: https://gerrit.wikimedia.org/r/69767 (Gerrit Change
I1ac587ac39f448b9e7f4befb44826b43044ad6f0)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-20 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Pierre Bourdon  changed:

   What|Removed |Added

 CC||delr...@gmail.com

--- Comment #11 from Pierre Bourdon  ---
This bug causes image deletion to fail on PostgreSQL, by the way. Manually
applying the workaround mentioned above fixes the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #10 from Tyler Romeo  ---
OK, so with all of this, I also noticed one more thing: PostgreSQL has an
extended FOR UPDATE syntax. You can do "FOR UPDATE OF mytable", which will only
lock that table.

With that in mind, I think the proper fix for this would be to change
DatabasePostgresql so that when the FOR UPDATE clause is generated, it only
includes the main table and inner joined tables.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #9 from Fred Houweling  ---
Hi Thanks all for exploring options,
Some related discussions I found when researching the error:
http://www.postgresql.org/docs/9.1/interactive/sql-select.html#SQL-FOR-UPDATE-SHARE
http://www.postgresql.org/docs/9.1/interactive/explicit-locking.html#LOCKING-ROWS

http://www.postgresql.org/message-id/21634.1160151...@sss.pgh.pa.us
http://postgresql.1045698.n5.nabble.com/outer-joins-and-for-update-td1937029.html

Also, my PostgreSQL server version is 9.1.2

If we can reach an agreement on how best to resolve this issue for Wikimedia
installs using a PostgreSQL databases, (unless someone beats me to it) I'll
rework the patch to comply to your collective wisdom, thank you all for your
time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #8 from Tyler Romeo  ---
(In reply to comment #7)
> That is wrong, because there is a rev_user = 0 on the join condition, so this
> is false for anon editing. The query should always find a user row.

"on the join condition" is the key phrase here. If rev_user = 0 were in the
WHERE clause, then that'd be true, but in an outer join, if the join condition
doesn't match, the row is still there but just has a null join. Also think
about it logically: why would Revision::fetchFromConds, the main function for
fetching revision info, only allow logged in revisions?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

db  changed:

   What|Removed |Added

 CC||duplicate...@googlemail.com

--- Comment #7 from db  ---
(In reply to comment #6)
> The issue is that the row doesn't necessarily exist in the user table. If the
> revision was made by an anonymous user, then there will be no corresponding
> row. The idea is to fetch the user row if it exists.

That is wrong, because there is a rev_user = 0 on the join condition, so this
is false for anon editing. The query should always find a user row.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Andre Klapper  changed:

   What|Removed |Added

   Keywords|patch, patch-need-review|patch-in-gerrit

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #6 from Tyler Romeo  ---
(In reply to comment #5)
> The problem is that PG *does* support FOR UPDATE, just limits it to cases
> that
> make sense.

Then maybe an exception should be thrown instead, as a warning to developers
that you shouldn't be doing FOR UPDATE on outer joins.

(In reply to comment #5)
> Why is the userJoinCond a LEFT JOIN when you're fetching rows for logged-in
> users which should have a row in the users table?

The issue is that the row doesn't necessarily exist in the user table. If the
revision was made by an anonymous user, then there will be no corresponding
row. The idea is to fetch the user row if it exists.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #5 from OverlordQ  ---
The problem is that PG *does* support FOR UPDATE, just limits it to cases that
make sense.

Why is the userJoinCond a LEFT JOIN when you're fetching rows for logged-in
users which should have a row in the users table?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Tyler Romeo  changed:

   What|Removed |Added

 CC||tylerro...@gmail.com

--- Comment #4 from Tyler Romeo  ---
So what I would recommend is that rather than making this change in
Revision::fetchFromConds, instead make the change directly in DatabasePostgres
(maybe override the selectSQLText() function and have it remove the FOR UPDATE
option). That way this error won't occur anywhere.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #3 from Fred Houweling  ---
Thanks Andre,
I did as you suggested.
https://gerrit.wikimedia.org/r/#/c/68143/
Regards
Fred

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-11 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Andre Klapper  changed:

   What|Removed |Added

   Keywords||patch, patch-need-review
 CC||aklap...@wikimedia.org

--- Comment #2 from Andre Klapper  ---
Hi! Thanks for your patch!

You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly.
Thanks again! We appreciate your contribution.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-06-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

--- Comment #1 from Fred Houweling  ---
i patched my Revision.php in the includes directory (1.21.1) with the
following:

# diff Revision.php.org Revision.php
355a356
>   global $wgDBtype;
363c364,366
<   $options[] = 'FOR UPDATE';
---
>   if( $wgDBtype != "postgres" ) {
>   $options[] = 'FOR UPDATE';
>   }

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 47055] Revision::fetchFromConds SELECT ... FOR UPDATE invalid in Postgres

2013-04-10 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=47055

Andre Klapper  changed:

   What|Removed |Added

   Priority|Unprioritized   |High
 Blocks||384

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l