Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/suite/storage_engine/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 1 kB image not shown  

Quelle  vcol.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[78] VDM[52] Lisp[34]} [Methode: maximale Elemente, drei Dimensionen]

#
# Virtual columns
#

--source have_engine.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1);
--source create_table.inc
if ($mysql_errname)
{
  --let $my_last_stmt = $create_statement
  --let $functionality = Virtual columns
  --source unexpected_result.inc
}
if (!$mysql_errname)
{
  --replace_column 3 # 5 #
  SHOW COLUMNS IN t1;

  INSERT INTO t1 (a) VALUES (1),(2);
  INSERT INTO t1 (a,b) VALUES (3,3),(4,4);
  --sorted_result
  SELECT a,b FROM t1;

  DROP TABLE t1;

  let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1) PERSISTENT;
  --source create_table.inc

  --replace_column 3 # 5 #
  SHOW COLUMNS IN t1;

  INSERT INTO t1 (a) VALUES (1),(2);
  INSERT INTO t1 (a,b) VALUES (3,3),(4,4);
  --sorted_result
  SELECT a,b FROM t1;

  DROP TABLE t1;

  let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1) VIRTUAL;
  --source create_table.inc

  --replace_column 3 # 5 #
  SHOW COLUMNS IN t1;

  INSERT INTO t1 (a) VALUES (1),(2);
  INSERT INTO t1 (a,b) VALUES (3,3),(4,4);
  --sorted_result
  SELECT a,b FROM t1;

  DROP TABLE t1;

  let $create_definition = a $int_col, b $int_col AS (a+1) PERSISTENT;
  --source create_table.inc

  --replace_column 3 # 5 #
  SHOW COLUMNS IN t1;

  INSERT INTO t1 (a) VALUES (1),(2);
  INSERT INTO t1 (a,b) VALUES (3,3),(4,4);
  --sorted_result
  SELECT a,b FROM t1;

  DROP TABLE t1;
}

--source cleanup_engine.inc


[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-10-08]