Fix various PostgreSQL failures
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 30 Aug 2017 19:51:50 +0000 (15:51 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 30 Aug 2017 21:18:29 +0000 (17:18 -0400)
commit91b86399b1ea8fa51750f7cd836651993f23ff9a
tree51c24f84594e6b8fec65be56400cde9b618b08c2
parent61696a0bd24be2b551bd47279a044d8d986bb03d
Fix various PostgreSQL failures

* Fix schema for image_comment_temp.
* Provide values in CommentStoreTest::provideInsertRoundTrip() for
  columns where the PG schema doesn't have a default value but the MySQL
  schema does.
* Call nextSequenceValue() from CommentStoreTest::testInsertRoundTrip().
* Correctly handle $options being the string 'FOR UPDATE' in
  DatabasePostgres::selectSQLText()
* Correctly handle the initial table in DatabasePostgres::selectSQLText() FOR
  UPDATE mangling.
* Correctly handle aliases in DatabasePostgres::selectSQLText() FOR
  UPDATE mangling.

Tests in PG are still going to be broken thanks to the fact that
nextSequenceValue() and insertId() can't be separated by another
nextSequenceValue()/insertId() pair. That should be taken care of by
T164898/T164900.

Change-Id: Ia770a003ca9170ab8bcc1436d8afe30700e00ada
includes/libs/rdbms/database/DatabasePostgres.php
maintenance/postgres/archives/patch-comment-table.sql
maintenance/postgres/tables.sql
tests/phpunit/includes/CommentStoreTest.php