Problem/Motivation
There is a problem with Drupal\search_api_db\Plugin\search_api\backend\Database
.
If the default table name for a text table - i.e. search_api_db_[index_name]_text
- is already taken in the database then Database::findFreeTable()
will return e.g. search_api_db_[index_name]_text_1
.
However, when indexing the items Database::indexItem()
tries to compute the text table name by doing $text_table = $denormalized_table . '_text';
. This does not match the previously generated table name. $denormalized_table
is e.g. search_api_db_[index_name]_1
at this point.
So to summarize:
search_api_db_[index_name]_text_1
gets created.
search_api_db_[index_name]_1_text
gets queried.
This makes the indexing fail completely.
Proposed resolution
Remaining tasks
User interface changes
API changes
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 : 2
Story Points: 3
Comment | File | Size | Author |
---|---|---|---|
#3 | 2492653-3--table_name_conflict_test.patch | 1.79 KB | drunken monkey |
Comments
Comment #1
tstoecklerFixing issue summary.
Comment #2
Nick_vhComment #3
drunken monkeySeems to be fixed already. But I guess we can add a test for it.
Comment #4
tstoecklerHmm.. to actually test the behavior described in the IS, the test would also have to create a
search_api_db_database_search_index_text
table, as far as I can tell. Otherwise, looks good.Comment #6
drunken monkeyFor exactly the scenario in the IS, yes; but I think this one will catch even more potential errors, or at least should catch the one mentioned just as well.
So, committed.
Thanks for your review!