3

I have a table that looks like this (using MariaDB):

CREATE TABLE table1 (
  id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  ,c_id varchar(40) NULL
  ,email varchar(150) NULL
  ,dynamic_columns BLOB NULL
  ,created_at TIMESTAMP NOT NULL DEFAULT 0
  ,updated_at TIMESTAMP NULL DEFAULT current_timestamp ON UPDATE current_timestamp
);

I'm loading data from some legacy tables into this table and I'm making use of MariaDB's dynamic_columns to store up to 3 dynamic columns based on the which legacy table. (https://mariadb.com/kb/en/mariadb/documentation/nosql/dynamic-columns/)

I'd like to use LOAD DATA INFILE to quickly/bulk to insert the legacy data into the new table, but I can't figure out how to do that with dynamic columns.

Searching Google has turned up zilch.

Paulie-C
  • 1,674
  • 1
  • 13
  • 29
Bob
  • 209
  • 2
  • 11

1 Answers1

0

Dynamic columns are stored in an internal binary format. To create or change a dynamic column outside of MariaDB server you should use the Dynamic column API of MariaDB Connector/C:

https://mariadb.com/kb/en/mariadb/dynamic-columns-api/

You will also find some examples in the test suite of Connector/C:

https://github.com/MariaDB/mariadb-connector-c/blob/master/unittest/libmariadb/dyncol.c

Georg Richter
  • 5,970
  • 2
  • 9
  • 15