PostgreSQL: Add quotes to timestamp
authorJeff Janes <jeff.janes@gmail.com>
Thu, 17 Dec 2015 05:30:46 +0000 (21:30 -0800)
committerReedy <reedy@wikimedia.org>
Sun, 27 Dec 2015 19:45:34 +0000 (19:45 +0000)
The fix for bug T114806 doesn't quote timestamps it sends
directly to the database (i.e. not in bind variables). Timestamps
in PostgreSQL require quotes.  Add addQuotes call.

Bug: T121743
Change-Id: If8da1a0171f55d59c63f5501c854aa8fa48d5992

includes/Import.php

index 67f7ba5..f59cf47 100644 (file)
@@ -1654,7 +1654,7 @@ class WikiRevision {
                $prevId = $dbw->selectField( 'revision', 'rev_id',
                        array(
                                'rev_page' => $pageId,
-                               'rev_timestamp <= ' . $dbw->timestamp( $this->timestamp ),
+                               'rev_timestamp <= ' . $dbw->addQuotes( $dbw->timestamp( $this->timestamp ) ),
                        ),
                        __METHOD__,
                        array( 'ORDER BY' => array(