The functionality CONCAT_WS() is not supported by SQLite. CONCAT_WS() is supported by MySQL and is actively used by the views module.

Solution

  • Create support for CONCAT_WS() is the SQLite driver
  • Add testing for the added CONCAT_WS()

Testing
php ./scripts/run-tests.sh --dburl sqlite://localhost/sqlite/db.sqlite --file core/modules/system/src/Tests/Database/BasicSyntaxTest.php
There should be no fails and no exceptions.

Commit credits
Please give @sun commit credits for this issue. All the code from the patches from the first and second comments are originally written by @sun.

CommentFileSizeAuthor
#2 2427311-2.patch3.58 KBdaffie
#1 2427311-1.patch1.81 KBdaffie

Comments

daffie’s picture

Status: Active » Needs review
StatusFileSize
new1.81 KB

This patch is cut-and-pasted from the patch from #2318191: [meta] Database tests fail on SQLite.

daffie’s picture

StatusFileSize
new3.58 KB

Oeps. Wrong patch.

daffie’s picture

If I run the test locally I get the following result:


Drupal test run
---------------

Tests to be run:
  - Drupal\system\Tests\Database\BasicSyntaxTest

Test run started:
  Monday, February 16, 2015 - 17:05

Test summary
------------

Drupal\system\Tests\Database\BasicSyntaxTest                  20 passes                                      

daffie’s picture

hass’s picture

What about PostgreSQL, Oracle, MsSQL?

I think we should not allow MySQL specific SQL functions.

dawehner’s picture

Well, I personally think that adding a feature most users can use, but is optional, was a good decision in Drupal 7.
Btw. I think we are working on better Pgsql support in core, this can be figure out. For the other database engines,
feel free to override the single handler views provides.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

What about PostgreSQL, Oracle, MsSQL?

CONCAT_WS() is supported in PostgreSQL and Oracle. Also, Oracle and MsSQL drivers are not provided by Drupal core and they can provide their own implementation in contrib.

The patch looks good and committers should also credit @sun because he wrote this code in #2318191: [meta] Database tests fail on SQLite.

daffie’s picture

Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 78ac456 and pushed to 8.0.x. Thanks!

@daffie are you going to create the rest of the issues from #2318191: [meta] Database tests fail on SQLite?

  • alexpott committed 78ac456 on 8.0.x
    Issue #2427311 by sun, daffie: SQLite does not natively support...
daffie’s picture

@alexpott: That is my plan!

amateescu’s picture

Priority: Critical » Major

Status: Fixed » Closed (fixed)

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