[MDEV-7336] ExtractValue function not usable for Virtual Columns Created: 2014-12-16  Updated: 2017-01-12  Resolved: 2017-01-12

Status: Closed
Project: MariaDB Server
Component/s: Virtual Columns, XML Functions
Affects Version/s: 10.0.15, 10.0, 10.1
Fix Version/s: 10.2.1

Type: Bug Priority: Minor
Reporter: Tom Noonan II Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux - CentOS6



 Description   

When creating a table I am unable to use the ExctractValue function to create a column, despite it being deterministic:

mysql> create table xml_test (xml TEXT, virt CHAR(16) AS (ExtractValue(xml, '//some/@xpath')) PERSISTENT;
ERROR 1901 (HY000): Function or expression is not allowed for column 'virt'

This was discussed several years ago on the dev list at https://www.mail-archive.com/maria-developers@lists.launchpad.net/msg03488.html where it was added to Launchpad bug 608641 (https://bugs.launchpad.net/maria/+bug/608641). Bug 608641 contains other functions as well and was quietly closed as "won't fix" in 2012 with no explanation.

I have a use where being able to create and index columns off stored XML would be very useful. I need to use xpath searches, I cannot use simple string manipulation. I would appreciate if this could be reevaluated. If it is still "won't-fix" please document why. Thank you.



 Comments   
Comment by Elena Stepanova [ 2014-12-18 ]

igor,

Could you please elaborate on the 'Won't fix' decision which was made in https://bugs.launchpad.net/maria/+bug/608641, and somehow summarize the limitations at https://mariadb.com/kb/en/mariadb/documentation/sql-commands/data-definition/create/virtual-columns/ ?

Comment by Sergei Golubchik [ 2017-01-12 ]

Since 10.2.1 ExctractValue can be used in generated columns, virtual and persistent.

Generated at Thu Feb 08 07:18:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.