]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
test_for_update to recognise skip_locked for MariaDB-10.6
authorDaniel Black <daniel@mariadb.org>
Wed, 8 Sep 2021 07:12:16 +0000 (03:12 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Wed, 8 Sep 2021 07:12:16 +0000 (03:12 -0400)
commitf2519693f7c959df00d02cd2cb5c2534bb805ce2
treebbaa58b6bbd1b17d4ef73ad1d10b609bbea0f29c
parent06f031e55f40403996e3580bdc5a22661b6303f4
test_for_update to recognise skip_locked for MariaDB-10.6

### Description

Alters the test for skip_locked to recognize that `SKIP LOCKED` was added to the MariaDB syntax in 10.6.0 https://mariadb.com/kb/en/select/#skip-locked.

### Checklist

This pull request is:

- [X] A minor test case fix
- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

:smile: You too :boat:

Note:

```
$ podman run  --rm  -d -e MARIADB_USER=scott -e MARIADB_PASSWORD=tiger -e MARIADB_DATABASE=test -e MARIADB_RANDOM_ROOT_PASSWORD=1  -P mariadb:10.6
7248491216e93320d7eff4c8c3a9f8c6b6c43cc84a7a65e721265616f8854f4d

$ podman port 7248491216e93320d7eff4c8c3a9f8c6b6c43cc84a7a65e721265616f8854f4d   3306
0.0.0.0:43809

$ pytest --db  mariadb  --dburi   mariadb://scott:tiger@127.0.0.1:43809/test  test/dialect/mysql/test_for_update.py
...
INTERNALERROR>   File "/home/dan/.py3/lib64/python3.9/site-packages/MySQLdb/connections.py", line 185, in __init__
INTERNALERROR>     super().__init__(*args, **kwargs2)
INTERNALERROR> sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '127.0.0.1' (115)")
INTERNALERROR> (Background on this error at: https://sqlalche.me/e/14/e3q8)
```
Some queries where executed on the container instance however there's something in the test hard-coded to 3306 (observed in strace). And/or I'm doing something incorrectly.

Closes: #6998
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6998
Pull-request-sha: a8f9c05abea0795cfa39cd972e096e4581dbf892

Change-Id: I3cd41587d7207f0e6747dea97d6be1e33d7c7aa0
test/dialect/mysql/test_for_update.py