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

Uncaught Exception on installation when using mysql (non-PDO) Doctrine driver

XMLWordPrintable

      Attempt to use non-PDO Doctrine driver causes installer to fail with error:

      Uncaught Exception: An exception occurred while executing a query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':lang_iso, :lang_dir, :lang_english_name, :lang_local_name, :lang_author)'

      The issue is that original query string uses named parameters which only comply with PDO:

      https://github.com/phpbb/phpbb/blob/30ee379576dc44cadc26c72f430a0c92da7b437b/phpBB/phpbb/install/module/install_data/task/add_languages.php#L84-L86

      https://github.com/phpbb/phpbb/blob/30ee379576dc44cadc26c72f430a0c92da7b437b/phpBB/phpbb/install/module/install_data/task/setup_languages.php#L112-L114

      		$sql = 'INSERT INTO ' . $this->lang_table			. ' (lang_iso, lang_dir, lang_english_name, lang_local_name, lang_author)'			. ' VALUES (:lang_iso, :lang_dir, :lang_english_name, :lang_local_name, :lang_author)';

      Actually this issue doesn't affect the current code as the core for now uses only pdo_* Doctrine drivers. To make it compatible with any kind of drivers, question marks should be used instead:

       $sql = 'INSERT INTO ' . $this->lang_table . ' (lang_iso, lang_dir, lang_english_name, lang_local_name, lang_author)' . ' VALUES (?, ?, ?, ?, ?)';

            Unassigned Unassigned
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: