DeleteTruncateTest test is failed with MemSQL database driver https://www.drupal.org/project/memsql due to reason that MemSQL returns results unsorted. MySQL returns results sorted by primary key in this test.

$pid_to_delete = $this->connection->query("SELECT * FROM {test_task} WHERE task = 'sleep'")->fetchField();

SELECT * FROM {test_task} WHERE task = 'sleep' returns 5, 2 in MemSQL and 2, 5 in MySQL, so
$pid_to_delete == 5 in MemSQL.
$pid_to_delete == 2 in MySQL.

SQL standard doesn't define and databases (even MySQL or PostgresQL) can not guarantee default sorting order, so such order has to be defined in the query if we need specific order.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sinn created an issue. See original summary.

sinn’s picture

daffie’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Contrib database driver

Hi @sinn: I did not know that there was a database driver for MemSQL. Thank you for working on it.

I have reviewed the patch and I do not see any problems for any other database drivers. Also the test keeps on testing what it supposed to test. The testbot failures are not related to this patch. For me it is RTBC.

I would like to point out that we are working on #3120096: Support contrib database driver directories in a fixed location in a module. As a result of this issue the driver directory for your MemSQL database driver has no longer be copied to DRUPAL_ROOT/drivers directory by the site builder/owner. The issue has not landed so it can change.

If you have an issue for core that is related to the database driver for MemSQL, then please add the tag "Contrib database driver". There are other people working on other contrib database driver and with this patch we see each others issues and we can help each other. If we work together all our database drivers will get better. See: https://www.drupal.org/project/issues/search?issue_tags=Contrib%20databa...

Would it be possible to add a bit more info about your database driver for MemSQL on its project page.

Again: thank you for working on the database driver for MemSQL.

sinn’s picture

Hi @daffie.

I know about https://www.drupal.org/project/drupal/issues/3120096 and I'm looking forward when it will be completed.

> If you have an issue for core that is related to the database driver for MemSQL, then please add the tag "Contrib database driver".
Thanks. I will do it.

Regarding MemSQL module, it is in alpha state. Need to resolve few issues. I'm going to release it for Drupal 9 when #312009 will be ready.

Meanwhile you can watch presentation about MemSQL https://www.enik.io/drupal/memsql/2020/03/31/memsql-presentation.html

  • catch committed d4a14f6 on 9.1.x
    Issue #3119922 by sinn, daffie: DeleteTruncateTest should not rely on...

  • catch committed 2447473 on 8.9.x
    Issue #3119922 by sinn, daffie: DeleteTruncateTest should not rely on...

  • catch committed e96b8de on 9.0.x
    Issue #3119922 by sinn, daffie: DeleteTruncateTest should not rely on...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed d4a14f6 and pushed to 9.1.x, cherry-picked back to 8.9.x. Thanks!

Status: Fixed » Closed (fixed)

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