"rev_multilink=-1" filter can induce MySQL error
Nagy Gabor <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <20210807214507.495a877a@Dell> |
Dear Roundup Users,
Dear Ralph :)
I am using rev_multilink for detecting orphan files:
I have an IssueClass "issue" with property
documents=Multilink("doc", rev_multilink="owner").
And "doc" is a FileClass. I am using MySQL backend.
I observed, that if I do db.doc.filter(None, {'owner':'-1'}), then I
get the following error if all (non-retired) issues have unset
documents properties, i.e. the above command should list all elements
of the Class doc:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ngaba/.local/lib/python3.9/site-packages/roundup/backends/rdbms_common.py", line 2968, in filter
self.db.sql(sql, args, cursor)
File "/home/ngaba/.local/lib/python3.9/site-packages/roundup/backends/rdbms_common.py", line 235, in sql
cursor.execute(sql)
File "/usr/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/lib/python3.9/site-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') and _doc.__retired__=0 order by _doc.id' at line 1")
I did not check the implementation of rev_multilink, but this suggest me
that in this case somehow the owner rev_multilink is "not alive".
One more small issue that I ran into:
Classes with automatically created multilinks (in the above example: doc)
cannot be edited by EditCSVAction. Or at least I could not figure out how. :)
The columnd corresponding these types of multilinks should be omitted in
csvedit mode.
Regards,
Gábor
_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users