dms: explicitly cast `path` selected columns to char
On python3, the type of selected columns depend on the data type from mariadb side, VARCHAR will be str, BINARY/BLOB will be bytes, etc These SQL method select path that is first evaluated from a variable that is NULL and in that case, mariadb seems to select LONGBLOB as data type: MariaDB [test]> set @defined_as_null=null; drop table if exists tmp; create table tmp as (select @defined_as_null); show create table tmp; +-------+------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+------------------------------------------------------------------------------------------------------------------------------------+ | tmp | CREATE TABLE `tmp` ( `@defined_as_null` longblob DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci | +-------+------------------------------------------------------------------------------------------------------------------------------------+ By casting to CHAR in SQL, on the python side we always have the str that we expect here, because this is used as path attribute of a SQL brain.
Showing