Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.7(EOL)
Description
We noticed some issues when trying to use `mariadb-devel` containers from quay.io/mariadb-foundation/mariadb-devel with mysqlclient that are not reproducible with containers from the docker hub :
- `0` is not recognized as `Decimal`
- `VERSION()` returns bytes instead of string
- `SHOW FULL TABLES;` doesn't return anything
To reproduce you can execute any query:
import MySQLdb |
db = MySQLdb.connect(host="mariadb-db", user="root", database="django") |
cursor = db.cursor() |
cursor.execute("SELECT VERSION()") |
it crashes with:
Traceback (most recent call last):
|
File "tests/runtests.py", line 6, in <module>
|
cursor.execute("SELECT VERSION()")
|
File "/usr/local/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
|
res = self._query(query)
|
File "/usr/local/lib/python3.8/site-packages/MySQLdb/cursors.py", line 321, in _query
|
self._post_get_result()
|
File "/usr/local/lib/python3.8/site-packages/MySQLdb/cursors.py", line 355, in _post_get_result
|
self._rows = self._fetch_row(0)
|
File "/usr/local/lib/python3.8/site-packages/MySQLdb/cursors.py", line 328, in _fetch_row
|
return self._result.fetch_row(size, self._fetch_type)
|
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
|
when I will remove 0 to Decimal converter than VERSION() returns bytes instead of strings:
import MySQLdb |
from MySQLdb.converters import conversions |
|
converters = conversions |
converters.pop(0, None) |
|
db = MySQLdb.connect(host="mariadb-db", user="root", database="django", conv=converters) |
cursor = db.cursor() |
cursor.execute("SELECT VERSION()") |
version = cursor.fetchone()[0] |
print(type(version), version) |
<class 'bytes'> b'10.7.4-MariaDB-507084517fad72346ab631e3c7493154000df0a7'
|
Attachments
Issue Links
- duplicates
-
MDEV-27304 SHOW ... result columns are right-aligned
- Closed
- relates to
-
MDEV-17093 Print version_source_revision in the error log upon server startup
- Closed