Column Modifiers and Expressions

This chapter covers how IDENTITY columns, generated/computed columns, DEFAULT expressions, EDB-specific functions, referential actions, and collation are handled during schema conversion.

Each section states clearly whether conversion is automatic or requires manual follow-up.


IDENTITY Columns

Automatic. EDB IDENTITY columns are converted to AUTO_INCREMENT. The following edge cases emit a warning and may require manual intervention:


GENERATED and COMPUTED Columns

Automatic, but expressions may need manual adjustment.

EDB syntax MySQL / MariaDB output Notes
GENERATED ALWAYS AS (expr) GENERATED ALWAYS AS (expr) STORED STORED added by converter
COMPUTED ALWAYS AS (expr) GENERATED ALWAYS AS (expr) VIRTUAL NOT NULL omitted — not valid on VIRTUAL

Note: In EDB, GENERATED columns are physically stored; COMPUTED columns are computed on read (virtual). EDB uses different keywords in place of MySQL/MariaDB’s STORED / VIRTUAL qualifiers, hence the mapping above. GENERATED BY DEFAULT exists in EDB only for identity columns (BY DEFAULT AS IDENTITY); there is no GENERATED BY DEFAULT AS (expr) form.

The following expression-level transformations are applied automatically:

EDB-specific functions inside GENERATED / COMPUTED expressions are not substituted automatically — see EDB-Only Functions below.

A warning is always emitted for every GENERATED and COMPUTED column.

DEFAULT Expressions

Automatic. The converter substitutes EDB default expressions with their MySQL/MariaDB equivalents. The table shows the expression only; in the generated DDL it appears as DEFAULT <expression> within the column definition.

EDB expression MySQL / MariaDB expression Notes
CURRENT_TIMESTAMP CURRENT_TIMESTAMP
CURRENT_DATE (CURDATE()) Requires MySQL 8.0.13+ / MariaDB 10.2+
CURRENT_TIME (CURTIME()) Requires MySQL 8.0.13+ / MariaDB 10.2+
TRUE / FALSE 1 / 0 BOOLEAN columns
CURRENT_GUID() (UUID()) Warning emitted — format differs (lowercase, no braces); requires MySQL 8.0.13+ / MariaDB 10.2+
CURRENT_USER() (CURRENT_USER()) Warning emitted — returns user@host in MySQL; requires MySQL 8.0.13+ / MariaDB 10.2+
CURRENT_DATABASE() (DATABASE()) Warning emitted — requires MySQL 8.0.13+ / MariaDB 10.2+
CURRENT_SESSIONID() (CONNECTION_ID()) Warning emitted — requires MySQL 8.0.13+ / MariaDB 10.2+
LASTIDENTITY() (DEFAULT clause removed) No equivalent — warning emitted in script and log
CURRENT_COMPUTER() (DEFAULT clause removed) No equivalent — warning emitted in script and log
(other) <expr> or (<expr>) || and + translated; EDB-only functions detected (warnings); wrapped in () if the expression was modified — see note below

The parenthesised expression default syntax DEFAULT (expr) requires MySQL 8.0.13+ or MariaDB 10.2+. Earlier versions do not support it.

Other DEFAULT expressions: For expressions not listed in the table above, the converter applies the same || / +CONCAT translations used for GENERATED and COMPUTED columns, and detects EDB-only functions (with warnings). If the expression is modified, it is wrapped in () to comply with the MySQL/MariaDB expression-default syntax. Column identifier substitution ("`) is not applied to DEFAULT expressions because a DEFAULT cannot reference other columns in the same row.

EDB-Only Functions in Expressions

EDB-specific functions are detected automatically in the following contexts: GENERATED columns, COMPUTED columns, CHECK constraint expressions, and DEFAULT passthrough expressions (those not matched by the explicit mapping table above).

When any of the functions listed below is found, the converter names each one in a warning in the script and in the log. The expression itself is still passed through (with || / +CONCAT translations applied where applicable), so the converted script will not execute correctly until the flagged functions are rewritten manually.

Use the table below as a reference when rewriting:

Scope by expression type: - GENERATED / COMPUTED / CHECK — identifier conversion ("`), line-break normalisation, || / + translation, and EDB-only detection. - DEFAULT passthrough — line-break normalisation, || / + translation, and EDB-only detection. Identifier conversion is not applied (DEFAULT cannot reference other columns).

EDB function MySQL / MariaDB equivalent
OCCURS(s, sub) (LENGTH(s)-LENGTH(REPLACE(s,sub,'')))/LENGTH(sub)
QUOTEDSTR(v) CONCAT('''',REPLACE(v,'''',''''''),'''')
CURRENT_GUID() UUID()
CURRENT_USER() CURRENT_USER()
CURRENT_DATABASE() DATABASE()
CURRENT_COMPUTER() No equivalent
LASTIDENTITY() LAST_INSERT_ID()
CURRENT_SESSIONID() CONNECTION_ID()
RUNSUM(col) SUM() OVER (ORDER BY ...) — MySQL 8.0+ / MariaDB 10.2+
LIST(col, delim) GROUP_CONCAT(col SEPARATOR delim)

CHECK constraint expressions

Same treatment as GENERATED / COMPUTED, including the identifier conversion: EDB double-quoted identifiers ("ColName") are converted to backticks before the expression is processed. || is translated to CONCAT() for MySQL (left as-is for MariaDB), + between string operands is translated to CONCAT() (heuristic), and EDB-only functions are detected and named in the warnings. A generic “verify before running” warning is always emitted; additional specific warnings are emitted when an ambiguous + or EDB-only functions are found.

Referential Actions

Automatic, but verify manually. EDB stores only NO ACTION in its Information Schema regardless of the referential action originally defined. As a result, all FK ON UPDATE and ON DELETE actions are emitted as NO ACTION in the converted schema.

If the original design used CASCADE, SET NULL, or RESTRICT, those actions are lost and must be restored manually after conversion.

Collation

Automatic. CHAR, VARCHAR, and CLOB collation is resolved via the collation map. A COLLATE clause is emitted only when the resolved collation differs from the table default.

Charsets and Collations

See Also

(C) 2026 Easygate, Lda