PostgreSQL 9.14
PHP 5.3.15 and PHP 5.4.5
Apache 2.2.x

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://d8.dev/core/install.php?langcode=nb&profile=standard&id=1&op=do_nojs&op=do StatusText: OK ResponseText: User account | Drupal @import url("http://d8.dev/core/modules/system/system.theme.css?0"); @import url("http://d8.dev/core/modules/system/system.base.css?0"); @import url("http://d8.dev/core/modules/user/user.css?0"); @import url("http://d8.dev/core/modules/system/system.admin.css?0"); @import url("http://d8.dev/core/modules/system/system.maintenance.css?0"); @import url("http://d8.dev/core/themes/seven/reset.css?0"); @import url("http://d8.dev/core/themes/seven/style.css?0"); User account Installation tasksVelg språk(done)Velg profil(done)Sjekk forhåndskrav(done)Sett opp database(done)Installeringsprofil(aktiv)Sett opp oversettelserSett opp nettstedetFullfører oversettelserFullført SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "`" LINE 1: SELECT *, 0 as `default` FROM language ORDER BY weight ASC, ... ^
Attached screenshot shows the same. Installing on MariaDB and sqlite works as expected.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

steinmb’s picture

Mental note, language_list() have postgres problems. This query is the one that fails.

<?php
$languages = db_query('SELECT *, 0 as `default` FROM {language} ORDER BY weight ASC, name ASC')->fetchAllAssoc('langcode', PDO::FETCH_ASSOC);
?>
Berdir’s picture

The backticks in there are clearly wrong. Should be enough to simply remove them, they aren't necessary.

steinmb’s picture

Title: Installing on other languages then english blows up with Postgres » language_list() SQL contain backtick and breaks PostgreSQL
Component: install system » database system

The table contain a reserved SQL name (http://drupal.org/node/141051) so Mysql needs those backticks.
This issue discuss the problem: #1426084: Provide backtick escaping for MySQL in DB abstraction layer

steinmb’s picture

Status: Active » Needs review
FileSize
840 bytes

Renaming the alias to a not reserved name. Tested on MariaDB, sqlite and postgres.

Berdir’s picture

Yes, but I guess we need need to change the code there as well that relies on this? Or remove it from the SQL completely and just enforce default => 0 in a foreach loop? Might actually be the easiest way..

Damien Tournoud’s picture

Status: Needs review » Needs work
      $languages = db_query('SELECT *, 0 as `default` FROM {language} ORDER BY weight ASC, name ASC')->fetchAllAssoc('langcode', PDO::FETCH_ASSOC);

      // Initialize default property so callers have an easy reference and can
      // save the same object without data loss.
      foreach ($languages as $langcode => $info) {
        $info['default'] = ($langcode == $default->langcode);
        $languages[$langcode] = new Language($info);
      }

Just remove the default column, it is initialized just below. The query should just be SELECT * FROM {language} ORDER BY weight ASC, name ASC.

steinmb’s picture

Status: Needs work » Needs review
FileSize
821 bytes

You are right, it is. This works as expected.

steinmb’s picture

You are right, it is. This is working as expected.
dbl. post

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Yes, this makes sense.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Looks like this was committed at some point. Woohoo!

Gábor Hojtsy’s picture

Issue tags: +D8MI, +sprint

Got people to look at this as part of our sprint so tagging retroactively.

Gábor Hojtsy’s picture

Issue tags: -sprint

Removing from sprint. I don't think this should get a changelog entry or change notice, it is such a tiny improvement. Thanks all though!

Automatically closed -- issue fixed for 2 weeks with no activity.