[MDEV-8681] Dynamic columns & COLUMN_ADD() behaviour Created: 2015-08-26  Updated: 2015-11-01  Resolved: 2015-11-01

Status: Closed
Project: MariaDB Server
Component/s: Dynamic Columns
Fix Version/s: N/A

Type: Task Priority: Minor
Reporter: Barry O' Neill Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: column_add, column_create, dynamic_columns


 Description   

At present when using dynamic columns, one must first create a dynamic column using COLUMN_CREATE() in order to be able to use COLUMN_ADD() otherwise when COLUMN_ADD is called it returns NULL and ROW_COUNT() returns 0.

If one is adding attributes to a blob of dynamic columns it would be advantageous to not have to check for each record if a column needs to be created first.

For instance would it be possible/proper to do away with the column_create() function altogether and incorporate its functionality into the COLUMN_ADD(). Consider the following functionality for COLUMN_ADD.

IF(col does not exist){
        create new column
}elseif(col exists)
        overwrite existing column
}

Strangely this is only an issue if the blob is empty. If COLUMN_CREATE has been run to create a different column then COLUMN_ADD will add a new column to the blob. However if the blob is empty then COLUMN_ADD returns NULL.



 Comments   
Comment by Sergei Golubchik [ 2015-11-01 ]

You misunderstood COLUMN_CREATE function. It does not create a dynamic column, instead it creates a dynamic column container where dynamic columns are stored. When you have a container you can use COLUMN_ADD to add more columns to it.

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