Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-17028

Update from prior version 3.3.4 fail with PostgreSQL database

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8
    • None
    • Installation system
    • PHP version: 7.2.34
      Database server: PostgreSQL 9.2.23

    Description

      The update of the database to the version 3.3.4 and later doesn't work on a installation with  PostgreSQL.

       

      SQL Error [42601]: ERROR: syntax error at or near "FROM"

       

      There is a problem in the method sql_table_exists()

       

      $sql = "SELECT CAST(EXISTS( SELECT FROM information_schema.tables WHERE table_schema = 'public' AND table_name = '" . $this->db->sql_escape($table_name) . "' ) AS INTEGER)"

       

      https://github.com/phpbb/phpbb/blob/89b07af756feab21223111dac259a28d3194b3ed/phpBB/phpbb/db/tools/postgres.php#L105

      The request is not correct. A column is needed to work.

      $sql = "SELECT CAST(EXISTS( SELECT * FROM information_schema.tables WHERE table_schema = 'public' AND table_name = '" . $this->db->sql_escape($table_name) . "' ) AS INTEGER)"; 

      or

      $sql = "SELECT CAST(EXISTS( SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name = '" . $this->db->sql_escape($table_name) . "' ) AS INTEGER)";  

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jaycenet jaycenet [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: