[Archivesspace_Users_Group] Mariadb errors from reports: "portion"

Majewski, Steven Dennis (sdm7g) sdm7g at virginia.edu
Fri Jul 26 17:00:13 EDT 2019


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 <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/ <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 <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/20190726/b29de23b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4974 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190726/b29de23b/attachment.bin>


More information about the Archivesspace_Users_Group mailing list