Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17028

Update from prior version 3.3.4 fail with PostgreSQL database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8
    • Installation system
    • PHP version: 7.2.34
      Database server: PostgreSQL 9.2.23

      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)";  

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

              Created:
              Updated: