mariadb/mysql-test/suite
Nikita Malyavin 6a653d5bb7 MDEV-36274 Implement IDENTITY column
This patch implements basic IDENTITY feature, with the following
syntax:

<col> GENERATED {ALWAYS AS | BY DEFAULT [ON NULL]} identity_props

The following identity_props are acknowleged:
- START WITH num - Supported, only positive values
- INCREMENT BY num - Supported, only positive values
- MAXVALUE num - Supported, only positive values. Engine treating may
vary.

The following identity_props are recognized and saved in
the table metadata, but ignored
- ORDER
- CYCLE
- MINVALUE num

The following identity_props are recognized and fully ignored at the
parser level.
These properties are newly added keywords, however they are not
reserved, i.e. can be used as identifiers, column names, etc. just as
before:
- KEEP
- SCALE
- SHARD
- EXTEND
- NOKEEP
- NOSCALE
- NOSHARD
- NOEXTEND

The patch is designed in minimalistic manner, re-using existing
AUTO_INCREMENT implementation, yet utilizing the default values
evaluation mechanism. As a result, it grants usage of CHECK constraints
and other table expressions: vcols, default values with identity column.

Some notes:
* IDENTITY is evaluated as Field's default_value. Even GENERATED ALWAYS
is considered "default", since the IDENTITY expression is not
determistic.
* However, the GENERATED ALWAYS kind cannot be assigned in DMLs in
STRICT SQL_MODE. That is, the behavior for users is like other GENERATED
 ALWAYS columns.
* It honors INSERT_ID and uses it.
* IDENTITY column is always replicated and saved in mariadb-dump, which
is guaranteed by using default_value instead of vcol_expr (vcols, even
stored, are usually not replicated)
* In frm, it is loaded and saved as a default expression. For that,
parse_vcol_expr definition was extended to support things like GENERATED
 BY DEFAULT, and even GENERATED ALWAYS. That is, no EXTRA2 header had to
 be added.
* struct Autoinc_spec is stored in Item_dentity_next, so table
 structures are preserved as they were.
* New IDENTITY keyword is not reserved

Known issues:
* LAST_INSERT_ID() is not working for now.
* update t set col=default(identity_column) is broken, as reported in
MDEV-31854 for nextval.
2025-06-18 12:09:31 +02:00
..
archive MDEV-36050 DATA/INDEX DIRECTORY handling is inconsistent 2025-04-18 09:41:23 +02:00
atomic Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
binlog cleanup: select ... into tests 2025-02-11 20:31:25 +01:00
binlog_encryption Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
client MDEV-14978 fix client.client-env-variable test 2024-10-19 16:53:16 +02:00
compat MDEV-20034 Add support for the pre-defined weak SYS_REFCURSOR 2025-04-19 10:59:58 +04:00
csv MDEV-36050 DATA/INDEX DIRECTORY handling is inconsistent 2025-04-18 09:41:23 +02:00
encryption Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
engines Fix typos in user-facing messages 2025-04-19 02:47:33 +04:00
events Merge 11.4 into 11.7 2024-12-02 17:51:17 +02:00
federated Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
funcs_1 MDEV-10164: Add support for TRIGGERS that fire on multiple events 2025-04-19 18:36:03 +07:00
funcs_2 Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
galera Merge branch '11.8' into main 2025-04-18 17:11:01 +02:00
galera_3nodes Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
galera_3nodes_sr Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
galera_sr Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
gcol Merge 11.4 into 11.8 2025-03-05 20:39:47 +02:00
handler Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
heap Merge branch '11.4' into 11.7 2025-02-06 16:46:36 +01:00
innodb MDEV-36050 DATA/INDEX DIRECTORY handling is inconsistent 2025-04-18 09:41:23 +02:00
innodb_fts Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
innodb_gis Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
innodb_i_s
innodb_zip fix incorrect merge 15700f54c2 2025-04-18 09:41:24 +02:00
jp
json MariaDB 11.4.4 release 2024-11-08 07:17:00 +01:00
large_tests
maria MDEV-34413 Index Condition Pushdown for reverse ordered scans 2025-03-19 16:03:29 -04:00
mariabackup Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
merge
mtr/t Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
mtr2
multi_source MDEV-36340: Reset Connects_Tried with Master_Retry_Count=X 2025-04-22 12:05:27 -06:00
optimizer_unfixed_bugs
parts MDEV-36050 DATA/INDEX DIRECTORY handling is inconsistent 2025-04-18 09:41:23 +02:00
perfschema MDEV-20034 Add support for the pre-defined weak SYS_REFCURSOR 2025-04-19 10:59:58 +04:00
perfschema_stress
period cleanup: select ... into tests 2025-02-11 20:31:25 +01:00
plugins Merge 11.4 into 11.7 2025-01-09 09:41:38 +02:00
roles 12.0 branch 2025-02-12 12:37:38 +01:00
rpl Merge branch '11.8' into main 2025-04-18 17:11:01 +02:00
s3 Merge branch '11.7' into 11.8 2025-02-11 20:29:43 +01:00
sql_sequence Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
storage_engine
stress
sys_vars MDEV-14091 Support password protected SSL key in server. 2025-04-19 14:04:10 +03:00
sysschema MDEV-31736: format_bytes implementation 2024-11-26 13:10:01 +04:00
unit
vcol fix incorrect merge 15700f54c2 2025-04-18 09:41:24 +02:00
versioning MDEV-36274 Implement IDENTITY column 2025-06-18 12:09:31 +02:00
wsrep Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00