[Archivesspace_Users_Group] Mariadb errors from reports: "portion"
Mayo, Dave
dave_mayo at harvard.edu
Mon Jul 29 13:03:44 EDT 2019
Weird – I just verified that this happens this on my local instance, but haven’t been able to find the thing causing this issue.
Looking in the code, it looks like there might be an in-process or forthcoming syntax for doing date ranges with this as a keyword? https://github.com/MariaDB/server/search?q=%22portion+of%22&unscoped_q=%22portion+of%22
--
Dave Mayo (he/him)
Senior Digital Library Software Engineer
Harvard University > HUIT > LTS
From: <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of "Majewski, Steven Dennis (sdm7g)" <sdm7g at virginia.edu>
Reply-To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Date: Friday, July 26, 2019 at 5:00 PM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] Mariadb errors from reports: "portion"
Anyone else using MariaDB ?
We’re running mysql on our production servers, but I’m running a current version of Maria-DB on my development laptop.
While investigating the unescaped ampersand in reports issue, I discovered I’m getting errors running some reports.
Resource List Report says:
Generating report Java::ComMysqlJdbcExceptionsJdbc4::MySQLSyntaxErrorException:
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 'portion, number as extent_number, extent_type_id as extent_type, contai' at line 2
And by trying that select statement in the command line, it appears that “portion” must now be a keyword in MariaDB.
This generates an error:
MariaDB [archivesspace]> select portion_id as portion from extent;
ERROR 1064 (42000): 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 'portion from extent' at line 1
But this works:
MariaDB [archivesspace]> select portion_id as `portion` from extent;
+---------+
| portion |
+---------+
| 924 |
| 924 |
| 924 |
| 924 |
| 924 |
| 924 |
https://github.com/archivesspace/archivesspace/blob/master/reports/custom/extent_subreport.rb#L17
“Portion” no listed here:
https://mariadb.com/kb/en/library/reserved-words/
But this list in source code is canonical source:
https://github.com/MariaDB/server/blob/10.5/sql/lex.h#L474
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190729/078390d4/attachment.html>
More information about the Archivesspace_Users_Group
mailing list