See here: our tests are currently failing on Postgres and SQLite. We should figure out what causes this and try to fix it.

Estimated Value and Story Points

This issue was identified as a Beta Blocker for Drupal 8. We sat down and figured out the value proposition and amount of work (story points) for this issue.

Value and Story points are in the scale of fibonacci. Our minimum is 1, our maximum is 21. The higher, the more value or work a certain issue has.

Value : 13
Story Points: 8

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Title: Fix test fails on Postgres and SQLite » Fix test fails on Postgres, SQLite and PHP 7
Issue tags: +PHP 7.0 (duplicate)

We're also broken with PHP 7.

nick_vh’s picture

Issue summary: View changes
Issue tags: +beta blocker
mollux’s picture

Assigned: Unassigned » mollux
mollux’s picture

Status: Active » Needs review
StatusFileSize
new2.17 KB

The PHP 7 tests should be fixed with this patch, now going for SQLite

mollux’s picture

Found the issue with SQLite tests, it's a core bug :(
In SQLite, indexes and tables must be unique, witch isn't the case (e.g. search_api_db_default_index_search_api_language is a table name, and search_api_db_default_index_1_search_api_language is also the name of the index of the search_api_language field in the search_api_db_default_index table.

In #1008128: Do not use a single underscore as table and index separator on PostgreSQL and SQLite there is a solution for this, but that issue was wrongly closed, as only the Postgres issues were fixed in another issue.

I'm creating a patch for that issue, but for the moment I added a temporary fix so we can test SQLite.

mollux’s picture

Hurray, all green (if you combine the 2 patches).
Maybe we should add a separate issue for SQLite, as that needs some work once the core patch in #1008128: Do not use a single underscore as table and index separator on PostgreSQL and SQLite lands?

mollux’s picture

mollux’s picture

mollux’s picture

nick_vh’s picture

+++ b/search_api_db/src/Plugin/search_api/backend/Database.php
@@ -637,7 +637,15 @@ class Database extends BackendPluginBase {
+    // This is a quick and dirty fix for a core bug, so we can run the tests
...
+    // tl;tr: in sqlite indexes and tables can't have the same name, which is

I'd remove the tl;tr since it is actually tl;dr! :). Just make it a proper sentence.

The core issue wasn't "wrongly" closed, it didn't fully solve the initial problem. No need to blame anything or anyone in code forever.

mollux’s picture

StatusFileSize
new3.71 KB

Ow, had no intention to blame anyone, changed the comment.
Also added better explanation what the problem is.

borisson_’s picture

Should we postpone this issue on #2625664: Name of tables and indexes conflicts for SQLite? I think I'd prefer getting it in like this and adding a followup to remove the changes to the database backend again that we can commit when the core issue lands? That way we can enable tests again on the currently broken builds.

mollux’s picture

In favor of getting it in like this + follow up, as we really should re-enable the tests.

nick_vh’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/search_api_db/src/Plugin/search_api/backend/Database.php
@@ -637,7 +637,25 @@ class Database extends BackendPluginBase {
+    // This is a quick fix for a core bug, so we can run the tests with SQLite

Maybe as a last comment, add a @todo tag so we can easily find it again.

eg. @todo remove this when #2625664 gets fixed in Drupal core.

Otherwise, looks good to go. I'm RTBC'ing this but with the condition of the @todo tag.

borisson_’s picture

Related issues: +#2625722: Remove sqlite fixing code in search api.
StatusFileSize
new802 bytes
new3.87 KB
nick_vh’s picture

We do reference the same issue 4 times. Maybe overkill but better safe than sorry?

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, thanks for the great work, Mattias!
And of course also thanks to Joris and Nick!
Committed.
Thanks again!

nick_vh’s picture

I enabled all the environments on issue and commit now. Looking forward to having more sqlite issues! Thanks for the commit

Status: Fixed » Closed (fixed)

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