From a33acff89a814a19cdea6a471032af537f5ea009 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Thu, 30 Jul 2026 20:11:51 +0800 Subject: [PATCH 01/24] update --- pkg/bootstrap/upgrade.go | 2 + .../versions/v4_0_6/cluster_upgrade_list.go | 20 +++++ pkg/bootstrap/versions/v4_0_6/log.go | 22 +++++ .../versions/v4_0_6/tenant_upgrade_list.go | 61 +++++++++++++ pkg/bootstrap/versions/v4_0_6/upgrade.go | 86 +++++++++++++++++++ pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 64 ++++++++++++++ pkg/sql/plan/build_dml_util.go | 6 +- pkg/sql/plan/build_dml_util_test.go | 18 ++++ pkg/util/sysview/predefined.go | 33 +++---- pkg/util/sysview/predefined_test.go | 20 +++++ .../fk_information_schema_metadata.result | 29 +++++++ .../fk_information_schema_metadata.sql | 27 ++++++ 12 files changed, 370 insertions(+), 18 deletions(-) create mode 100644 pkg/bootstrap/versions/v4_0_6/cluster_upgrade_list.go create mode 100644 pkg/bootstrap/versions/v4_0_6/log.go create mode 100644 pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go create mode 100644 pkg/bootstrap/versions/v4_0_6/upgrade.go create mode 100644 pkg/bootstrap/versions/v4_0_6/upgrade_test.go create mode 100644 test/distributed/cases/foreign_key/fk_information_schema_metadata.result create mode 100644 test/distributed/cases/foreign_key/fk_information_schema_metadata.sql diff --git a/pkg/bootstrap/upgrade.go b/pkg/bootstrap/upgrade.go index 1bdb596f5bb60..4f8c545f89b3f 100644 --- a/pkg/bootstrap/upgrade.go +++ b/pkg/bootstrap/upgrade.go @@ -32,6 +32,7 @@ import ( "github.com/matrixorigin/matrixone/pkg/bootstrap/versions/v4_0_3" "github.com/matrixorigin/matrixone/pkg/bootstrap/versions/v4_0_4" "github.com/matrixorigin/matrixone/pkg/bootstrap/versions/v4_0_5" + "github.com/matrixorigin/matrixone/pkg/bootstrap/versions/v4_0_6" ) // initUpgrade all versions need create a upgrade handle in pkg/bootstrap/versions @@ -57,6 +58,7 @@ func (s *service) initUpgrade() { s.handles = append(s.handles, v4_0_3.Handler) s.handles = append(s.handles, v4_0_4.Handler) s.handles = append(s.handles, v4_0_5.Handler) + s.handles = append(s.handles, v4_0_6.Handler) } func (s *service) getFinalVersionHandle() VersionHandle { diff --git a/pkg/bootstrap/versions/v4_0_6/cluster_upgrade_list.go b/pkg/bootstrap/versions/v4_0_6/cluster_upgrade_list.go new file mode 100644 index 0000000000000..a783fb32e1ee4 --- /dev/null +++ b/pkg/bootstrap/versions/v4_0_6/cluster_upgrade_list.go @@ -0,0 +1,20 @@ +// Copyright 2026 Matrix Origin +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v4_0_6 + +import "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" + +// No cluster-level upgrades for v4.0.6. +var clusterUpgEntries = []versions.UpgradeEntry{} diff --git a/pkg/bootstrap/versions/v4_0_6/log.go b/pkg/bootstrap/versions/v4_0_6/log.go new file mode 100644 index 0000000000000..f5b7bf6dd7ac8 --- /dev/null +++ b/pkg/bootstrap/versions/v4_0_6/log.go @@ -0,0 +1,22 @@ +// Copyright 2026 Matrix Origin +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v4_0_6 + +import ( + "github.com/matrixorigin/matrixone/pkg/common/log" + "github.com/matrixorigin/matrixone/pkg/common/runtime" +) + +func getLogger(sid string) *log.MOLogger { return runtime.ServiceRuntime(sid).Logger() } diff --git a/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go b/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go new file mode 100644 index 0000000000000..dbe9a48b75d6f --- /dev/null +++ b/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go @@ -0,0 +1,61 @@ +// Copyright 2026 Matrix Origin +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v4_0_6 + +import ( + "fmt" + + "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" + "github.com/matrixorigin/matrixone/pkg/util/executor" + "github.com/matrixorigin/matrixone/pkg/util/sysview" +) + +var tenantUpgEntries = []versions.UpgradeEntry{ + upgradeInformationSchemaKeyColumnUsage(), + upgradeInformationSchemaReferentialConstraints(), +} + +func upgradeInformationSchemaKeyColumnUsage() versions.UpgradeEntry { + return versions.UpgradeEntry{ + Schema: sysview.InformationDBConst, + TableName: "KEY_COLUMN_USAGE", + UpgType: versions.CREATE_VIEW, + UpgSql: sysview.InformationSchemaKeyColumnUsageDDL, + CheckFunc: checkViewDefinition("KEY_COLUMN_USAGE", sysview.InformationSchemaKeyColumnUsageDDL), + // KEY_COLUMN_USAGE was previously an unpopulated system table. + PreSql: fmt.Sprintf("DROP TABLE IF EXISTS %s.%s;", sysview.InformationDBConst, "KEY_COLUMN_USAGE"), + } +} + +func upgradeInformationSchemaReferentialConstraints() versions.UpgradeEntry { + return versions.UpgradeEntry{ + Schema: sysview.InformationDBConst, + TableName: "REFERENTIAL_CONSTRAINTS", + UpgType: versions.MODIFY_VIEW, + UpgSql: sysview.InformationSchemaReferentialConstraintsDDL, + CheckFunc: checkViewDefinition("REFERENTIAL_CONSTRAINTS", sysview.InformationSchemaReferentialConstraintsDDL), + PreSql: fmt.Sprintf("DROP VIEW IF EXISTS %s.%s;", sysview.InformationDBConst, "REFERENTIAL_CONSTRAINTS"), + } +} + +func checkViewDefinition(viewName, definition string) func(executor.TxnExecutor, uint32) (bool, error) { + return func(txn executor.TxnExecutor, accountID uint32) (bool, error) { + exists, viewDef, err := versions.CheckViewDefinition(txn, accountID, sysview.InformationDBConst, viewName) + if err != nil { + return false, err + } + return exists && viewDef == definition, nil + } +} diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go new file mode 100644 index 0000000000000..ffb321b3e2aba --- /dev/null +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -0,0 +1,86 @@ +// Copyright 2026 Matrix Origin +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v4_0_6 + +import ( + "context" + "time" + + "go.uber.org/zap" + + "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" + "github.com/matrixorigin/matrixone/pkg/catalog" + "github.com/matrixorigin/matrixone/pkg/common/moerr" + "github.com/matrixorigin/matrixone/pkg/util/executor" +) + +var Handler *versionHandle + +func init() { + Handler = &versionHandle{ + metadata: versions.Version{ + Version: "4.0.6", + MinUpgradeVersion: "4.0.5", + UpgradeCluster: versions.Yes, + UpgradeTenant: versions.Yes, + VersionOffset: uint32(len(tenantUpgEntries) + len(clusterUpgEntries)), + }, + } +} + +type versionHandle struct { + metadata versions.Version +} + +func (v *versionHandle) Metadata() versions.Version { return v.metadata } + +func (v *versionHandle) Prepare(ctx context.Context, txn executor.TxnExecutor, final bool) error { + txn.Use(catalog.MO_CATALOG) + return nil +} + +func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { + for _, upgEntry := range tenantUpgEntries { + start := time.Now() + if err := upgEntry.Upgrade(txn, uint32(tenantID)); err != nil { + getLogger(txn.Txn().TxnOptions().CN).Error("tenant upgrade entry execute error", + zap.Error(err), zap.Int32("tenantId", tenantID), zap.String("version", v.Metadata().Version), zap.String("upgrade entry", upgEntry.String())) + return err + } + getLogger(txn.Txn().TxnOptions().CN).Info("tenant upgrade entry complete", + zap.String("upgrade entry", upgEntry.String()), zap.Int64("time cost(ms)", time.Since(start).Milliseconds()), zap.String("toVersion", v.Metadata().Version)) + } + getLogger(txn.Txn().TxnOptions().CN).Info("tenant upgrade success", zap.Int32("tenantId", tenantID), zap.String("toVersion", v.Metadata().Version)) + return nil +} + +func (v *versionHandle) HandleClusterUpgrade(ctx context.Context, txn executor.TxnExecutor) error { + for _, upgEntry := range clusterUpgEntries { + start := time.Now() + if err := upgEntry.Upgrade(txn, uint32(txn.Txn().TxnOptions().AccountID)); err != nil { + getLogger(txn.Txn().TxnOptions().CN).Error("cluster upgrade entry execute error", + zap.Error(err), zap.String("version", v.Metadata().Version), zap.String("upgrade entry", upgEntry.String())) + return err + } + getLogger(txn.Txn().TxnOptions().CN).Info("cluster upgrade entry complete", + zap.String("upgrade entry", upgEntry.String()), zap.Int64("time cost(ms)", time.Since(start).Milliseconds()), zap.String("toVersion", v.Metadata().Version)) + } + getLogger(txn.Txn().TxnOptions().CN).Info("cluster upgrade success", zap.String("toVersion", v.Metadata().Version)) + return nil +} + +func (v *versionHandle) HandleCreateFrameworkDeps(txn executor.TxnExecutor) error { + return moerr.NewInternalErrorNoCtxf("Only v1.2.0 can initialize upgrade framework, current version is:%s", Handler.metadata.Version) +} diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go new file mode 100644 index 0000000000000..c830c2dd4ef08 --- /dev/null +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -0,0 +1,64 @@ +// Copyright 2026 Matrix Origin +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v4_0_6 + +import ( + "strings" + "testing" + + "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" + "github.com/matrixorigin/matrixone/pkg/util/sysview" +) + +func TestForeignKeyMetadataTenantUpgradeEntries(t *testing.T) { + if len(tenantUpgEntries) != 2 { + t.Fatalf("expected 2 foreign-key metadata tenant upgrades, got %d", len(tenantUpgEntries)) + } + + keyColumnUsage := tenantUpgEntries[0] + if keyColumnUsage.UpgType != versions.CREATE_VIEW || keyColumnUsage.TableName != "KEY_COLUMN_USAGE" { + t.Fatalf("unexpected KEY_COLUMN_USAGE upgrade: %+v", keyColumnUsage) + } + if keyColumnUsage.UpgSql != sysview.InformationSchemaKeyColumnUsageDDL { + t.Fatalf("unexpected KEY_COLUMN_USAGE definition: %s", keyColumnUsage.UpgSql) + } + if !strings.Contains(strings.ToLower(keyColumnUsage.PreSql), "drop table if exists information_schema.key_column_usage") { + t.Fatalf("KEY_COLUMN_USAGE must replace the legacy table: %s", keyColumnUsage.PreSql) + } + + referentialConstraints := tenantUpgEntries[1] + if referentialConstraints.UpgType != versions.MODIFY_VIEW || referentialConstraints.TableName != "REFERENTIAL_CONSTRAINTS" { + t.Fatalf("unexpected REFERENTIAL_CONSTRAINTS upgrade: %+v", referentialConstraints) + } + if referentialConstraints.UpgSql != sysview.InformationSchemaReferentialConstraintsDDL { + t.Fatalf("unexpected REFERENTIAL_CONSTRAINTS definition: %s", referentialConstraints.UpgSql) + } + if !strings.Contains(strings.ToLower(referentialConstraints.PreSql), "drop view if exists information_schema.referential_constraints") { + t.Fatalf("REFERENTIAL_CONSTRAINTS must replace the previous view: %s", referentialConstraints.PreSql) + } +} + +func TestForeignKeyMetadataVersionHandleMetadataAndClusterNoop(t *testing.T) { + meta := Handler.Metadata() + if meta.Version != "4.0.6" || meta.MinUpgradeVersion != "4.0.5" || meta.UpgradeTenant != versions.Yes || meta.UpgradeCluster != versions.Yes { + t.Fatalf("unexpected metadata: %+v", meta) + } + if meta.VersionOffset != uint32(len(tenantUpgEntries)+len(clusterUpgEntries)) { + t.Fatalf("unexpected version offset: %+v", meta) + } + if len(clusterUpgEntries) != 0 { + t.Fatalf("expected no cluster upgrade entries, got %d", len(clusterUpgEntries)) + } +} diff --git a/pkg/sql/plan/build_dml_util.go b/pkg/sql/plan/build_dml_util.go index 48eebe8c72eae..8986836c13570 100644 --- a/pkg/sql/plan/build_dml_util.go +++ b/pkg/sql/plan/build_dml_util.go @@ -17,6 +17,7 @@ package plan import ( "context" "fmt" + "strconv" "strings" "sync" @@ -3457,7 +3458,7 @@ func GetSqlForFkReferredTo(db, table string) string { "refer_db_name = %s and refer_table_name = %s "+ " and "+ "(db_name != %s or db_name = %s and table_name != %s) "+ - "order by db_name, table_name, constraint_name;", + "order by db_name, table_name, constraint_name, constraint_id;", quoteSQLStringLiteral(db), quoteSQLStringLiteral(table), quoteSQLStringLiteral(db), quoteSQLStringLiteral(db), quoteSQLStringLiteral(table)) } @@ -3542,7 +3543,8 @@ func getSqlForAddFk(db, table string, data *FkData) string { sb.WriteString(" values ") for childIdx, childCol := range data.Cols.Cols { row[0] = data.Def.Name - row[1] = "0" + // constraint_id preserves the declaration order of composite foreign-key columns. + row[1] = strconv.Itoa(childIdx + 1) row[2] = db row[3] = "0" row[4] = table diff --git a/pkg/sql/plan/build_dml_util_test.go b/pkg/sql/plan/build_dml_util_test.go index c46ba46b93d98..8d71a8746ed89 100644 --- a/pkg/sql/plan/build_dml_util_test.go +++ b/pkg/sql/plan/build_dml_util_test.go @@ -88,6 +88,24 @@ func TestGetSqlForAddFkEscapesStringLiterals(t *testing.T) { require.Contains(t, sql, "'parent''col'") } +func TestGetSqlForAddFkRecordsCompositeColumnOrder(t *testing.T) { + fkData := &FkData{ + Def: &plan.ForeignKeyDef{Name: "fk_child_parent"}, + Cols: &plan.FkColName{Cols: []string{"child_first", "child_second"}}, + ColsReferred: &plan.FkColName{Cols: []string{ + "parent_first", "parent_second", + }}, + ParentDbName: "parent_db", + ParentTableName: "parent", + } + + sql := getSqlForAddFk("child_db", "child", fkData) + require.Contains(t, sql, "('fk_child_parent','1','child_db','0','child','0','child_first'") + require.Contains(t, sql, "('fk_child_parent','2','child_db','0','child','0','child_second'") + require.Contains(t, GetSqlForFkReferredTo("parent_db", "parent"), + "order by db_name, table_name, constraint_name, constraint_id") +} + func TestGetSqlForCheckHasDBRefersToEscapesStringLiterals(t *testing.T) { sql := getSqlForCheckHasDBRefersTo("db'name") require.Contains(t, sql, "refer_db_name = 'db''name'") diff --git a/pkg/util/sysview/predefined.go b/pkg/util/sysview/predefined.go index cef59eb318a5e..2496bf95ce97f 100644 --- a/pkg/util/sysview/predefined.go +++ b/pkg/util/sysview/predefined.go @@ -155,20 +155,21 @@ var ( // `information_schema` database // They are all Tenant level system tables/system views var ( - InformationSchemaKeyColumnUsageDDL = "CREATE TABLE information_schema.KEY_COLUMN_USAGE (" + - "CONSTRAINT_CATALOG varchar(64)," + - "CONSTRAINT_SCHEMA varchar(64)," + - "CONSTRAINT_NAME varchar(64)," + - "TABLE_CATALOG varchar(64)," + - "TABLE_SCHEMA varchar(64)," + - "TABLE_NAME varchar(64)," + - "COLUMN_NAME varchar(64)," + - "ORDINAL_POSITION int unsigned," + - "POSITION_IN_UNIQUE_CONSTRAINT int unsigned," + - "REFERENCED_TABLE_SCHEMA varchar(64)," + - "REFERENCED_TABLE_NAME varchar(64)," + - "REFERENCED_COLUMN_NAME varchar(64)" + - ")" + InformationSchemaKeyColumnUsageDDL = "CREATE VIEW information_schema.KEY_COLUMN_USAGE AS " + + "SELECT " + + "CAST('def' AS varchar(64)) AS CONSTRAINT_CATALOG, " + + "CAST(fk.db_name AS varchar(64)) AS CONSTRAINT_SCHEMA, " + + "CAST(fk.constraint_name AS varchar(64)) AS CONSTRAINT_NAME, " + + "CAST('def' AS varchar(64)) AS TABLE_CATALOG, " + + "CAST(fk.db_name AS varchar(64)) AS TABLE_SCHEMA, " + + "CAST(fk.table_name AS varchar(64)) AS TABLE_NAME, " + + "CAST(fk.column_name AS varchar(64)) AS COLUMN_NAME, " + + "CAST(CASE WHEN fk.constraint_id = 0 THEN 1 ELSE fk.constraint_id END AS int unsigned) AS ORDINAL_POSITION, " + + "CAST(CASE WHEN fk.constraint_id = 0 THEN 1 ELSE fk.constraint_id END AS int unsigned) AS POSITION_IN_UNIQUE_CONSTRAINT, " + + "CAST(fk.refer_db_name AS varchar(64)) AS REFERENCED_TABLE_SCHEMA, " + + "CAST(fk.refer_table_name AS varchar(64)) AS REFERENCED_TABLE_NAME, " + + "CAST(fk.refer_column_name AS varchar(64)) AS REFERENCED_COLUMN_NAME " + + "FROM mo_catalog.mo_foreign_keys fk" InformationSchemaColumnsDDL = fmt.Sprintf("CREATE VIEW information_schema.COLUMNS AS select "+ "'def' as TABLE_CATALOG,"+ @@ -411,8 +412,8 @@ var ( "fk.refer_db_name AS UNIQUE_CONSTRAINT_SCHEMA, " + "idx.type AS UNIQUE_CONSTRAINT_NAME," + "'NONE' AS MATCH_OPTION, " + - "fk.on_update AS UPDATE_RULE, " + - "fk.on_delete AS DELETE_RULE, " + + "CASE WHEN upper(fk.on_update) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_update END AS UPDATE_RULE, " + + "CASE WHEN upper(fk.on_delete) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_delete END AS DELETE_RULE, " + "fk.table_name AS TABLE_NAME, " + "fk.refer_table_name AS REFERENCED_TABLE_NAME " + "FROM mo_catalog.mo_foreign_keys fk " + diff --git a/pkg/util/sysview/predefined_test.go b/pkg/util/sysview/predefined_test.go index d159b3b4287f1..9e4dcdc057370 100644 --- a/pkg/util/sysview/predefined_test.go +++ b/pkg/util/sysview/predefined_test.go @@ -32,3 +32,23 @@ func TestInformationSchemaStatisticsDDL_RestrictsCatalogJoins(t *testing.T) { assert.True(t, strings.Contains(InformationSchemaStatisticsDDL, "`tcl`.`att_relname` = `tbl`.`relname`")) assert.True(t, strings.Contains(InformationSchemaStatisticsDDL, "`tbl`.`account_id` = current_account_id()")) } + +func TestInformationSchemaKeyColumnUsageDDL_ProjectsForeignKeyMappings(t *testing.T) { + assert.True(t, strings.HasPrefix(InformationSchemaKeyColumnUsageDDL, "CREATE VIEW information_schema.KEY_COLUMN_USAGE AS")) + for _, column := range []string{ + "CAST(fk.column_name AS varchar(64)) AS COLUMN_NAME", + "CAST(fk.refer_db_name AS varchar(64)) AS REFERENCED_TABLE_SCHEMA", + "CAST(fk.refer_table_name AS varchar(64)) AS REFERENCED_TABLE_NAME", + "CAST(fk.refer_column_name AS varchar(64)) AS REFERENCED_COLUMN_NAME", + "CAST(CASE WHEN fk.constraint_id = 0 THEN 1 ELSE fk.constraint_id END AS int unsigned) AS ORDINAL_POSITION", + } { + assert.Contains(t, InformationSchemaKeyColumnUsageDDL, column) + } +} + +func TestInformationSchemaReferentialConstraintsDDL_UsesMySQLDefaultAction(t *testing.T) { + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "CASE WHEN upper(fk.on_update) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_update END AS UPDATE_RULE") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "CASE WHEN upper(fk.on_delete) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_delete END AS DELETE_RULE") +} diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result new file mode 100644 index 0000000000000..d2b8971531a74 --- /dev/null +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result @@ -0,0 +1,29 @@ +drop database if exists mysql_compat_model11_min2; +create database mysql_compat_model11_min2; +use mysql_compat_model11_min2; +create table p (id int primary key); +create table p_compound (id int, code int, primary key (id, code)); +create table c ( +id int primary key, +parent_id int, +compound_parent_id int, +parent_code int, +constraint fk_c_p foreign key (parent_id) references p(id), +constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code) +); +select constraint_name, delete_rule, update_rule +from information_schema.referential_constraints +where constraint_schema = database() +order by constraint_name; +➤ constraint_name[12,-1,0] ¦ delete_rule[12,-1,0] ¦ update_rule[12,-1,0] 𝄀 +fk_c_p ¦ NO ACTION ¦ NO ACTION 𝄀 +fk_c_p_compound ¦ NO ACTION ¦ NO ACTION +select table_name, column_name, referenced_table_name, referenced_column_name, ordinal_position +from information_schema.key_column_usage +where table_schema = database() and referenced_table_name is not null +order by table_name, constraint_name, ordinal_position; +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ referenced_table_name[12,-1,0] ¦ referenced_column_name[12,-1,0] ¦ ordinal_position[4,32,0] 𝄀 +c ¦ parent_id ¦ p ¦ id ¦ 1 𝄀 +c ¦ compound_parent_id ¦ p_compound ¦ id ¦ 1 𝄀 +c ¦ parent_code ¦ p_compound ¦ code ¦ 2 +drop database mysql_compat_model11_min2; diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql new file mode 100644 index 0000000000000..866c1c6039740 --- /dev/null +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql @@ -0,0 +1,27 @@ +-- @bvt:issue +drop database if exists mysql_compat_model11_min2; +create database mysql_compat_model11_min2; +use mysql_compat_model11_min2; + +create table p (id int primary key); +create table p_compound (id int, code int, primary key (id, code)); +create table c ( + id int primary key, + parent_id int, + compound_parent_id int, + parent_code int, + constraint fk_c_p foreign key (parent_id) references p(id), + constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code) +); + +select constraint_name, delete_rule, update_rule +from information_schema.referential_constraints +where constraint_schema = database() +order by constraint_name; + +select table_name, column_name, referenced_table_name, referenced_column_name, ordinal_position +from information_schema.key_column_usage +where table_schema = database() and referenced_table_name is not null +order by table_name, constraint_name, ordinal_position; + +drop database mysql_compat_model11_min2; From c61fd022f92791d962f80346feb80df5086e6483 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Thu, 30 Jul 2026 20:44:28 +0800 Subject: [PATCH 02/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 133 ++++++++++++++++++ pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 36 +++++ pkg/sql/plan/build_ddl.go | 5 + pkg/sql/plan/build_dml_util.go | 6 + pkg/sql/plan/build_dml_util_test.go | 19 +++ pkg/util/sysview/predefined.go | 16 ++- pkg/util/sysview/predefined_test.go | 12 +- .../fk_information_schema_metadata.result | 16 ++- .../fk_information_schema_metadata.sql | 9 +- 9 files changed, 238 insertions(+), 14 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index ffb321b3e2aba..0132daf1feecc 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -16,6 +16,8 @@ package v4_0_6 import ( "context" + "fmt" + "strings" "time" "go.uber.org/zap" @@ -23,6 +25,9 @@ import ( "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" "github.com/matrixorigin/matrixone/pkg/catalog" "github.com/matrixorigin/matrixone/pkg/common/moerr" + "github.com/matrixorigin/matrixone/pkg/container/vector" + "github.com/matrixorigin/matrixone/pkg/sql/parsers/dialect/mysql" + "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree" "github.com/matrixorigin/matrixone/pkg/util/executor" ) @@ -52,6 +57,10 @@ func (v *versionHandle) Prepare(ctx context.Context, txn executor.TxnExecutor, f } func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { + if err := upgradeLegacyForeignKeyMetadata(ctx, tenantID, txn); err != nil { + return err + } + for _, upgEntry := range tenantUpgEntries { start := time.Now() if err := upgEntry.Upgrade(txn, uint32(tenantID)); err != nil { @@ -66,6 +75,130 @@ func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, return nil } +const legacyForeignKeyTableDefinitionsSQL = "SELECT DISTINCT fk.db_name, fk.table_name, tbl.rel_createsql " + + "FROM mo_catalog.mo_foreign_keys fk " + + "JOIN mo_catalog.mo_tables tbl ON tbl.reldatabase = fk.db_name AND tbl.relname = fk.table_name " + + "WHERE fk.constraint_id = 0" + +type legacyForeignKeyTableDefinition struct { + database string + table string + createSQL string +} + +// upgradeLegacyForeignKeyMetadata restores details that earlier catalog rows did +// not persist: composite column order and whether a RESTRICT action was omitted. +// rel_createsql is the durable logical table definition, so it is safe to use as +// the migration source instead of relying on physical catalog row order. +func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { + definitions, err := getLegacyForeignKeyTableDefinitions(tenantID, txn) + if err != nil { + return err + } + + for _, definition := range definitions { + updates, err := legacyForeignKeyMetadataUpdates(definition) + if err != nil { + return err + } + for _, sql := range updates { + res, err := txn.Exec(sql, executor.StatementOption{}.WithAccountID(uint32(tenantID))) + if err != nil { + return err + } + res.Close() + } + } + return nil +} + +func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecutor) ([]legacyForeignKeyTableDefinition, error) { + res, err := txn.Exec(legacyForeignKeyTableDefinitionsSQL, executor.StatementOption{}.WithAccountID(uint32(tenantID))) + if err != nil { + return nil, err + } + defer res.Close() + + definitions := make([]legacyForeignKeyTableDefinition, 0) + res.ReadRows(func(rows int, cols []*vector.Vector) bool { + for i := 0; i < rows; i++ { + definitions = append(definitions, legacyForeignKeyTableDefinition{ + database: cols[0].GetStringAt(i), + table: cols[1].GetStringAt(i), + createSQL: cols[2].GetStringAt(i), + }) + } + return true + }) + return definitions, nil +} + +func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) ([]string, error) { + statements, err := mysql.Parse(context.Background(), definition.createSQL, 1) + if err != nil { + return nil, fmt.Errorf("parse legacy foreign-key table %s.%s: %w", definition.database, definition.table, err) + } + defer func() { + for _, statement := range statements { + statement.Free() + } + }() + + if len(statements) != 1 { + return nil, fmt.Errorf("legacy foreign-key table %s.%s has %d statements", definition.database, definition.table, len(statements)) + } + createTable, ok := statements[0].(*tree.CreateTable) + if !ok { + return nil, fmt.Errorf("legacy foreign-key table %s.%s does not have a CREATE TABLE definition", definition.database, definition.table) + } + + updates := make([]string, 0) + for _, tableDef := range createTable.Defs { + foreignKey, ok := tableDef.(*tree.ForeignKey) + if !ok { + continue + } + if foreignKey.ConstraintSymbol == "" || foreignKey.Refer == nil { + return nil, fmt.Errorf("legacy foreign key in %s.%s has incomplete persisted definition", definition.database, definition.table) + } + for ordinal, keyPart := range foreignKey.KeyParts { + updates = append(updates, fmt.Sprintf( + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s "+ + "WHERE constraint_id = 0 AND db_name = %s AND table_name = %s AND constraint_name = %s AND column_name = %s", + ordinal+1, + quoteSQLStringLiteral(referenceActionName(foreignKey.Refer.OnDelete)), + quoteSQLStringLiteral(referenceActionName(foreignKey.Refer.OnUpdate)), + quoteSQLStringLiteral(definition.database), + quoteSQLStringLiteral(definition.table), + quoteSQLStringLiteral(foreignKey.ConstraintSymbol), + quoteSQLStringLiteral(keyPart.ColName.ColName()), + )) + } + } + return updates, nil +} + +func referenceActionName(action tree.ReferenceOptionType) string { + switch action { + case tree.REFERENCE_OPTION_CASCADE: + return "CASCADE" + case tree.REFERENCE_OPTION_SET_NULL: + return "SET_NULL" + case tree.REFERENCE_OPTION_NO_ACTION: + return "NO_ACTION" + case tree.REFERENCE_OPTION_SET_DEFAULT: + return "SET_DEFAULT" + case tree.REFERENCE_OPTION_RESTRICT: + return "RESTRICT" + default: + return "NO_ACTION" + } +} + +func quoteSQLStringLiteral(s string) string { + return "'" + strings.NewReplacer(`\\`, `\\\\`, `'`, `''`).Replace(s) + "'" +} + func (v *versionHandle) HandleClusterUpgrade(ctx context.Context, txn executor.TxnExecutor) error { for _, upgEntry := range clusterUpgEntries { start := time.Now() diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index c830c2dd4ef08..ca16ed3272d3d 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -50,6 +50,42 @@ func TestForeignKeyMetadataTenantUpgradeEntries(t *testing.T) { } } +func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db'one", + table: "child", + createSQL: "create table child (a int, b int, constraint fk_default foreign key (b, a) references parent (b, a), " + + "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)", + }) + if err != nil { + t.Fatal(err) + } + if len(updates) != 3 { + t.Fatalf("expected 3 legacy foreign-key updates, got %d: %v", len(updates), updates) + } + + for _, expected := range []string{ + "constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", + "constraint_name = 'fk_default' AND column_name = 'b'", + "constraint_id = 2, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", + "constraint_name = 'fk_default' AND column_name = 'a'", + "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT'", + "constraint_name = 'fk_restrict' AND column_name = 'a'", + "db_name = 'db''one'", + } { + found := false + for _, update := range updates { + if strings.Contains(update, expected) { + found = true + break + } + } + if !found { + t.Fatalf("missing %q in generated updates: %v", expected, updates) + } + } +} + func TestForeignKeyMetadataVersionHandleMetadataAndClusterNoop(t *testing.T) { meta := Handler.Metadata() if meta.Version != "4.0.6" || meta.MinUpgradeVersion != "4.0.5" || meta.UpgradeTenant != versions.Yes || meta.UpgradeCluster != versions.Yes { diff --git a/pkg/sql/plan/build_ddl.go b/pkg/sql/plan/build_ddl.go index 35ed25facce32..2c7b1772cc318 100644 --- a/pkg/sql/plan/build_ddl.go +++ b/pkg/sql/plan/build_ddl.go @@ -4305,6 +4305,9 @@ type FkData struct { UpdateSql string // forward reference ForwardRefer bool + // reference options omitted by the user are MySQL NO ACTION in metadata. + DefaultOnDelete bool + DefaultOnUpdate bool } // getForeignKeyData prepares the foreign key data. @@ -4321,6 +4324,8 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d OnUpdate: getRefAction(refer.OnUpdate), ForeignCols: make([]uint64, len(refer.KeyParts)), }, + DefaultOnDelete: refer.OnDelete == tree.REFERENCE_OPTION_INVALID, + DefaultOnUpdate: refer.OnUpdate == tree.REFERENCE_OPTION_INVALID, } // get fk columns of create table diff --git a/pkg/sql/plan/build_dml_util.go b/pkg/sql/plan/build_dml_util.go index 8986836c13570..5d75cbb8e5984 100644 --- a/pkg/sql/plan/build_dml_util.go +++ b/pkg/sql/plan/build_dml_util.go @@ -3559,6 +3559,12 @@ func getSqlForAddFk(db, table string, data *FkData) string { row[13] = "0" row[14] = data.Def.OnDelete.String() row[15] = data.Def.OnUpdate.String() + if data.DefaultOnDelete { + row[14] = plan.ForeignKeyDef_NO_ACTION.String() + } + if data.DefaultOnUpdate { + row[15] = plan.ForeignKeyDef_NO_ACTION.String() + } { if rows > 0 { sb.WriteByte(',') diff --git a/pkg/sql/plan/build_dml_util_test.go b/pkg/sql/plan/build_dml_util_test.go index 8d71a8746ed89..418838cabcd50 100644 --- a/pkg/sql/plan/build_dml_util_test.go +++ b/pkg/sql/plan/build_dml_util_test.go @@ -106,6 +106,25 @@ func TestGetSqlForAddFkRecordsCompositeColumnOrder(t *testing.T) { "order by db_name, table_name, constraint_name, constraint_id") } +func TestGetSqlForAddFkStoresDefaultActionsAsNoAction(t *testing.T) { + fkData := &FkData{ + Def: &plan.ForeignKeyDef{ + Name: "fk_default_action", + OnDelete: plan.ForeignKeyDef_RESTRICT, + OnUpdate: plan.ForeignKeyDef_RESTRICT, + }, + Cols: &plan.FkColName{Cols: []string{"child_id"}}, + ColsReferred: &plan.FkColName{Cols: []string{"parent_id"}}, + ParentDbName: "parent_db", + ParentTableName: "parent", + DefaultOnDelete: true, + DefaultOnUpdate: true, + } + + sql := getSqlForAddFk("child_db", "child", fkData) + require.Contains(t, sql, "'NO_ACTION','NO_ACTION'") +} + func TestGetSqlForCheckHasDBRefersToEscapesStringLiterals(t *testing.T) { sql := getSqlForCheckHasDBRefersTo("db'name") require.Contains(t, sql, "refer_db_name = 'db''name'") diff --git a/pkg/util/sysview/predefined.go b/pkg/util/sysview/predefined.go index 2496bf95ce97f..f0ccbb839ec83 100644 --- a/pkg/util/sysview/predefined.go +++ b/pkg/util/sysview/predefined.go @@ -164,8 +164,8 @@ var ( "CAST(fk.db_name AS varchar(64)) AS TABLE_SCHEMA, " + "CAST(fk.table_name AS varchar(64)) AS TABLE_NAME, " + "CAST(fk.column_name AS varchar(64)) AS COLUMN_NAME, " + - "CAST(CASE WHEN fk.constraint_id = 0 THEN 1 ELSE fk.constraint_id END AS int unsigned) AS ORDINAL_POSITION, " + - "CAST(CASE WHEN fk.constraint_id = 0 THEN 1 ELSE fk.constraint_id END AS int unsigned) AS POSITION_IN_UNIQUE_CONSTRAINT, " + + "CAST(fk.constraint_id AS int unsigned) AS ORDINAL_POSITION, " + + "CAST(fk.constraint_id AS int unsigned) AS POSITION_IN_UNIQUE_CONSTRAINT, " + "CAST(fk.refer_db_name AS varchar(64)) AS REFERENCED_TABLE_SCHEMA, " + "CAST(fk.refer_table_name AS varchar(64)) AS REFERENCED_TABLE_NAME, " + "CAST(fk.refer_column_name AS varchar(64)) AS REFERENCED_COLUMN_NAME " + @@ -404,20 +404,22 @@ var ( "where `tbl`.`account_id` = current_account_id()" InformationSchemaReferentialConstraintsDDL = "CREATE VIEW information_schema.REFERENTIAL_CONSTRAINTS AS " + - "SELECT DISTINCT " + + "SELECT " + "'def' AS CONSTRAINT_CATALOG, " + "fk.db_name AS CONSTRAINT_SCHEMA, " + "fk.constraint_name AS CONSTRAINT_NAME, " + "'def' AS UNIQUE_CONSTRAINT_CATALOG, " + "fk.refer_db_name AS UNIQUE_CONSTRAINT_SCHEMA, " + - "idx.type AS UNIQUE_CONSTRAINT_NAME," + + "min(idx.type) AS UNIQUE_CONSTRAINT_NAME," + "'NONE' AS MATCH_OPTION, " + - "CASE WHEN upper(fk.on_update) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_update END AS UPDATE_RULE, " + - "CASE WHEN upper(fk.on_delete) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_delete END AS DELETE_RULE, " + + "replace(fk.on_update, '_', ' ') AS UPDATE_RULE, " + + "replace(fk.on_delete, '_', ' ') AS DELETE_RULE, " + "fk.table_name AS TABLE_NAME, " + "fk.refer_table_name AS REFERENCED_TABLE_NAME " + "FROM mo_catalog.mo_foreign_keys fk " + - "JOIN mo_catalog.mo_indexes idx ON (fk.refer_column_name = idx.column_name)" + "JOIN mo_catalog.mo_tables tbl ON (tbl.reldatabase = fk.refer_db_name AND tbl.relname = fk.refer_table_name AND tbl.account_id = current_account_id()) " + + "JOIN mo_catalog.mo_indexes idx ON (idx.table_id = tbl.rel_id AND idx.column_name = fk.refer_column_name) " + + "GROUP BY fk.db_name, fk.constraint_name, fk.refer_db_name, fk.on_update, fk.on_delete, fk.table_name, fk.refer_table_name" InformationSchemaEnginesDDL = "CREATE TABLE information_schema.ENGINES (" + "ENGINE varchar(64)," + diff --git a/pkg/util/sysview/predefined_test.go b/pkg/util/sysview/predefined_test.go index 9e4dcdc057370..aea9850f05043 100644 --- a/pkg/util/sysview/predefined_test.go +++ b/pkg/util/sysview/predefined_test.go @@ -40,7 +40,7 @@ func TestInformationSchemaKeyColumnUsageDDL_ProjectsForeignKeyMappings(t *testin "CAST(fk.refer_db_name AS varchar(64)) AS REFERENCED_TABLE_SCHEMA", "CAST(fk.refer_table_name AS varchar(64)) AS REFERENCED_TABLE_NAME", "CAST(fk.refer_column_name AS varchar(64)) AS REFERENCED_COLUMN_NAME", - "CAST(CASE WHEN fk.constraint_id = 0 THEN 1 ELSE fk.constraint_id END AS int unsigned) AS ORDINAL_POSITION", + "CAST(fk.constraint_id AS int unsigned) AS ORDINAL_POSITION", } { assert.Contains(t, InformationSchemaKeyColumnUsageDDL, column) } @@ -48,7 +48,13 @@ func TestInformationSchemaKeyColumnUsageDDL_ProjectsForeignKeyMappings(t *testin func TestInformationSchemaReferentialConstraintsDDL_UsesMySQLDefaultAction(t *testing.T) { assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "CASE WHEN upper(fk.on_update) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_update END AS UPDATE_RULE") + "replace(fk.on_update, '_', ' ') AS UPDATE_RULE") assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "CASE WHEN upper(fk.on_delete) = 'RESTRICT' THEN 'NO ACTION' ELSE fk.on_delete END AS DELETE_RULE") + "replace(fk.on_delete, '_', ' ') AS DELETE_RULE") + assert.NotContains(t, InformationSchemaReferentialConstraintsDDL, "upper(fk.on_update)") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "tbl.reldatabase = fk.refer_db_name AND tbl.relname = fk.refer_table_name") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "idx.table_id = tbl.rel_id AND idx.column_name = fk.refer_column_name") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, "GROUP BY fk.db_name, fk.constraint_name") } diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result index d2b8971531a74..3a8e76e4f7da5 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result @@ -3,13 +3,16 @@ create database mysql_compat_model11_min2; use mysql_compat_model11_min2; create table p (id int primary key); create table p_compound (id int, code int, primary key (id, code)); +create table unrelated (id int, unique key unrelated_id (id)); create table c ( id int primary key, parent_id int, compound_parent_id int, parent_code int, +restrict_parent_id int, constraint fk_c_p foreign key (parent_id) references p(id), -constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code) +constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code), +constraint fk_c_p_restrict foreign key (restrict_parent_id) references p(id) on delete restrict on update restrict ); select constraint_name, delete_rule, update_rule from information_schema.referential_constraints @@ -17,7 +20,13 @@ where constraint_schema = database() order by constraint_name; ➤ constraint_name[12,-1,0] ¦ delete_rule[12,-1,0] ¦ update_rule[12,-1,0] 𝄀 fk_c_p ¦ NO ACTION ¦ NO ACTION 𝄀 -fk_c_p_compound ¦ NO ACTION ¦ NO ACTION +fk_c_p_compound ¦ NO ACTION ¦ NO ACTION 𝄀 +fk_c_p_restrict ¦ RESTRICT ¦ RESTRICT +select count(*) as referential_constraint_count +from information_schema.referential_constraints +where constraint_schema = database(); +➤ referential_constraint_count[-5,64,0] 𝄀 +3 select table_name, column_name, referenced_table_name, referenced_column_name, ordinal_position from information_schema.key_column_usage where table_schema = database() and referenced_table_name is not null @@ -25,5 +34,6 @@ order by table_name, constraint_name, ordinal_position; ➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ referenced_table_name[12,-1,0] ¦ referenced_column_name[12,-1,0] ¦ ordinal_position[4,32,0] 𝄀 c ¦ parent_id ¦ p ¦ id ¦ 1 𝄀 c ¦ compound_parent_id ¦ p_compound ¦ id ¦ 1 𝄀 -c ¦ parent_code ¦ p_compound ¦ code ¦ 2 +c ¦ parent_code ¦ p_compound ¦ code ¦ 2 𝄀 +c ¦ restrict_parent_id ¦ p ¦ id ¦ 1 drop database mysql_compat_model11_min2; diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql index 866c1c6039740..9bc53133d56ad 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql @@ -5,13 +5,16 @@ use mysql_compat_model11_min2; create table p (id int primary key); create table p_compound (id int, code int, primary key (id, code)); +create table unrelated (id int, unique key unrelated_id (id)); create table c ( id int primary key, parent_id int, compound_parent_id int, parent_code int, + restrict_parent_id int, constraint fk_c_p foreign key (parent_id) references p(id), - constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code) + constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code), + constraint fk_c_p_restrict foreign key (restrict_parent_id) references p(id) on delete restrict on update restrict ); select constraint_name, delete_rule, update_rule @@ -19,6 +22,10 @@ from information_schema.referential_constraints where constraint_schema = database() order by constraint_name; +select count(*) as referential_constraint_count +from information_schema.referential_constraints +where constraint_schema = database(); + select table_name, column_name, referenced_table_name, referenced_column_name, ordinal_position from information_schema.key_column_usage where table_schema = database() and referenced_table_name is not null From 314d151732dd7438ac01b962b9e00433131c616c Mon Sep 17 00:00:00 2001 From: daviszhen Date: Fri, 31 Jul 2026 15:54:03 +0800 Subject: [PATCH 03/24] update --- .../cases/database/system_table.result | 475 ++++++------ .../clone/clone_fk_after_alter.result | 203 +++-- .../cases/mo_cloud/mo_cloud.result | 121 ++- .../system_variable/system_variables.result | 710 +++++++++--------- .../cases/table/truncate_table_2.result | 145 ++-- 5 files changed, 856 insertions(+), 798 deletions(-) diff --git a/test/distributed/cases/database/system_table.result b/test/distributed/cases/database/system_table.result index f4fce5a5bcb77..524017a2f354f 100644 --- a/test/distributed/cases/database/system_table.result +++ b/test/distributed/cases/database/system_table.result @@ -1,293 +1,268 @@ SELECT table_catalog,table_schema,table_name,table_type from `information_schema`.`tables` where table_name = 'mo_tables'; -table_catalog table_schema table_name table_type -def mo_catalog mo_tables BASE TABLE +➤ table_catalog[12,-1,0] ¦ table_schema[12,-1,0] ¦ table_name[12,-1,0] ¦ table_type[12,-1,0] 𝄀 +def ¦ mo_catalog ¦ mo_tables ¦ BASE TABLE SELECT * FROM `information_schema`.`character_sets` LIMIT 0,1000; -character_set_name default_collate_name description maxlen +➤ character_set_name[12,-1,0] ¦ default_collate_name[12,-1,0] ¦ description[12,-1,0] ¦ maxlen[4,32,0] SELECT * FROM `information_schema`.`columns` where TABLE_NAME = 'mo_tables' order by ORDINAL_POSITION LIMIT 2; -table_catalog table_schema table_name column_name ordinal_position column_default is_nullable data_type character_maximum_length character_octet_length numeric_precision numeric_scale datetime_precision character_set_name collation_name column_type column_key extra privileges column_comment generation_expression srs_id -def mo_catalog mo_tables rel_id 1 null YES BIGINT UNSIGNED null null null null null null null BIGINT UNSIGNED(0) select,insert,update,references null -def mo_catalog mo_tables relname 2 null YES VARCHAR 5000 120000 null null null utf8 utf8_bin VARCHAR(5000) select,insert,update,references null +➤ TABLE_CATALOG[12,-1,0] ¦ TABLE_SCHEMA[12,-1,0] ¦ TABLE_NAME[12,-1,0] ¦ COLUMN_NAME[12,-1,0] ¦ ORDINAL_POSITION[4,32,0] ¦ COLUMN_DEFAULT[12,-1,0] ¦ IS_NULLABLE[12,-1,0] ¦ DATA_TYPE[12,-1,0] ¦ CHARACTER_MAXIMUM_LENGTH[-5,64,0] ¦ CHARACTER_OCTET_LENGTH[-5,64,0] ¦ NUMERIC_PRECISION[-5,64,0] ¦ NUMERIC_SCALE[-5,64,0] ¦ DATETIME_PRECISION[-5,64,0] ¦ CHARACTER_SET_NAME[12,-1,0] ¦ COLLATION_NAME[12,-1,0] ¦ COLUMN_TYPE[12,-1,0] ¦ COLUMN_KEY[12,-1,0] ¦ EXTRA[12,-1,0] ¦ PRIVILEGES[12,-1,0] ¦ COLUMN_COMMENT[12,-1,0] ¦ GENERATION_EXPRESSION[12,-1,0] ¦ SRS_ID[-5,64,0] 𝄀 +def ¦ mo_catalog ¦ mo_tables ¦ rel_id ¦ 1 ¦ null ¦ YES ¦ BIGINT UNSIGNED ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ BIGINT UNSIGNED(0) ¦ ¦ ¦ select,insert,update,references ¦ ¦ ¦ null 𝄀 +def ¦ mo_catalog ¦ mo_tables ¦ relname ¦ 2 ¦ null ¦ YES ¦ VARCHAR ¦ 5000 ¦ 120000 ¦ null ¦ null ¦ null ¦ utf8 ¦ utf8_bin ¦ VARCHAR(5000) ¦ ¦ ¦ select,insert,update,references ¦ ¦ ¦ null SELECT * FROM `information_schema`.`key_column_usage` LIMIT 0,1000; -constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name ordinal_position position_in_unique_constraint referenced_table_schema referenced_table_name referenced_column_name +➤ CONSTRAINT_CATALOG[12,-1,0] ¦ CONSTRAINT_SCHEMA[12,-1,0] ¦ CONSTRAINT_NAME[12,-1,0] ¦ TABLE_CATALOG[12,-1,0] ¦ TABLE_SCHEMA[12,-1,0] ¦ TABLE_NAME[12,-1,0] ¦ COLUMN_NAME[12,-1,0] ¦ ORDINAL_POSITION[4,32,0] ¦ POSITION_IN_UNIQUE_CONSTRAINT[4,32,0] ¦ REFERENCED_TABLE_SCHEMA[12,-1,0] ¦ REFERENCED_TABLE_NAME[12,-1,0] ¦ REFERENCED_COLUMN_NAME[12,-1,0] SELECT * FROM `information_schema`.`profiling` LIMIT 0,1000; -query_id seq state duration cpu_user cpu_system context_voluntary context_involuntary block_ops_in block_ops_out messages_sent messages_received page_faults_major page_faults_minor swaps source_function source_file source_line +➤ query_id[4,32,0] ¦ seq[4,32,0] ¦ state[12,-1,0] ¦ duration[3,9,6] ¦ cpu_user[3,9,6] ¦ cpu_system[3,9,6] ¦ context_voluntary[4,32,0] ¦ context_involuntary[4,32,0] ¦ block_ops_in[4,32,0] ¦ block_ops_out[4,32,0] ¦ messages_sent[4,32,0] ¦ messages_received[4,32,0] ¦ page_faults_major[4,32,0] ¦ page_faults_minor[4,32,0] ¦ swaps[4,32,0] ¦ source_function[12,-1,0] ¦ source_file[12,-1,0] ¦ source_line[4,32,0] SELECT * FROM `information_schema`.`schemata` where schema_name = 'information_schema'; -catalog_name schema_name default_character_set_name default_collation_name sql_path default_encryption -def information_schema utf8mb4 utf8mb4_0900_ai_ci null NO +➤ CATALOG_NAME[12,-1,0] ¦ SCHEMA_NAME[12,-1,0] ¦ DEFAULT_CHARACTER_SET_NAME[12,-1,0] ¦ DEFAULT_COLLATION_NAME[12,-1,0] ¦ SQL_PATH[1,0,0] ¦ DEFAULT_ENCRYPTION[12,-1,0] 𝄀 +def ¦ information_schema ¦ utf8mb4 ¦ utf8mb4_0900_ai_ci ¦ null ¦ NO SELECT * FROM `information_schema`.`triggers` LIMIT 0,1000; -trigger_catalog trigger_schema trigger_name event_manipulation event_object_catalog event_object_schema event_object_table action_order action_condition action_statement action_orientation action_timing action_reference_old_table action_reference_new_table action_reference_old_row action_reference_new_row created sql_mode definer character_set_client collation_connection database_collation +➤ trigger_catalog[12,-1,0] ¦ trigger_schema[12,-1,0] ¦ trigger_name[12,-1,0] ¦ event_manipulation[12,-1,0] ¦ event_object_catalog[12,-1,0] ¦ event_object_schema[12,-1,0] ¦ event_object_table[12,-1,0] ¦ action_order[4,32,0] ¦ action_condition[12,0,0] ¦ action_statement[12,0,0] ¦ action_orientation[12,-1,0] ¦ action_timing[12,-1,0] ¦ action_reference_old_table[12,0,0] ¦ action_reference_new_table[12,0,0] ¦ action_reference_old_row[12,-1,0] ¦ action_reference_new_row[12,-1,0] ¦ created[93,64,0] ¦ sql_mode[12,-1,0] ¦ definer[12,-1,0] ¦ character_set_client[12,-1,0] ¦ collation_connection[12,-1,0] ¦ database_collation[12,-1,0] SELECT * FROM `information_schema`.`user_privileges` LIMIT 0,1000; -grantee table_catalog privilege_type is_grantable +➤ grantee[12,-1,0] ¦ table_catalog[12,-1,0] ¦ privilege_type[12,-1,0] ¦ is_grantable[12,-1,0] SELECT TABLE_SCHEMA AS TABLE_CAT, NULL AS TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, NULL AS INDEX_QUALIFIER, INDEX_NAME,3 AS TYPE, SEQ_IN_INDEX AS ORDINAL_POSITION, COLUMN_NAME,COLLATION AS ASC_OR_DESC, CARDINALITY, 0 AS PAGES, NULL AS FILTER_CONDITION FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'procs_priv' ORDER BY NON_UNIQUE, INDEX_NAME, SEQ_IN_INDEX limit 1; -TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION -mysql null procs_priv 0 null PRIMARY 3 1 Host A 0 0 null +➤ TABLE_CAT[12,-1,0] ¦ TABLE_SCHEM[12,4,0] ¦ TABLE_NAME[12,-1,0] ¦ NON_UNIQUE[-5,64,0] ¦ INDEX_QUALIFIER[12,4,0] ¦ INDEX_NAME[12,-1,0] ¦ TYPE[-5,64,0] ¦ ORDINAL_POSITION[4,32,0] ¦ COLUMN_NAME[12,-1,0] ¦ ASC_OR_DESC[12,-1,0] ¦ CARDINALITY[-5,64,0] ¦ PAGES[-5,64,0] ¦ FILTER_CONDITION[12,4,0] 𝄀 +mysql ¦ null ¦ procs_priv ¦ 0 ¦ null ¦ PRIMARY ¦ 3 ¦ 1 ¦ Host ¦ A ¦ 0 ¦ 0 ¦ null SELECT * FROM `mysql`.`columns_priv` LIMIT 0,1000; -host db user table_name column_name timestamp column_priv +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ table_name[1,64,0] ¦ column_name[1,64,0] ¦ timestamp[93,64,0] ¦ column_priv[12,-1,0] SELECT * FROM `mysql`.`db` LIMIT 0,1000; -host db user select_priv insert_priv update_priv delete_priv create_priv drop_priv grant_priv references_priv index_priv alter_priv create_tmp_table_priv lock_tables_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv execute_priv event_priv trigger_priv +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ select_priv[12,-1,0] ¦ insert_priv[12,-1,0] ¦ update_priv[12,-1,0] ¦ delete_priv[12,-1,0] ¦ create_priv[12,-1,0] ¦ drop_priv[12,-1,0] ¦ grant_priv[12,-1,0] ¦ references_priv[12,-1,0] ¦ index_priv[12,-1,0] ¦ alter_priv[12,-1,0] ¦ create_tmp_table_priv[12,-1,0] ¦ lock_tables_priv[12,-1,0] ¦ create_view_priv[12,-1,0] ¦ show_view_priv[12,-1,0] ¦ create_routine_priv[12,-1,0] ¦ alter_routine_priv[12,-1,0] ¦ execute_priv[12,-1,0] ¦ event_priv[12,-1,0] ¦ trigger_priv[12,-1,0] SELECT * FROM `mysql`.`procs_priv` LIMIT 0,1000; -host db user routine_name routine_type grantor proc_priv timestamp +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ routine_name[1,64,0] ¦ routine_type[12,-1,0] ¦ grantor[12,-1,0] ¦ proc_priv[12,-1,0] ¦ timestamp[93,64,0] SELECT * FROM `mysql`.`tables_priv` LIMIT 0,1000; -host db user table_name grantor timestamp table_priv column_priv +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ table_name[1,64,0] ¦ grantor[12,-1,0] ¦ timestamp[93,64,0] ¦ table_priv[12,-1,0] ¦ column_priv[12,-1,0] SELECT * FROM `mysql`.`user` LIMIT 0,1000; -host user select_priv insert_priv update_priv delete_priv create_priv drop_priv reload_priv shutdown_priv process_priv file_priv grant_priv references_priv index_priv alter_priv show_db_priv super_priv create_tmp_table_priv lock_tables_priv execute_priv repl_slave_priv repl_client_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv create_user_priv event_priv trigger_priv create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired password_last_changed password_lifetime account_locked create_role_priv drop_role_priv password_reuse_history password_reuse_time password_require_current user_attributes +➤ host[1,255,0] ¦ user[1,32,0] ¦ select_priv[12,-1,0] ¦ insert_priv[12,-1,0] ¦ update_priv[12,-1,0] ¦ delete_priv[12,-1,0] ¦ create_priv[12,-1,0] ¦ drop_priv[12,-1,0] ¦ reload_priv[12,-1,0] ¦ shutdown_priv[12,-1,0] ¦ process_priv[12,-1,0] ¦ file_priv[12,-1,0] ¦ grant_priv[12,-1,0] ¦ references_priv[12,-1,0] ¦ index_priv[12,-1,0] ¦ alter_priv[12,-1,0] ¦ show_db_priv[12,-1,0] ¦ super_priv[12,-1,0] ¦ create_tmp_table_priv[12,-1,0] ¦ lock_tables_priv[12,-1,0] ¦ execute_priv[12,-1,0] ¦ repl_slave_priv[12,-1,0] ¦ repl_client_priv[12,-1,0] ¦ create_view_priv[12,-1,0] ¦ show_view_priv[12,-1,0] ¦ create_routine_priv[12,-1,0] ¦ alter_routine_priv[12,-1,0] ¦ create_user_priv[12,-1,0] ¦ event_priv[12,-1,0] ¦ trigger_priv[12,-1,0] ¦ create_tablespace_priv[12,-1,0] ¦ ssl_type[12,-1,0] ¦ ssl_cipher[12,0,0] ¦ x509_issuer[12,0,0] ¦ x509_subject[12,0,0] ¦ max_questions[4,32,0] ¦ max_updates[4,32,0] ¦ max_connections[4,32,0] ¦ max_user_connections[4,32,0] ¦ plugin[1,64,0] ¦ authentication_string[12,0,0] ¦ password_expired[12,-1,0] ¦ password_last_changed[93,64,0] ¦ password_lifetime[5,16,0] ¦ account_locked[12,-1,0] ¦ create_role_priv[12,-1,0] ¦ drop_role_priv[12,-1,0] ¦ password_reuse_history[5,16,0] ¦ password_reuse_time[5,16,0] ¦ password_require_current[12,-1,0] ¦ user_attributes[-1,2147483647,0] use mysql; show tables; -Tables_in_mysql -columns_priv -db -procs_priv -role_edges -tables_priv +➤ Tables_in_mysql[12,-1,0] 𝄀 +columns_priv 𝄀 +db 𝄀 +procs_priv 𝄀 +role_edges 𝄀 +tables_priv 𝄀 user show columns from `db`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Select_priv VARCHAR(10) NO N -Insert_priv VARCHAR(10) NO N -Update_priv VARCHAR(10) NO N -Delete_priv VARCHAR(10) NO N -Create_priv VARCHAR(10) NO N -Drop_priv VARCHAR(10) NO N -Grant_priv VARCHAR(10) NO N -References_priv VARCHAR(10) NO N -Index_priv VARCHAR(10) NO N -Alter_priv VARCHAR(10) NO N -Create_tmp_table_priv VARCHAR(10) NO N -Lock_tables_priv VARCHAR(10) NO N -Create_view_priv VARCHAR(10) NO N -Show_view_priv VARCHAR(10) NO N -Create_routine_priv VARCHAR(10) NO N -Alter_routine_priv VARCHAR(10) NO N -Execute_priv VARCHAR(10) NO N -Event_priv VARCHAR(10) NO N -Trigger_priv VARCHAR(10) NO N +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Select_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Insert_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Update_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Delete_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Drop_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Grant_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +References_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Index_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_tmp_table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Lock_tables_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Show_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Execute_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Event_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Trigger_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ show columns from `procs_priv`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Routine_name CHAR(64) NO PRI -Routine_type VARCHAR(10) NO PRI null -Grantor VARCHAR(288) NO MUL -Proc_priv VARCHAR(10) NO -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_type ¦ VARCHAR(10) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Proc_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ show columns from `columns_priv`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Column_name CHAR(64) NO PRI -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Column_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ show columns from `tables_priv`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Grantor VARCHAR(288) NO MUL -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Table_priv VARCHAR(10) NO -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ use information_schema; show tables; -Tables_in_information_schema -character_sets -collations -column_privileges -columns -engines -events -files -key_column_usage -keywords -parameters -partitions -processlist -profiling -referential_constraints -routines -schema_privileges -schemata -statistics -table_constraints -table_privileges -tables -triggers -user_privileges +➤ Tables_in_information_schema[12,-1,0] 𝄀 +character_sets 𝄀 +collations 𝄀 +column_privileges 𝄀 +columns 𝄀 +engines 𝄀 +events 𝄀 +files 𝄀 +key_column_usage 𝄀 +keywords 𝄀 +parameters 𝄀 +partitions 𝄀 +processlist 𝄀 +profiling 𝄀 +referential_constraints 𝄀 +routines 𝄀 +schema_privileges 𝄀 +schemata 𝄀 +statistics 𝄀 +table_constraints 𝄀 +table_privileges 𝄀 +tables 𝄀 +triggers 𝄀 +user_privileges 𝄀 views show columns from `KEY_COLUMN_USAGE`; -Field Type Null Key Default Extra Comment -CONSTRAINT_CATALOG VARCHAR(64) YES null -CONSTRAINT_SCHEMA VARCHAR(64) YES null -CONSTRAINT_NAME VARCHAR(64) YES null -TABLE_CATALOG VARCHAR(64) YES null -TABLE_SCHEMA VARCHAR(64) YES null -TABLE_NAME VARCHAR(64) YES null -COLUMN_NAME VARCHAR(64) YES null -ORDINAL_POSITION INT UNSIGNED(32) YES null -POSITION_IN_UNIQUE_CONSTRAINT INT UNSIGNED(32) YES null -REFERENCED_TABLE_SCHEMA VARCHAR(64) YES null -REFERENCED_TABLE_NAME VARCHAR(64) YES null -REFERENCED_COLUMN_NAME VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ show columns from `COLUMNS`; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(256) YES null -table_name VARCHAR(256) YES null -column_name VARCHAR(256) YES null -ordinal_position INT(0) YES null -column_default VARCHAR(65535) YES null -is_nullable VARCHAR(3) YES null -data_type VARCHAR(65535) YES null -character_maximum_length BIGINT(0) YES null -character_octet_length BIGINT(0) YES null -numeric_precision BIGINT(0) YES null -numeric_scale BIGINT(0) YES null -datetime_precision BIGINT(0) YES null -character_set_name VARCHAR(4) YES null -collation_name VARCHAR(8) YES null -column_type VARCHAR(65535) YES null -column_key VARCHAR(3) YES null -extra VARCHAR(24) YES null -privileges VARCHAR(31) NO null -column_comment VARCHAR(2048) YES null -generation_expression VARCHAR(500) YES null -srs_id BIGINT(0) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_default ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +is_nullable ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_maximum_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_octet_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_scale ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +datetime_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_set_name ¦ VARCHAR(4) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +collation_name ¦ VARCHAR(8) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_key ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +extra ¦ VARCHAR(24) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +privileges ¦ VARCHAR(31) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_comment ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +generation_expression ¦ VARCHAR(500) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +srs_id ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ show columns from `PROFILING`; -Field Type Null Key Default Extra Comment -QUERY_ID INT(32) NO 0 -SEQ INT(32) NO 0 -STATE VARCHAR(30) NO -DURATION DECIMAL(9,6) NO 0.000000 -CPU_USER DECIMAL(9,6) YES null -CPU_SYSTEM DECIMAL(9,6) YES null -CONTEXT_VOLUNTARY INT(32) YES null -CONTEXT_INVOLUNTARY INT(32) YES null -BLOCK_OPS_IN INT(32) YES null -BLOCK_OPS_OUT INT(32) YES null -MESSAGES_SENT INT(32) YES null -MESSAGES_RECEIVED INT(32) YES null -PAGE_FAULTS_MAJOR INT(32) YES null -PAGE_FAULTS_MINOR INT(32) YES null -SWAPS INT(32) YES null -SOURCE_FUNCTION VARCHAR(30) YES null -SOURCE_FILE VARCHAR(20) YES null -SOURCE_LINE INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +QUERY_ID ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +SEQ ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +STATE ¦ VARCHAR(30) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +DURATION ¦ DECIMAL(9,6) ¦ NO ¦ ¦ 0.000000 ¦ ¦ 𝄀 +CPU_USER ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CPU_SYSTEM ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_VOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_INVOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_IN ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_OUT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_SENT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_RECEIVED ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MAJOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MINOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SWAPS ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FUNCTION ¦ VARCHAR(30) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FILE ¦ VARCHAR(20) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_LINE ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ show columns from `USER_PRIVILEGES`; -Field Type Null Key Default Extra Comment -GRANTEE VARCHAR(292) NO -TABLE_CATALOG VARCHAR(512) NO -PRIVILEGE_TYPE VARCHAR(64) NO -IS_GRANTABLE VARCHAR(3) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +GRANTEE ¦ VARCHAR(292) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +TABLE_CATALOG ¦ VARCHAR(512) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +PRIVILEGE_TYPE ¦ VARCHAR(64) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +IS_GRANTABLE ¦ VARCHAR(3) ¦ NO ¦ ¦ ¦ ¦ show columns from `SCHEMATA`; -Field Type Null Key Default Extra Comment -catalog_name VARCHAR(3) NO null -schema_name VARCHAR(5000) YES null -default_character_set_name VARCHAR(7) NO null -default_collation_name VARCHAR(18) NO null -sql_path CHAR(0) YES null -default_encryption VARCHAR(3) NO null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +catalog_name ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +schema_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_character_set_name ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +default_collation_name ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +sql_path ¦ CHAR(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_encryption ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ show columns from `CHARACTER_SETS`; -Field Type Null Key Default Extra Comment -CHARACTER_SET_NAME VARCHAR(64) YES null -DEFAULT_COLLATE_NAME VARCHAR(64) YES null -DESCRIPTION VARCHAR(2048) YES null -MAXLEN INT UNSIGNED(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +CHARACTER_SET_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFAULT_COLLATE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DESCRIPTION ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MAXLEN ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ show columns from `TRIGGERS`; -Field Type Null Key Default Extra Comment -TRIGGER_CATALOG VARCHAR(64) YES null -TRIGGER_SCHEMA VARCHAR(64) YES null -TRIGGER_NAME VARCHAR(64) YES null -EVENT_MANIPULATION VARCHAR(10) YES null -EVENT_OBJECT_CATALOG VARCHAR(64) YES null -EVENT_OBJECT_SCHEMA VARCHAR(64) YES null -EVENT_OBJECT_TABLE VARCHAR(64) YES null -ACTION_ORDER INT UNSIGNED(32) YES null -ACTION_CONDITION BINARY(0) YES null -ACTION_STATEMENT TEXT(0) YES null -ACTION_ORIENTATION VARCHAR(3) YES null -ACTION_TIMING VARCHAR(10) YES null -ACTION_REFERENCE_OLD_TABLE BINARY(0) YES null -ACTION_REFERENCE_NEW_TABLE BINARY(0) YES null -ACTION_REFERENCE_OLD_ROW VARCHAR(3) YES null -ACTION_REFERENCE_NEW_ROW VARCHAR(3) YES null -CREATED TIMESTAMP(2) YES null -SQL_MODE VARCHAR(10) YES null -DEFINER VARCHAR(288) YES null -CHARACTER_SET_CLIENT VARCHAR(64) YES null -COLLATION_CONNECTION VARCHAR(64) YES null -DATABASE_COLLATION VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +TRIGGER_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_MANIPULATION ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_TABLE ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORDER ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_CONDITION ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_STATEMENT ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORIENTATION ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_TIMING ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CREATED ¦ TIMESTAMP(2) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SQL_MODE ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFINER ¦ VARCHAR(288) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CHARACTER_SET_CLIENT ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +COLLATION_CONNECTION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DATABASE_COLLATION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ show columns from `TABLES`; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(5000) YES null -table_name VARCHAR(5000) YES null -table_type VARCHAR(14) YES null -engine VARCHAR(3) YES null -version BIGINT(0) YES null -row_format VARCHAR(10) NO null -table_rows BIGINT(0) YES null -avg_row_length BIGINT(0) YES null -data_length BIGINT(0) YES null -max_data_length BIGINT(0) YES null -index_length BIGINT(0) YES null -data_free BIGINT(0) YES null -auto_increment BIGINT UNSIGNED(0) YES null -create_time TIMESTAMP(0) YES null -update_time TIMESTAMP(0) YES null -check_time TIMESTAMP(0) YES null -table_collation VARCHAR(18) NO null -checksum BIGINT(0) YES null -create_options VARCHAR(256) YES null -table_comment TEXT(0) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_type ¦ VARCHAR(14) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +engine ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +version ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +row_format ¦ VARCHAR(10) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_rows ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +avg_row_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +max_data_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +index_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_free ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +auto_increment ¦ BIGINT UNSIGNED(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +create_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +update_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +check_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_collation ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +checksum ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +create_options ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_comment ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ show columns from `PARTITIONS`; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(5000) YES null -table_name VARCHAR(5000) YES null -partition_name VARCHAR(64) YES null -subpartition_name TEXT(4) YES null -partition_ordinal_position SMALLINT UNSIGNED(16) YES null -subpartition_ordinal_position TEXT(4) YES null -partition_method VARCHAR(13) YES null -subpartition_method TEXT(4) YES null -partition_expression VARCHAR(2048) YES null -subpartition_expression TEXT(4) YES null -partition_description TEXT(0) YES null -table_rows BIGINT(0) YES null -avg_row_length BIGINT(0) NO null -data_length BIGINT(0) YES null -max_data_length BIGINT(0) NO null -index_length BIGINT(0) NO null -data_free BIGINT(0) NO null -create_time TIMESTAMP(0) YES null -update_time TEXT(4) YES null -check_time TEXT(4) YES null -checksum TEXT(4) YES null -partition_comment VARCHAR(2048) NO null -nodegroup VARCHAR(7) NO null -tablespace_name TEXT(4) YES null +[unknown result because it is related to issue#16438] use mo_catalog; show columns from `mo_data_key`; -Field Type Null Key Default Extra Comment -account_id BIGINT UNSIGNED(64) NO PRI null -key_id UUID(0) NO PRI null -encrypted_key VARCHAR(128) YES null -create_time TIMESTAMP(0) NO current_timestamp() -update_time TIMESTAMP(0) NO current_timestamp() +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +account_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +key_id ¦ UUID(0) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +encrypted_key ¦ VARCHAR(128) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +create_time ¦ TIMESTAMP(0) ¦ NO ¦ ¦ current_timestamp() ¦ ¦ 𝄀 +update_time ¦ TIMESTAMP(0) ¦ NO ¦ ¦ current_timestamp() ¦ ¦ drop database if exists test; create database test; use test; drop table if exists t2; create table t2(b int, a int); desc t2; -Field Type Null Key Default Extra Comment -b INT(32) YES null -a INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +b ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +a ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ drop table t2; drop database test; diff --git a/test/distributed/cases/git4data/clone/clone_fk_after_alter.result b/test/distributed/cases/git4data/clone/clone_fk_after_alter.result index 247f29fc460ae..8598f192443e3 100644 --- a/test/distributed/cases/git4data/clone/clone_fk_after_alter.result +++ b/test/distributed/cases/git4data/clone/clone_fk_after_alter.result @@ -25,25 +25,31 @@ select table_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_alter_child_src' order by constraint_name; -table_name refer_table_name -child parent +➤ table_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ parent delete from fk_clone_alter_child_src.parent where id = 1; internal error: Cannot delete or update a parent row: a foreign key constraint fails create database fk_clone_alter_child_dst clone fk_clone_alter_child_src; select * from fk_clone_alter_child_dst.child order by id; -id parent_id payload -10 1 c1 -20 2 c2 +➤ id[4,32,0] ¦ parent_id[4,32,0] ¦ payload[12,-1,0] 𝄀 +10 ¦ 1 ¦ c1 𝄀 +20 ¦ 2 ¦ c2 show create table fk_clone_alter_child_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` varchar(64) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_child_parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_child_parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) delete from fk_clone_alter_child_dst.parent where id = 1; internal error: Cannot delete or update a parent row: a foreign key constraint fails insert into fk_clone_alter_child_dst.child values (30, 999, 'invalid'); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_clone_alter_child_dst.child values (30, 1, 'valid'); select count(*) from fk_clone_alter_child_dst.child; -count(*) +➤ count(*)[-5,64,0] 𝄀 3 drop database fk_clone_alter_child_dst; drop database fk_clone_alter_child_src; @@ -68,15 +74,27 @@ alter table fk_clone_alter_both_src.parent modify column description varchar(128 alter table fk_clone_alter_both_src.child add column created_at datetime; create database fk_clone_alter_both_dst clone fk_clone_alter_both_src; show create table fk_clone_alter_both_dst.parent; -Table Create Table -parent CREATE TABLE `parent` (\n `id` int NOT NULL,\n `code` varchar(16) DEFAULT NULL,\n `description` varchar(128) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `code` (`code`)\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +parent ¦ CREATE TABLE `parent` ( + `id` int NOT NULL, + `code` varchar(16) DEFAULT NULL, + `description` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) show create table fk_clone_alter_both_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `created_at` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_both` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_both` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_alter_both_dst.child(id, parent_id) values (2, 404); internal error: Cannot add or update a child row: a foreign key constraint fails select count(*) from fk_clone_alter_both_dst.child; -count(*) +➤ count(*)[-5,64,0] 𝄀 1 drop database fk_clone_alter_both_dst; drop database fk_clone_alter_both_src; @@ -102,11 +120,24 @@ alter table fk_clone_siblings_src.child_b add column b1 int default 2; alter table fk_clone_siblings_src.child_a add column a2 int default 3; create database fk_clone_siblings_dst clone fk_clone_siblings_src; show create table fk_clone_siblings_dst.child_a; -Table Create Table -child_a CREATE TABLE `child_a` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `a1` int DEFAULT 1,\n `a2` int DEFAULT 3,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_sibling_a` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child_a ¦ CREATE TABLE `child_a` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `a1` int DEFAULT 1, + `a2` int DEFAULT 3, + PRIMARY KEY (`id`), + CONSTRAINT `fk_sibling_a` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) show create table fk_clone_siblings_dst.child_b; -Table Create Table -child_b CREATE TABLE `child_b` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `b1` int DEFAULT 2,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_sibling_b` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child_b ¦ CREATE TABLE `child_b` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `b1` int DEFAULT 2, + PRIMARY KEY (`id`), + CONSTRAINT `fk_sibling_b` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_siblings_dst.child_a values (1, 100, 1, 3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_clone_siblings_dst.child_b values (1, 100, 2); @@ -141,8 +172,8 @@ select leaf.id, middle.id, root.id from fk_clone_chain_dst.leaf leaf join fk_clone_chain_dst.middle middle on leaf.middle_id = middle.id join fk_clone_chain_dst.root root on middle.root_id = root.id; -id id id -1 1 1 +➤ id[4,32,0] ¦ id[4,32,0] ¦ id[4,32,0] 𝄀 +1 ¦ 1 ¦ 1 insert into fk_clone_chain_dst.leaf(id, middle_id) values (2, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_chain_dst; @@ -169,8 +200,15 @@ alter table fk_clone_composite_src.child add column payload varchar(32); alter table fk_clone_composite_src.child modify column payload varchar(64); create database fk_clone_composite_dst clone fk_clone_composite_src; show create table fk_clone_composite_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `tenant_id` int DEFAULT NULL,\n `object_id` int DEFAULT NULL,\n `payload` varchar(64) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_composite` FOREIGN KEY (`tenant_id`,`object_id`) REFERENCES `parent` (`tenant_id`,`object_id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `tenant_id` int DEFAULT NULL, + `object_id` int DEFAULT NULL, + `payload` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_composite` FOREIGN KEY (`tenant_id`,`object_id`) REFERENCES `parent` (`tenant_id`,`object_id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_composite_dst.child(id, tenant_id, object_id) values (2, 1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_composite_dst; @@ -194,8 +232,17 @@ alter table fk_clone_multi_parent_src.child add column payload int default 0; alter table fk_clone_multi_parent_src.child add column note varchar(32); create database fk_clone_multi_parent_dst clone fk_clone_multi_parent_src; show create table fk_clone_multi_parent_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_a_id` int DEFAULT NULL,\n `parent_b_id` int DEFAULT NULL,\n `payload` int DEFAULT 0,\n `note` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_multi_a` FOREIGN KEY (`parent_a_id`) REFERENCES `parent_a` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,\n CONSTRAINT `fk_multi_b` FOREIGN KEY (`parent_b_id`) REFERENCES `parent_b` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_a_id` int DEFAULT NULL, + `parent_b_id` int DEFAULT NULL, + `payload` int DEFAULT 0, + `note` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_multi_a` FOREIGN KEY (`parent_a_id`) REFERENCES `parent_a` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `fk_multi_b` FOREIGN KEY (`parent_b_id`) REFERENCES `parent_b` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_multi_parent_dst.child(id, parent_a_id, parent_b_id) values (1, 1, 1); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_multi_parent_dst; @@ -215,12 +262,19 @@ alter table fk_clone_self_src.node add column label varchar(32); alter table fk_clone_self_src.node add index idx_label(label); create database fk_clone_self_dst clone fk_clone_self_src; select id, parent_id from fk_clone_self_dst.node order by id; -id parent_id -1 null -2 1 +➤ id[4,32,0] ¦ parent_id[4,32,0] 𝄀 +1 ¦ null 𝄀 +2 ¦ 1 show create table fk_clone_self_dst.node; -Table Create Table -node CREATE TABLE `node` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `label` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx_label` (`label`),\n CONSTRAINT `fk_node_parent` FOREIGN KEY (`parent_id`) REFERENCES `node` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +node ¦ CREATE TABLE `node` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `label` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx_label` (`label`), + CONSTRAINT `fk_node_parent` FOREIGN KEY (`parent_id`) REFERENCES `node` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_self_dst.node(id, parent_id) values (3, 999); Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_self_dst; @@ -244,8 +298,15 @@ references fk_clone_recreate_fk_src.parent(id); alter table fk_clone_recreate_fk_src.child add column note varchar(32); create database fk_clone_recreate_fk_dst clone fk_clone_recreate_fk_src; show create table fk_clone_recreate_fk_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` varchar(32) DEFAULT NULL,\n `note` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_recreated` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` varchar(32) DEFAULT NULL, + `note` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_recreated` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_recreate_fk_dst.child(id, parent_id) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_recreate_fk_dst; @@ -265,13 +326,19 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_forward_src' order by constraint_name; -table_name constraint_name refer_table_name -child fk_forward parent +➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ fk_forward ¦ parent create table fk_clone_forward_src.parent (id int primary key); set foreign_key_checks = 1; show create table fk_clone_forward_src.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_forward` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_forward` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) insert into fk_clone_forward_src.child values (1, 404, 0); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_forward_src; @@ -292,13 +359,19 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_forward_drop_src' order by constraint_name; -table_name constraint_name refer_table_name -child fk_forward_drop parent +➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ fk_forward_drop ¦ parent create table fk_clone_forward_drop_src.parent (id int primary key); set foreign_key_checks = 1; show create table fk_clone_forward_drop_src.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_forward_drop` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_forward_drop` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) insert into fk_clone_forward_drop_src.child values (1, 404, 0); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_forward_drop_src; @@ -322,9 +395,9 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_self_external_src' order by table_name, constraint_name; -table_name constraint_name refer_table_name -child fk_self_external_child parent -parent fk_self_external_self parent +➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ fk_self_external_child ¦ parent 𝄀 +parent ¦ fk_self_external_self ¦ parent drop table fk_clone_self_external_src.child; drop table fk_clone_self_external_src.parent; drop database fk_clone_self_external_src; @@ -347,12 +420,17 @@ select table_name, column_name, refer_table_name, refer_column_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_rename_columns_src' order by constraint_name; -table_name column_name refer_table_name refer_column_name -child parent_id parent id +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ refer_table_name[12,-1,0] ¦ refer_column_name[12,-1,0] 𝄀 +child ¦ parent_id ¦ parent ¦ id create database fk_clone_rename_columns_dst clone fk_clone_rename_columns_src; show create table fk_clone_rename_columns_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_rename_columns` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_rename_columns` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_rename_columns_dst.child values (1, 404); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_rename_columns_dst; @@ -379,11 +457,17 @@ insert into fk_clone_snapshot_src.child(id, parent_id) values (2, 2); create database fk_clone_snapshot_dst clone fk_clone_snapshot_src {snapshot = 'fk_clone_alter_snapshot'}; show create table fk_clone_snapshot_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `before_snapshot` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_snapshot` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `before_snapshot` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_snapshot` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) select id, parent_id from fk_clone_snapshot_dst.child order by id; -id parent_id -1 1 +➤ id[4,32,0] ¦ parent_id[4,32,0] 𝄀 +1 ¦ 1 insert into fk_clone_snapshot_dst.child(id, parent_id) values (3, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_snapshot_dst; @@ -407,8 +491,15 @@ use fk_clone_chain_clone_mid; alter table fk_clone_chain_clone_mid.child add column middle_value int; create database fk_clone_chain_clone_dst clone fk_clone_chain_clone_mid; show create table fk_clone_chain_clone_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `source_value` int DEFAULT NULL,\n `middle_value` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_clone_chain` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `source_value` int DEFAULT NULL, + `middle_value` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_clone_chain` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_chain_clone_dst.child(id, parent_id) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_chain_clone_dst; @@ -432,8 +523,14 @@ rename table fk_clone_rename_src.child to fk_clone_rename_src.renamed_child; alter table fk_clone_rename_src.renamed_child add column payload varchar(32); create database fk_clone_rename_dst clone fk_clone_rename_src; show create table fk_clone_rename_dst.renamed_child; -Table Create Table -renamed_child CREATE TABLE `renamed_child` (\n `id` int NOT NULL,\n `parent_key` int DEFAULT NULL,\n `payload` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_rename` FOREIGN KEY (`parent_key`) REFERENCES `renamed_parent` (`parent_key`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +renamed_child ¦ CREATE TABLE `renamed_child` ( + `id` int NOT NULL, + `parent_key` int DEFAULT NULL, + `payload` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_rename` FOREIGN KEY (`parent_key`) REFERENCES `renamed_parent` (`parent_key`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_rename_dst.renamed_child(id, parent_key) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_rename_dst; diff --git a/test/distributed/cases/mo_cloud/mo_cloud.result b/test/distributed/cases/mo_cloud/mo_cloud.result index 80c6e908821ba..4da9e604fc0a2 100644 --- a/test/distributed/cases/mo_cloud/mo_cloud.result +++ b/test/distributed/cases/mo_cloud/mo_cloud.result @@ -49,18 +49,18 @@ XA ¦ VARCHAR(3) ¦ null ¦ null 𝄀 SAVEPOINTS ¦ VARCHAR(3) ¦ null ¦ null SELECT attname AS name, mo_show_visible_bin(atttyp,3) AS data_type, replace(mo_table_col_max(att_database,att_relname,attname),'\\0', '') AS `maximum`, mo_table_col_min(att_database,att_relname,attname) as minimum from mo_catalog.mo_columns where att_database='information_schema' and att_relname='key_column_usage' and attname NOT IN ('__mo_rowid', '__mo_cpkey_col', '__mo_fake_pk_col') ORDER BY attnum; ➤ name[12,-1,0] ¦ data_type[12,-1,0] ¦ maximum[12,-1,0] ¦ minimum[12,-1,0] 𝄀 -CONSTRAINT_CATALOG ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -CONSTRAINT_SCHEMA ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -CONSTRAINT_NAME ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -TABLE_CATALOG ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -TABLE_SCHEMA ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -TABLE_NAME ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -COLUMN_NAME ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -ORDINAL_POSITION ¦ INT UNSIGNED(32) ¦ null ¦ null 𝄀 -POSITION_IN_UNIQUE_CONSTRAINT ¦ INT UNSIGNED(32) ¦ null ¦ null 𝄀 -REFERENCED_TABLE_SCHEMA ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -REFERENCED_TABLE_NAME ¦ VARCHAR(64) ¦ null ¦ null 𝄀 -REFERENCED_COLUMN_NAME ¦ VARCHAR(64) ¦ null ¦ null +constraint_catalog ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +constraint_name ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +table_catalog ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +table_schema ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +table_name ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +column_name ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ null ¦ null 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ null ¦ null 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ null ¦ null 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ null ¦ null SELECT attname AS name, mo_show_visible_bin(atttyp,3) AS data_type, replace(mo_table_col_max(att_database,att_relname,attname),'\\0', '') AS `maximum`, mo_table_col_min(att_database,att_relname,attname) as minimum from mo_catalog.mo_columns where att_database='information_schema' and att_relname='keywords' and attname NOT IN ('__mo_rowid', '__mo_cpkey_col', '__mo_fake_pk_col') ORDER BY attnum; ➤ name[12,-1,0] ¦ data_type[12,-1,0] ¦ maximum[12,-1,0] ¦ minimum[12,-1,0] 𝄀 WORD ¦ VARCHAR(64) ¦ null ¦ null 𝄀 @@ -207,7 +207,7 @@ account_id ¦ INT UNSIGNED(32) ¦ null ¦ null 𝄀 type ¦ VARCHAR(1024) ¦ null ¦ null 𝄀 __mo_cbkey_011collecttime010account_id011metric_name ¦ VARCHAR(65535) ¦ null ¦ null SELECT concat(DATE_FORMAT(date_add(`request_at`,Interval 1 MINUTE),'%Y-%m-%d %H'),':',LPAD(CAST(1 * floor(minute(date_add(`request_at`,Interval 1 MINUTE)) / 1) as int),2,0),':00') AS stat_ts, AVG(duration) AS value, `query_type` AS type FROM `system`.`statement_info` WHERE request_at >= '2023-07-28 04:20:43' AND request_at <= '2023-07-28 04:50:43' AND `query_type` in ('DQL','DDL','DML','DCL','TCL','Other') GROUP BY `query_type`, concat(DATE_FORMAT(date_add(`request_at`,Interval 1 MINUTE),'%Y-%m-%d %H'),':',LPAD(CAST(1 * floor(minute(date_add(`request_at`,Interval 1 MINUTE)) / 1) as int),2,0),':00') ORDER BY concat(DATE_FORMAT(date_add(`request_at`,Interval 1 MINUTE),'%Y-%m-%d %H'),':',LPAD(CAST(1 * floor(minute(date_add(`request_at`,Interval 1 MINUTE)) / 1) as int),2,0),':00')LIMIT 100; -➤ stat_ts[12,-1,0] ¦ value[8,54,0] ¦ type[12,-1,0] +➤ stat_ts[12,-1,0] ¦ value[3,38,4] ¦ type[12,-1,0] SELECT count(*) FROM (select `statement`,system.statement_info.statement_id,IF(`status`='Running', TIMESTAMPDIFF(MICROSECOND,`request_at`,now())*1000, `duration`) AS `duration`,`status`,`query_type`,`request_at`,system.statement_info.response_at,`user`,`database`,`transaction_id`,`session_id`,`rows_read`,`bytes_scan`,`result_count` from system.statement_info left join mo_catalog.statement_mo ON system.statement_info.statement_id = mo_catalog.statement_mo.statement_id where 1=1 AND `request_at` >= '2023-07-28 04:09:33' AND system.statement_info.statement_id LIKE '%cd%' AND system.statement_info.account = 'c3daefe4_2197_4192_a10e_d0acc5d9da30' AND `user` IN ('ab') AND `session_id` LIKE '%ef%' AND `duration` > 1000000000 AND `statement` LIKE '%show%' ESCAPE '\\\\' )t; SQL parser error: table "statement_mo" does not exist SELECT count(*) FROM `mo_catalog`.`mo_database`; @@ -227,21 +227,8 @@ engines ¦ CREATE TABLE `engines` ( `SAVEPOINTS` varchar(3) DEFAULT NULL ) SHOW CREATE TABLE information_schema.key_column_usage; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -key_column_usage ¦ CREATE TABLE `key_column_usage` ( - `CONSTRAINT_CATALOG` varchar(64) DEFAULT NULL, - `CONSTRAINT_SCHEMA` varchar(64) DEFAULT NULL, - `CONSTRAINT_NAME` varchar(64) DEFAULT NULL, - `TABLE_CATALOG` varchar(64) DEFAULT NULL, - `TABLE_SCHEMA` varchar(64) DEFAULT NULL, - `TABLE_NAME` varchar(64) DEFAULT NULL, - `COLUMN_NAME` varchar(64) DEFAULT NULL, - `ORDINAL_POSITION` int unsigned DEFAULT NULL, - `POSITION_IN_UNIQUE_CONSTRAINT` int unsigned DEFAULT NULL, - `REFERENCED_TABLE_SCHEMA` varchar(64) DEFAULT NULL, - `REFERENCED_TABLE_NAME` varchar(64) DEFAULT NULL, - `REFERENCED_COLUMN_NAME` varchar(64) DEFAULT NULL -) +➤ View[12,-1,0] ¦ Create View[12,-1,0] ¦ character_set_client[12,-1,0] ¦ collation_connection[12,-1,0] 𝄀 +key_column_usage ¦ CREATE VIEW information_schema.KEY_COLUMN_USAGE AS SELECT CAST('def' AS varchar(64)) AS CONSTRAINT_CATALOG, CAST(fk.db_name AS varchar(64)) AS CONSTRAINT_SCHEMA, CAST(fk.constraint_name AS varchar(64)) AS CONSTRAINT_NAME, CAST('def' AS varchar(64)) AS TABLE_CATALOG, CAST(fk.db_name AS varchar(64)) AS TABLE_SCHEMA, CAST(fk.table_name AS varchar(64)) AS TABLE_NAME, CAST(fk.column_name AS varchar(64)) AS COLUMN_NAME, CAST(fk.constraint_id AS int unsigned) AS ORDINAL_POSITION, CAST(fk.constraint_id AS int unsigned) AS POSITION_IN_UNIQUE_CONSTRAINT, CAST(fk.refer_db_name AS varchar(64)) AS REFERENCED_TABLE_SCHEMA, CAST(fk.refer_table_name AS varchar(64)) AS REFERENCED_TABLE_NAME, CAST(fk.refer_column_name AS varchar(64)) AS REFERENCED_COLUMN_NAME FROM mo_catalog.mo_foreign_keys fk ¦ utf8mb4 ¦ utf8mb4_general_ci SHOW CREATE TABLE information_schema.keywords; ➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 keywords ¦ CREATE TABLE `keywords` ( @@ -512,18 +499,18 @@ XA ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 SAVEPOINTS ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ DESC `information_schema`.`key_column_usage` ; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -CONSTRAINT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CONSTRAINT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CONSTRAINT_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TABLE_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TABLE_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TABLE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -COLUMN_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ORDINAL_POSITION ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -POSITION_IN_UNIQUE_CONSTRAINT ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -REFERENCED_TABLE_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -REFERENCED_TABLE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -REFERENCED_COLUMN_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ +constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ DESC `information_schema`.`keywords` ; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 WORD ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 @@ -784,7 +771,7 @@ SELECT count(*) FROM information_schema.tables WHERE table_schema = '' AND table SELECT datname AS name, IF (table_cnt IS NULL, 0, table_cnt) AS tables, role_name AS owner FROM (SELECT dat_id, datname, mo_database.created_time, IF(role_name IS NULL, '-', role_name) AS role_name FROM mo_catalog.mo_database LEFT JOIN mo_catalog.mo_role ON mo_database.owner = role_id) AS x LEFT JOIN(SELECT count(*) AS table_cnt, reldatabase_id FROM mo_catalog.mo_tables WHERE relkind IN ('r','v','e','cluster') GROUP BY reldatabase_id) AS y ON x.dat_id = y.reldatabase_id order by name; ➤ name[12,-1,0] ¦ tables[-5,64,0] ¦ owner[12,-1,0] 𝄀 information_schema ¦ 24 ¦ accountadmin 𝄀 -mo_catalog ¦ 25 ¦ - 𝄀 +mo_catalog ¦ 33 ¦ - 𝄀 mo_mo ¦ 0 ¦ accountadmin 𝄀 mysql ¦ 6 ¦ accountadmin 𝄀 system ¦ 1 ¦ accountadmin 𝄀 @@ -799,7 +786,7 @@ information_schema ¦ columns ¦ v ¦ accountadmin 𝄀 information_schema ¦ engines ¦ r ¦ accountadmin 𝄀 information_schema ¦ events ¦ r ¦ accountadmin 𝄀 information_schema ¦ files ¦ r ¦ accountadmin 𝄀 -information_schema ¦ key_column_usage ¦ r ¦ accountadmin 𝄀 +information_schema ¦ key_column_usage ¦ v ¦ accountadmin 𝄀 information_schema ¦ keywords ¦ r ¦ accountadmin 𝄀 information_schema ¦ parameters ¦ r ¦ accountadmin 𝄀 information_schema ¦ partitions ¦ v ¦ accountadmin 𝄀 @@ -871,14 +858,15 @@ system_metrics ¦ sql_transaction_total ¦ v ¦ accountadmin SELECT relname AS `name`, IF (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('v') AND reldatabase='information_schema'; ➤ name[12,-1,0] ¦ owner[12,-1,0] 𝄀 columns ¦ accountadmin 𝄀 +key_column_usage ¦ accountadmin 𝄀 +partitions ¦ accountadmin 𝄀 processlist ¦ accountadmin 𝄀 +referential_constraints ¦ accountadmin 𝄀 schemata ¦ accountadmin 𝄀 -tables ¦ accountadmin 𝄀 -partitions ¦ accountadmin 𝄀 -views ¦ accountadmin 𝄀 statistics ¦ accountadmin 𝄀 -referential_constraints ¦ accountadmin 𝄀 -table_constraints ¦ accountadmin +table_constraints ¦ accountadmin 𝄀 +tables ¦ accountadmin 𝄀 +views ¦ accountadmin SELECT relname AS `name`, IF (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('v') AND reldatabase='mo_sample_data_tpch_sf1'; ➤ name[12,-1,0] ¦ owner[12,-1,0] SELECT relname AS `name`, IF (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('v') AND reldatabase='mysql'; @@ -887,43 +875,42 @@ SELECT relname AS `name`, IF (role_name IS NULL, '-', role_name) AS `owner` FROM ➤ name[12,-1,0] ¦ owner[12,-1,0] SELECT relname AS `name`, IF (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('v') AND reldatabase='system_metrics'; ➤ name[12,-1,0] ¦ owner[12,-1,0] 𝄀 -sql_statement_total ¦ accountadmin 𝄀 -sql_statement_errors ¦ accountadmin 𝄀 -sql_transaction_total ¦ accountadmin 𝄀 -sql_transaction_errors ¦ accountadmin 𝄀 -sql_statement_duration_total ¦ accountadmin 𝄀 server_connections ¦ accountadmin 𝄀 -server_storage_usage ¦ accountadmin 𝄀 server_object_count ¦ accountadmin 𝄀 -server_snapshot_usage ¦ accountadmin +server_snapshot_usage ¦ accountadmin 𝄀 +server_storage_usage ¦ accountadmin 𝄀 +sql_statement_duration_total ¦ accountadmin 𝄀 +sql_statement_errors ¦ accountadmin 𝄀 +sql_statement_total ¦ accountadmin 𝄀 +sql_transaction_errors ¦ accountadmin 𝄀 +sql_transaction_total ¦ accountadmin set mo_table_stats.use_old_impl = yes; SELECT relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='information_schema'; ➤ name[12,-1,0] ¦ rows[-5,64,0] ¦ size[-5,64,0] ¦ owner[12,-1,0] 𝄀 -key_column_usage ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -profiling ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -user_privileges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 character_sets ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -triggers ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +collations ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +column_privileges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 engines ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -routines ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -parameters ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +events ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +files ¦ 0 ¦ 0 ¦ accountadmin 𝄀 keywords ¦ 747 ¦ 23904 ¦ accountadmin 𝄀 +parameters ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +profiling ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +routines ¦ 0 ¦ 0 ¦ accountadmin 𝄀 schema_privileges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 table_privileges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -column_privileges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -collations ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -events ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -files ¦ 0 ¦ 0 ¦ accountadmin +triggers ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +user_privileges ¦ 0 ¦ 0 ¦ accountadmin SELECT relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='mo_sample_data_tpch_sf1'; ➤ name[12,-1,0] ¦ rows[-5,64,0] ¦ size[-5,64,0] ¦ owner[12,-1,0] SELECT relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='mysql'; ➤ name[12,-1,0] ¦ rows[-5,64,0] ¦ size[-5,64,0] ¦ owner[12,-1,0] 𝄀 -user ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +columns_priv ¦ 0 ¦ 0 ¦ accountadmin 𝄀 db ¦ 0 ¦ 0 ¦ accountadmin 𝄀 procs_priv ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -columns_priv ¦ 0 ¦ 0 ¦ accountadmin 𝄀 +role_edges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 tables_priv ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -role_edges ¦ 0 ¦ 0 ¦ accountadmin +user ¦ 0 ¦ 0 ¦ accountadmin SELECT relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner` FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='system'; ➤ name[12,-1,0] ¦ rows[-5,64,0] ¦ size[-5,64,0] ¦ owner[12,-1,0] 𝄀 statement_info ¦ 0 ¦ 0 ¦ accountadmin diff --git a/test/distributed/cases/system_variable/system_variables.result b/test/distributed/cases/system_variable/system_variables.result index b88e90e02fde9..b7e9752698ab1 100644 --- a/test/distributed/cases/system_variable/system_variables.result +++ b/test/distributed/cases/system_variable/system_variables.result @@ -7,149 +7,149 @@ set wait_timeout = default; set tx_isolation = default; set tx_isolation = default; show variables like 'server_id'; -Variable_name Value -server_id uuid +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +server_id ¦ dd1dccb4-4d3c-41f8-b482-5251dc7a41bf select @@server_id; -@@server_id -uuid +➤ @@server_id[12,0,0] 𝄀 +dd1dccb4-4d3c-41f8-b482-5251dc7a41bf show variables like 'auto%'; -Variable_name Value -auto_generate_certs on -auto_increment_increment 1 -auto_increment_offset 1 -autocommit on -automatic_sp_privileges on +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_generate_certs ¦ on 𝄀 +auto_increment_increment ¦ 1 𝄀 +auto_increment_offset ¦ 1 𝄀 +autocommit ¦ on 𝄀 +automatic_sp_privileges ¦ on show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 1 set auto_increment_increment = 2; show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 2 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 2 set auto_increment_increment = 1+1; show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 2 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 2 set auto_increment_increment = 2*3; show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 6 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 6 show variables like 'init%'; -Variable_name Value -init_connect -init_file +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +init_connect ¦ 𝄀 +init_file ¦ show variables like 'init_connect'; -Variable_name Value -init_connect +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +init_connect ¦ show variables like 'interactive%'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 set interactive_timeout = 36600; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 36600 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 36600 set interactive_timeout = 30000+100; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 30100 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 30100 set global interactive_timeout = default; set @g_interactive_timeout_before = @@global.interactive_timeout; set global interactive_timeout = 30000+100; select @@global.interactive_timeout = @g_interactive_timeout_before; -@@interactive_timeout = @g_interactive_timeout_before +➤ @@global.interactive_timeout = @g_interactive_timeout_before[-7,1,0] 𝄀 0 show global variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 30100 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 30100 set global interactive_timeout = default; select @@session.interactive_timeout; -@@interactive_timeout +➤ @@interactive_timeout[12,0,0] 𝄀 30100 set interactive_timeout = 0; internal error: convert to the system variable int type failed set interactive_timeout = 1; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 1 set interactive_timeout = 86400; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 set interactive_timeout = 86401; invalid input: interactive_timeout must be <= 86400 show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 show variables like 'lower%'; -Variable_name Value -lower_case_file_system off -lower_case_table_names 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +lower_case_file_system ¦ off 𝄀 +lower_case_table_names ¦ 1 show variables like 'lower_case_table_names'; -Variable_name Value -lower_case_table_names 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +lower_case_table_names ¦ 1 show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 60 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 60 set net_write_timeout = 70; show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 70 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 70 set net_write_timeout = 20*20; show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 400 set net_write_timeout = 60; show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 60 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 60 show variables where variable_name like 'system%' and variable_name != 'system_time_zone'; -Variable_name Value +➤ Variable_name[12,0,0] ¦ Value[12,0,0] select @@system_time_zone != ''; -@@system_time_zone != +➤ @@system_time_zone != [-7,1,0] 𝄀 1 show variables like 'trans%'; -Variable_name Value -transaction_alloc_block_size 8192 -transaction_isolation REPEATABLE-READ -transaction_operator_open_log off -transaction_prealloc_size 4096 -transaction_read_only 0 -transferred off +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_alloc_block_size ¦ 8192 𝄀 +transaction_isolation ¦ REPEATABLE-READ 𝄀 +transaction_operator_open_log ¦ off 𝄀 +transaction_prealloc_size ¦ 4096 𝄀 +transaction_read_only ¦ 0 𝄀 +transferred ¦ off show variables like 'transaction_isolation'; -Variable_name Value -transaction_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_isolation ¦ REPEATABLE-READ show variables like 'wait%'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 set wait_timeout = 33600; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 33600 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 33600 set wait_timeout = 10; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 10 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 10 set wait_timeout = 0; internal error: convert to the system variable int type failed set wait_timeout = 1; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 1 set wait_timeout = 86400; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 set wait_timeout = 86401; invalid input: wait_timeout must be <= 86400 show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 set wait_timeout = 10; drop table if exists t; create table t( @@ -159,8 +159,8 @@ c int, primary key(a) ); show indexes from t; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t 0 PRIMARY 1 a A 0 NULL NULL YES a +➤ Table[12,-1,0] ¦ Non_unique[-5,64,0] ¦ Key_name[12,-1,0] ¦ Seq_in_index[4,32,0] ¦ Column_name[12,-1,0] ¦ Collation[12,-1,0] ¦ Cardinality[-5,64,0] ¦ Sub_part[12,-1,0] ¦ Packed[12,-1,0] ¦ Null[12,-1,0] ¦ Index_type[12,-1,0] ¦ Comment[1,0,0] ¦ Index_comment[12,-1,0] ¦ Index_params[12,-1,0] ¦ Visible[12,-1,0] ¦ Expression[12,-1,0] 𝄀 +t ¦ 0 ¦ PRIMARY ¦ 1 ¦ a ¦ A ¦ 0 ¦ NULL ¦ NULL ¦ ¦ ¦ ¦ ¦ ¦ YES ¦ a create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database db1; use db1; @@ -172,392 +172,392 @@ c int, primary key(a) ); show indexes from t; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t 0 PRIMARY 1 a A 0 NULL NULL YES a +➤ Table[12,-1,0] ¦ Non_unique[-5,64,0] ¦ Key_name[12,-1,0] ¦ Seq_in_index[4,32,0] ¦ Column_name[12,-1,0] ¦ Collation[12,-1,0] ¦ Cardinality[-5,64,0] ¦ Sub_part[12,-1,0] ¦ Packed[12,-1,0] ¦ Null[12,-1,0] ¦ Index_type[12,-1,0] ¦ Comment[1,0,0] ¦ Index_comment[12,-1,0] ¦ Index_params[12,-1,0] ¦ Visible[12,-1,0] ¦ Expression[12,-1,0] 𝄀 +t ¦ 0 ¦ PRIMARY ¦ 1 ¦ a ¦ A ¦ 0 ¦ NULL ¦ NULL ¦ ¦ ¦ ¦ ¦ ¦ YES ¦ a drop database db1; drop account acc_idx; use information_schema; show tables; -Tables_in_information_schema -character_sets -collations -column_privileges -columns -engines -events -files -key_column_usage -keywords -parameters -partitions -processlist -profiling -referential_constraints -routines -schema_privileges -schemata -statistics -table_constraints -table_privileges -tables -triggers -user_privileges +➤ Tables_in_information_schema[12,-1,0] 𝄀 +character_sets 𝄀 +collations 𝄀 +column_privileges 𝄀 +columns 𝄀 +engines 𝄀 +events 𝄀 +files 𝄀 +key_column_usage 𝄀 +keywords 𝄀 +parameters 𝄀 +partitions 𝄀 +processlist 𝄀 +profiling 𝄀 +referential_constraints 𝄀 +routines 𝄀 +schema_privileges 𝄀 +schemata 𝄀 +statistics 𝄀 +table_constraints 𝄀 +table_privileges 𝄀 +tables 𝄀 +triggers 𝄀 +user_privileges 𝄀 views desc key_column_usage; -Field Type Null Key Default Extra Comment -CONSTRAINT_CATALOG VARCHAR(64) YES null -CONSTRAINT_SCHEMA VARCHAR(64) YES null -CONSTRAINT_NAME VARCHAR(64) YES null -TABLE_CATALOG VARCHAR(64) YES null -TABLE_SCHEMA VARCHAR(64) YES null -TABLE_NAME VARCHAR(64) YES null -COLUMN_NAME VARCHAR(64) YES null -ORDINAL_POSITION INT UNSIGNED(32) YES null -POSITION_IN_UNIQUE_CONSTRAINT INT UNSIGNED(32) YES null -REFERENCED_TABLE_SCHEMA VARCHAR(64) YES null -REFERENCED_TABLE_NAME VARCHAR(64) YES null -REFERENCED_COLUMN_NAME VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ select table_name, column_name from key_column_usage limit 2; -table_name column_name +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] desc columns; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(256) YES null -table_name VARCHAR(256) YES null -column_name VARCHAR(256) YES null -ordinal_position INT(0) YES null -column_default VARCHAR(65535) YES null -is_nullable VARCHAR(3) YES null -data_type VARCHAR(65535) YES null -character_maximum_length BIGINT(0) YES null -character_octet_length BIGINT(0) YES null -numeric_precision BIGINT(0) YES null -numeric_scale BIGINT(0) YES null -datetime_precision BIGINT(0) YES null -character_set_name VARCHAR(4) YES null -collation_name VARCHAR(8) YES null -column_type VARCHAR(65535) YES null -column_key VARCHAR(3) YES null -extra VARCHAR(24) YES null -privileges VARCHAR(31) NO null -column_comment VARCHAR(2048) YES null -generation_expression VARCHAR(500) YES null -srs_id BIGINT(0) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_default ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +is_nullable ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_maximum_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_octet_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_scale ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +datetime_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_set_name ¦ VARCHAR(4) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +collation_name ¦ VARCHAR(8) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_key ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +extra ¦ VARCHAR(24) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +privileges ¦ VARCHAR(31) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_comment ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +generation_expression ¦ VARCHAR(500) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +srs_id ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ select table_name, column_name from columns where table_schema = 'mo_catalog' and column_name != '__mo_index_idx_col' and column_name != '__mo_index_pri_col' order by table_name, column_name limit 5; -table_name column_name -mo_account account_id -mo_account account_name -mo_account admin_name -mo_account comments -mo_account create_version +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] 𝄀 +mo_account ¦ account_id 𝄀 +mo_account ¦ account_name 𝄀 +mo_account ¦ admin_name 𝄀 +mo_account ¦ comments 𝄀 +mo_account ¦ create_version desc views; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(5000) YES null -table_name VARCHAR(5000) YES null -view_definition TEXT(0) YES null -check_option VARCHAR(4) NO null -is_updatable VARCHAR(3) NO null -definer VARCHAR(65535) YES null -security_type VARCHAR(7) NO null -character_set_client VARCHAR(7) NO null -collation_connection VARCHAR(18) NO null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +view_definition ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +check_option ¦ VARCHAR(4) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +is_updatable ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +definer ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +security_type ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +character_set_client ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +collation_connection ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ select table_schema, table_name, definer from views where table_schema = 'system' order by table_name; -table_schema table_name definer -system error_info root@localhost -system log_info root@localhost -system span_info root@localhost -system sql_statement_hotspot root@localhost +➤ table_schema[12,-1,0] ¦ table_name[12,-1,0] ¦ definer[12,-1,0] 𝄀 +system ¦ error_info ¦ root@localhost 𝄀 +system ¦ log_info ¦ root@localhost 𝄀 +system ¦ span_info ¦ root@localhost 𝄀 +system ¦ sql_statement_hotspot ¦ root@localhost desc profiling; -Field Type Null Key Default Extra Comment -QUERY_ID INT(32) NO 0 -SEQ INT(32) NO 0 -STATE VARCHAR(30) NO -DURATION DECIMAL(9,6) NO 0.000000 -CPU_USER DECIMAL(9,6) YES null -CPU_SYSTEM DECIMAL(9,6) YES null -CONTEXT_VOLUNTARY INT(32) YES null -CONTEXT_INVOLUNTARY INT(32) YES null -BLOCK_OPS_IN INT(32) YES null -BLOCK_OPS_OUT INT(32) YES null -MESSAGES_SENT INT(32) YES null -MESSAGES_RECEIVED INT(32) YES null -PAGE_FAULTS_MAJOR INT(32) YES null -PAGE_FAULTS_MINOR INT(32) YES null -SWAPS INT(32) YES null -SOURCE_FUNCTION VARCHAR(30) YES null -SOURCE_FILE VARCHAR(20) YES null -SOURCE_LINE INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +QUERY_ID ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +SEQ ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +STATE ¦ VARCHAR(30) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +DURATION ¦ DECIMAL(9,6) ¦ NO ¦ ¦ 0.000000 ¦ ¦ 𝄀 +CPU_USER ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CPU_SYSTEM ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_VOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_INVOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_IN ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_OUT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_SENT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_RECEIVED ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MAJOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MINOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SWAPS ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FUNCTION ¦ VARCHAR(30) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FILE ¦ VARCHAR(20) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_LINE ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ select seq, state from profiling; -seq state +➤ seq[4,32,0] ¦ state[12,-1,0] desc user_privileges; -Field Type Null Key Default Extra Comment -GRANTEE VARCHAR(292) NO -TABLE_CATALOG VARCHAR(512) NO -PRIVILEGE_TYPE VARCHAR(64) NO -IS_GRANTABLE VARCHAR(3) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +GRANTEE ¦ VARCHAR(292) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +TABLE_CATALOG ¦ VARCHAR(512) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +PRIVILEGE_TYPE ¦ VARCHAR(64) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +IS_GRANTABLE ¦ VARCHAR(3) ¦ NO ¦ ¦ ¦ ¦ select grantee, table_catalog from user_privileges limit 2; -grantee table_catalog +➤ grantee[12,-1,0] ¦ table_catalog[12,-1,0] desc schemata; -Field Type Null Key Default Extra Comment -catalog_name VARCHAR(3) NO null -schema_name VARCHAR(5000) YES null -default_character_set_name VARCHAR(7) NO null -default_collation_name VARCHAR(18) NO null -sql_path CHAR(0) YES null -default_encryption VARCHAR(3) NO null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +catalog_name ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +schema_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_character_set_name ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +default_collation_name ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +sql_path ¦ CHAR(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_encryption ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ select catalog_name, schema_name from schemata where schema_name = 'mo_catalog' or schema_name = 'mo_task' order by catalog_name, schema_name; -catalog_name schema_name -def mo_catalog -def mo_task +➤ catalog_name[12,-1,0] ¦ schema_name[12,-1,0] 𝄀 +def ¦ mo_catalog 𝄀 +def ¦ mo_task desc character_sets; -Field Type Null Key Default Extra Comment -CHARACTER_SET_NAME VARCHAR(64) YES null -DEFAULT_COLLATE_NAME VARCHAR(64) YES null -DESCRIPTION VARCHAR(2048) YES null -MAXLEN INT UNSIGNED(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +CHARACTER_SET_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFAULT_COLLATE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DESCRIPTION ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MAXLEN ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ select character_set_name, description, maxlen from character_sets limit 5; -character_set_name description maxlen +➤ character_set_name[12,-1,0] ¦ description[12,-1,0] ¦ maxlen[4,32,0] desc triggers; -Field Type Null Key Default Extra Comment -TRIGGER_CATALOG VARCHAR(64) YES null -TRIGGER_SCHEMA VARCHAR(64) YES null -TRIGGER_NAME VARCHAR(64) YES null -EVENT_MANIPULATION VARCHAR(10) YES null -EVENT_OBJECT_CATALOG VARCHAR(64) YES null -EVENT_OBJECT_SCHEMA VARCHAR(64) YES null -EVENT_OBJECT_TABLE VARCHAR(64) YES null -ACTION_ORDER INT UNSIGNED(32) YES null -ACTION_CONDITION BINARY(0) YES null -ACTION_STATEMENT TEXT(0) YES null -ACTION_ORIENTATION VARCHAR(3) YES null -ACTION_TIMING VARCHAR(10) YES null -ACTION_REFERENCE_OLD_TABLE BINARY(0) YES null -ACTION_REFERENCE_NEW_TABLE BINARY(0) YES null -ACTION_REFERENCE_OLD_ROW VARCHAR(3) YES null -ACTION_REFERENCE_NEW_ROW VARCHAR(3) YES null -CREATED TIMESTAMP(2) YES null -SQL_MODE VARCHAR(10) YES null -DEFINER VARCHAR(288) YES null -CHARACTER_SET_CLIENT VARCHAR(64) YES null -COLLATION_CONNECTION VARCHAR(64) YES null -DATABASE_COLLATION VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +TRIGGER_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_MANIPULATION ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_TABLE ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORDER ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_CONDITION ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_STATEMENT ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORIENTATION ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_TIMING ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CREATED ¦ TIMESTAMP(2) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SQL_MODE ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFINER ¦ VARCHAR(288) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CHARACTER_SET_CLIENT ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +COLLATION_CONNECTION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DATABASE_COLLATION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ select trigger_name, action_order from triggers limit 3; -trigger_name action_order +➤ trigger_name[12,-1,0] ¦ action_order[4,32,0] use mysql; select host, user from user limit 2; -host user +➤ host[1,255,0] ¦ user[1,32,0] desc db; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Select_priv VARCHAR(10) NO N -Insert_priv VARCHAR(10) NO N -Update_priv VARCHAR(10) NO N -Delete_priv VARCHAR(10) NO N -Create_priv VARCHAR(10) NO N -Drop_priv VARCHAR(10) NO N -Grant_priv VARCHAR(10) NO N -References_priv VARCHAR(10) NO N -Index_priv VARCHAR(10) NO N -Alter_priv VARCHAR(10) NO N -Create_tmp_table_priv VARCHAR(10) NO N -Lock_tables_priv VARCHAR(10) NO N -Create_view_priv VARCHAR(10) NO N -Show_view_priv VARCHAR(10) NO N -Create_routine_priv VARCHAR(10) NO N -Alter_routine_priv VARCHAR(10) NO N -Execute_priv VARCHAR(10) NO N -Event_priv VARCHAR(10) NO N -Trigger_priv VARCHAR(10) NO N +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Select_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Insert_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Update_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Delete_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Drop_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Grant_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +References_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Index_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_tmp_table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Lock_tables_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Show_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Execute_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Event_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Trigger_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ select db, user from db limit 5; -db user +➤ db[1,64,0] ¦ user[1,32,0] desc procs_priv; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Routine_name CHAR(64) NO PRI -Routine_type VARCHAR(10) NO PRI null -Grantor VARCHAR(288) NO MUL -Proc_priv VARCHAR(10) NO -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_type ¦ VARCHAR(10) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Proc_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ select routine_name, routine_type from procs_priv limit 5; -routine_name routine_type +➤ routine_name[1,64,0] ¦ routine_type[12,-1,0] desc columns_priv; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Column_name CHAR(64) NO PRI -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Column_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ select table_name, column_name from columns_priv limit 5; -table_name column_name +➤ table_name[1,64,0] ¦ column_name[1,64,0] desc tables_priv; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Grantor VARCHAR(288) NO MUL -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Table_priv VARCHAR(10) NO -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ select host, table_name from tables_priv limit 5; -host table_name +➤ host[1,255,0] ¦ table_name[1,64,0] show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 18446744073709551615 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 18446744073709551615 set sql_select_limit = 100000; show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 100000 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 100000 set sql_select_limit = 1; show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 1 SET SQL_SELECT_LIMIT = Default; show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 18446744073709551615 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 18446744073709551615 show variables like 'max_allowed_packet'; -Variable_name Value -max_allowed_packet 67108864 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +max_allowed_packet ¦ 67108864 set max_allowed_packet = 10000; show variables like 'max_allowed_packet'; -Variable_name Value -max_allowed_packet 10000 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +max_allowed_packet ¦ 10000 set max_allowed_packet = default; show variables like 'max_allowed_packet'; -Variable_name Value -max_allowed_packet 67108864 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +max_allowed_packet ¦ 67108864 show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 10 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 10 set wait_timeout = 10000; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 10000 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 10000 set wait_timeout = default; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 show variables like 'character_set_results'; -Variable_name Value -character_set_results utf8 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_results ¦ utf8 set character_set_server = default; show variables like 'character_set_results'; -Variable_name Value -character_set_results utf8 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_results ¦ utf8 show variables like 'character_set_server'; -Variable_name Value -character_set_server utf8mb4 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_server ¦ utf8mb4 set character_set_server = default; show variables like 'character_set_server'; -Variable_name Value -character_set_server utf8mb4 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_server ¦ utf8mb4 show variables like 'transaction_isolation'; -Variable_name Value -transaction_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_isolation ¦ REPEATABLE-READ set transaction_isolation = default; show variables like 'transaction_isolation'; -Variable_name Value -transaction_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_isolation ¦ REPEATABLE-READ show variables like 'tx_isolation'; -Variable_name Value -tx_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +tx_isolation ¦ REPEATABLE-READ set tx_isolation = default; show variables like 'tx_isolation'; -Variable_name Value -tx_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +tx_isolation ¦ REPEATABLE-READ select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES set @@sql_mode =''; select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 set @@sql_mode = 'ONLY_FULL_GROUP_BY'; select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 ONLY_FULL_GROUP_BY set @@sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"; select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES set @@sql_mode = default; set global long_query_time = 1.1; show global variables like 'long_query_time'; -Variable_name Value -long_query_time 1.1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +long_query_time ¦ 1.1 set global long_query_time = default; show global variables like 'long_query_time'; -Variable_name Value -long_query_time 10 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +long_query_time ¦ 10 create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database test_for_navicat; create database test_for_navicat; SELECT SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA where SCHEMA_NAME = 'test_for_navicat'; -SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME -test_for_navicat utf8mb4 utf8mb4_0900_ai_ci +➤ SCHEMA_NAME[12,-1,0] ¦ DEFAULT_CHARACTER_SET_NAME[12,-1,0] ¦ DEFAULT_COLLATION_NAME[12,-1,0] 𝄀 +test_for_navicat ¦ utf8mb4 ¦ utf8mb4_0900_ai_ci drop database test_for_navicat; drop account acc_idx; select @@profiling; -@@profiling +➤ @@profiling[12,0,0] 𝄀 0 select @@global.profiling; -@@profiling +➤ @@global.profiling[12,0,0] 𝄀 0 show variables like 'profiling'; -Variable_name Value -profiling 0 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling ¦ 0 select @@profiling_history_size; -@@profiling_history_size +➤ @@profiling_history_size[12,0,0] 𝄀 15 select @@global.profiling_history_size; -@@profiling_history_size +➤ @@global.profiling_history_size[12,0,0] 𝄀 15 show variables like 'profiling_history_size'; -Variable_name Value -profiling_history_size 15 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling_history_size ¦ 15 SET profiling_history_size = 0; select @@profiling_history_size; -@@profiling_history_size +➤ @@profiling_history_size[12,0,0] 𝄀 0 select @@global.profiling_history_size; -@@profiling_history_size +➤ @@global.profiling_history_size[12,0,0] 𝄀 15 show variables like 'profiling_history_size'; -Variable_name Value -profiling_history_size 0 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling_history_size ¦ 0 SET profiling_history_size = 15; select @@profiling_history_size; -@@profiling_history_size +➤ @@profiling_history_size[12,0,0] 𝄀 15 select @@global.profiling_history_size; -@@profiling_history_size +➤ @@global.profiling_history_size[12,0,0] 𝄀 15 show variables like 'profiling_history_size'; -Variable_name Value -profiling_history_size 15 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling_history_size ¦ 15 SET profiling_history_size = default; select @@optimizer_switch; -@@optimizer_switch +➤ @@optimizer_switch[12,0,0] 𝄀 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on select @@global.optimizer_switch; -@@optimizer_switch +➤ @@global.optimizer_switch[12,0,0] 𝄀 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on show variables like 'optimizer_switch'; -Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +optimizer_switch ¦ index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on set optimizer_switch='semijoin=off'; select @@optimizer_switch; -@@optimizer_switch +➤ @@optimizer_switch[12,0,0] 𝄀 semijoin=off show variables like 'optimizer_switch'; -Variable_name Value -optimizer_switch semijoin=off +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +optimizer_switch ¦ semijoin=off SET profiling_history_size = default; diff --git a/test/distributed/cases/table/truncate_table_2.result b/test/distributed/cases/table/truncate_table_2.result index 021ce0c696088..9a5c1b96acb1f 100644 --- a/test/distributed/cases/table/truncate_table_2.result +++ b/test/distributed/cases/table/truncate_table_2.result @@ -8,133 +8,132 @@ insert into trun_table_01 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','20 insert into trun_table_01 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,77.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_01 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,54.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,11.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 54.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 11.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} update trun_table_01 set clo3=90 ,col12='2011-01-21' where clo1=1; -Duplicate entry '3a155a41170b33cd' for key '__mo_cpkey_004clo3005col12' +[unknown result because it is related to issue#7133] update trun_table_01 set clo3=66 ,col12='2011-01-21' where clo1=1; +[unknown result because it is related to issue#7133] select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 66 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} +[unknown result because it is related to issue#7133] truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] delete from trun_table_01 where clo1=2; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] insert into trun_table_01(clo2,clo3,col12) select 36,118,'2002-12-03'; insert into trun_table_01(clo2,clo3,col12) select 45,108,'2012-02-23'; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 36 118 null null null null null null null style 2002-12-03 null null null null null null -2 45 108 null null null null null null null style 2012-02-23 null null null null null null +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ 36 ¦ 118 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ style ¦ 2002-12-03 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null 𝄀 +2 ¦ 45 ¦ 108 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ style ¦ 2012-02-23 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] drop table trun_table_01; create table trun_table_01(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_01 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} create temporary table trun_table_02(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_02 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,98.23,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,77.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=1; --- @regex("Duplicate entry '\(100,2021-01-21\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); -Duplicate entry '(100,2021-01-21)' for key '__mo_cpkey_col' --- @regex("Duplicate entry '\(102,2022-10-11\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) +-- @regex("Duplicate entry '\(100,2021-01-21\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) +Duplicate entry '(100,2021-01-21)' for key '(clo3,col12)' insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,2.43,'tttext','{"a": "3","b": [0,1,2]}'); -Duplicate entry '(102,2022-10-11)' for key '__mo_cpkey_col' +-- @regex("Duplicate entry '\(102,2022-10-11\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) +Duplicate entry '(102,2022-10-11)' for key '(clo3,col12)' select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=3; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} insert into trun_table_02 select * from trun_table_01; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90 where clo1=1; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90, col12='1992-11-01' where clo1=1; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1992-11-01 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1992-11-01 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} drop table trun_table_02; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; select * from trun_table_03; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; select * from trun_table_03; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; drop table trun_table_03; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; @@ -167,7 +166,7 @@ truncate table span_info; no such table system.span_info use information_schema; truncate table key_column_usage ; -internal error: do not have privilege to execute the statement +no such table information_schema.key_column_usage truncate table columns; no such table information_schema.columns truncate table profiling; From 59904f48811f34c4269862d60f62439925cc479b Mon Sep 17 00:00:00 2001 From: daviszhen Date: Fri, 31 Jul 2026 16:12:12 +0800 Subject: [PATCH 04/24] update --- ...information_schema_key_column_usage.result | 36 +++++++++++++++++++ ...fk_information_schema_key_column_usage.sql | 23 ++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result create mode 100644 test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql diff --git a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result new file mode 100644 index 0000000000000..596ae16bd0d8c --- /dev/null +++ b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result @@ -0,0 +1,36 @@ +drop database if exists fk_information_schema_key_column_usage; +create database fk_information_schema_key_column_usage; +use fk_information_schema_key_column_usage; +create table parent (id int, code int, primary key (id, code)); +create table child ( +id int primary key, +parent_id int, +parent_code int, +constraint fk_metadata_compound foreign key (parent_id, parent_code) +references parent(id, code) +); +select CONSTRAINT_SCHEMA as constraint_schema, CONSTRAINT_NAME as constraint_name, TABLE_NAME as table_name, COLUMN_NAME as column_name, REFERENCED_TABLE_NAME as referenced_table_name, REFERENCED_COLUMN_NAME as referenced_column_name, ORDINAL_POSITION as ordinal_position +from information_schema.KEY_COLUMN_USAGE +where TABLE_SCHEMA = database() and REFERENCED_TABLE_NAME is not null +order by CONSTRAINT_NAME, ORDINAL_POSITION; +➤ constraint_schema[12,-1,0] ¦ constraint_name[12,-1,0] ¦ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ referenced_table_name[12,-1,0] ¦ referenced_column_name[12,-1,0] ¦ ordinal_position[4,32,0] 𝄀 +fk_information_schema_key_column_usage ¦ fk_metadata_compound ¦ child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 +fk_information_schema_key_column_usage ¦ fk_metadata_compound ¦ child ¦ parent_code ¦ parent ¦ code ¦ 2 +desc information_schema.KEY_COLUMN_USAGE; +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ +show create table information_schema.KEY_COLUMN_USAGE; +➤ View[12,-1,0] ¦ Create View[12,-1,0] ¦ character_set_client[12,-1,0] ¦ collation_connection[12,-1,0] 𝄀 +key_column_usage ¦ CREATE VIEW information_schema.KEY_COLUMN_USAGE AS SELECT CAST('def' AS varchar(64)) AS CONSTRAINT_CATALOG, CAST(fk.db_name AS varchar(64)) AS CONSTRAINT_SCHEMA, CAST(fk.constraint_name AS varchar(64)) AS CONSTRAINT_NAME, CAST('def' AS varchar(64)) AS TABLE_CATALOG, CAST(fk.db_name AS varchar(64)) AS TABLE_SCHEMA, CAST(fk.table_name AS varchar(64)) AS TABLE_NAME, CAST(fk.column_name AS varchar(64)) AS COLUMN_NAME, CAST(fk.constraint_id AS int unsigned) AS ORDINAL_POSITION, CAST(fk.constraint_id AS int unsigned) AS POSITION_IN_UNIQUE_CONSTRAINT, CAST(fk.refer_db_name AS varchar(64)) AS REFERENCED_TABLE_SCHEMA, CAST(fk.refer_table_name AS varchar(64)) AS REFERENCED_TABLE_NAME, CAST(fk.refer_column_name AS varchar(64)) AS REFERENCED_COLUMN_NAME FROM mo_catalog.mo_foreign_keys fk ¦ utf8mb4 ¦ utf8mb4_general_ci +drop database fk_information_schema_key_column_usage; diff --git a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql new file mode 100644 index 0000000000000..1e4d57d8ec581 --- /dev/null +++ b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql @@ -0,0 +1,23 @@ +-- @suite +-- @case +-- @desc: verify KEY_COLUMN_USAGE view metadata and foreign-key mappings +-- @label:bvt + +drop database if exists fk_information_schema_key_column_usage; +create database fk_information_schema_key_column_usage; +use fk_information_schema_key_column_usage; +create table parent (id int, code int, primary key (id, code)); +create table child ( + id int primary key, + parent_id int, + parent_code int, + constraint fk_metadata_compound foreign key (parent_id, parent_code) + references parent(id, code) +); +select CONSTRAINT_SCHEMA as constraint_schema, CONSTRAINT_NAME as constraint_name, TABLE_NAME as table_name, COLUMN_NAME as column_name, REFERENCED_TABLE_NAME as referenced_table_name, REFERENCED_COLUMN_NAME as referenced_column_name, ORDINAL_POSITION as ordinal_position +from information_schema.KEY_COLUMN_USAGE +where TABLE_SCHEMA = database() and REFERENCED_TABLE_NAME is not null +order by CONSTRAINT_NAME, ORDINAL_POSITION; +desc information_schema.KEY_COLUMN_USAGE; +show create table information_schema.KEY_COLUMN_USAGE; +drop database fk_information_schema_key_column_usage; From 9bb26d1d757134d8666c51cd0b5afe6add441bc7 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Fri, 31 Jul 2026 16:55:17 +0800 Subject: [PATCH 05/24] fix: use moerr in v4.0.6 FK upgrade --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index 2852410d04a35..5f0e7858e32e5 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -129,7 +129,7 @@ func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecuto func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) ([]string, error) { statements, err := mysql.Parse(context.Background(), definition.createSQL, 1) if err != nil { - return nil, fmt.Errorf("parse legacy foreign-key table %s.%s: %w", definition.database, definition.table, err) + return nil, moerr.NewInternalErrorNoCtxf("parse legacy foreign-key table %s.%s: %v", definition.database, definition.table, err) } defer func() { for _, statement := range statements { @@ -138,11 +138,11 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) }() if len(statements) != 1 { - return nil, fmt.Errorf("legacy foreign-key table %s.%s has %d statements", definition.database, definition.table, len(statements)) + return nil, moerr.NewInternalErrorNoCtxf("legacy foreign-key table %s.%s has %d statements", definition.database, definition.table, len(statements)) } createTable, ok := statements[0].(*tree.CreateTable) if !ok { - return nil, fmt.Errorf("legacy foreign-key table %s.%s does not have a CREATE TABLE definition", definition.database, definition.table) + return nil, moerr.NewInternalErrorNoCtxf("legacy foreign-key table %s.%s does not have a CREATE TABLE definition", definition.database, definition.table) } updates := make([]string, 0) @@ -152,7 +152,7 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) continue } if foreignKey.ConstraintSymbol == "" || foreignKey.Refer == nil { - return nil, fmt.Errorf("legacy foreign key in %s.%s has incomplete persisted definition", definition.database, definition.table) + return nil, moerr.NewInternalErrorNoCtxf("legacy foreign key in %s.%s has incomplete persisted definition", definition.database, definition.table) } for ordinal, keyPart := range foreignKey.KeyParts { updates = append(updates, fmt.Sprintf( From 738ff076c07f1e39715045f4fc3952be8d4190fe Mon Sep 17 00:00:00 2001 From: daviszhen Date: Fri, 31 Jul 2026 17:59:10 +0800 Subject: [PATCH 06/24] test: update FK metadata ordinal expectations --- pkg/sql/plan/build_dml_util_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sql/plan/build_dml_util_test.go b/pkg/sql/plan/build_dml_util_test.go index 838cbe7646764..4786e588f8374 100644 --- a/pkg/sql/plan/build_dml_util_test.go +++ b/pkg/sql/plan/build_dml_util_test.go @@ -168,8 +168,8 @@ func TestGetSqlForAddFkEscapesCatalogValues(t *testing.T) { require.Equal(t, "insert into `mo_catalog`.`mo_foreign_keys` values "+ - "('fk\\\\name\\'one','0','child\\'db\\\\part','0','child\\\\table\\'name','0','child\\\\col\\'name','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent\\\\col\\'name','0','CASCADE','RESTRICT'),"+ - "('fk\\\\name\\'one','0','child\\'db\\\\part','0','child\\\\table\\'name','0','child_col_two','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent_col_two','0','CASCADE','RESTRICT')", + "('fk\\\\name\\'one','1','child\\'db\\\\part','0','child\\\\table\\'name','0','child\\\\col\\'name','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent\\\\col\\'name','0','CASCADE','RESTRICT'),"+ + "('fk\\\\name\\'one','2','child\\'db\\\\part','0','child\\\\table\\'name','0','child_col_two','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent_col_two','0','CASCADE','RESTRICT')", getSqlForAddFk(`child'db\part`, `child\table'name`, fk), ) } From a37599c4c567d52128f03407431285faae1a0e9d Mon Sep 17 00:00:00 2001 From: daviszhen Date: Fri, 31 Jul 2026 19:53:25 +0800 Subject: [PATCH 07/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index ca16ed3272d3d..ba8ac9676d767 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -15,10 +15,22 @@ package v4_0_6 import ( + "context" + "errors" "strings" "testing" + "github.com/golang/mock/gomock" + "github.com/prashantv/gostub" + "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" + "github.com/matrixorigin/matrixone/pkg/common/mpool" + "github.com/matrixorigin/matrixone/pkg/common/runtime" + "github.com/matrixorigin/matrixone/pkg/container/types" + mock_frontend "github.com/matrixorigin/matrixone/pkg/frontend/test" + "github.com/matrixorigin/matrixone/pkg/pb/txn" + "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree" + "github.com/matrixorigin/matrixone/pkg/util/executor" "github.com/matrixorigin/matrixone/pkg/util/sysview" ) @@ -98,3 +110,186 @@ func TestForeignKeyMetadataVersionHandleMetadataAndClusterNoop(t *testing.T) { t.Fatalf("expected no cluster upgrade entries, got %d", len(clusterUpgEntries)) } } + +func TestTenantViewDefinitionChecks(t *testing.T) { + entries := []versions.UpgradeEntry{ + upgradeInformationSchemaKeyColumnUsage(), + upgradeInformationSchemaReferentialConstraints(), + } + + for _, entry := range entries { + t.Run(entry.TableName+"/match", func(t *testing.T) { + stub := gostub.Stub(&versions.CheckViewDefinition, func(_ executor.TxnExecutor, accountID uint32, schema, viewName string) (bool, string, error) { + if accountID != 42 || schema != sysview.InformationDBConst || viewName != entry.TableName { + t.Fatalf("unexpected view check arguments: account=%d schema=%s view=%s", accountID, schema, viewName) + } + return true, entry.UpgSql, nil + }) + defer stub.Reset() + + matched, err := entry.CheckFunc(nil, 42) + if err != nil || !matched { + t.Fatalf("expected matching view definition, matched=%v err=%v", matched, err) + } + }) + + t.Run(entry.TableName+"/mismatch", func(t *testing.T) { + stub := gostub.Stub(&versions.CheckViewDefinition, func(executor.TxnExecutor, uint32, string, string) (bool, string, error) { + return true, "old definition", nil + }) + defer stub.Reset() + + matched, err := entry.CheckFunc(nil, 42) + if err != nil || matched { + t.Fatalf("expected mismatching view definition, matched=%v err=%v", matched, err) + } + }) + } + + stub := gostub.Stub(&versions.CheckViewDefinition, func(executor.TxnExecutor, uint32, string, string) (bool, string, error) { + return false, "", errors.New("check failed") + }) + defer stub.Reset() + matched, err := entries[0].CheckFunc(nil, 42) + if err == nil || matched { + t.Fatalf("expected check error, matched=%v err=%v", matched, err) + } +} + +func TestVersionHandleLifecycleWithNoLegacyDefinitions(t *testing.T) { + runtime.RunTest("", func(runtime.Runtime) { + stub := gostub.Stub(&versions.CheckViewDefinition, func(_ executor.TxnExecutor, _ uint32, _ string, viewName string) (bool, string, error) { + switch viewName { + case "KEY_COLUMN_USAGE": + return true, sysview.InformationSchemaKeyColumnUsageDDL, nil + case "REFERENTIAL_CONSTRAINTS": + return true, sysview.InformationSchemaReferentialConstraintsDDL, nil + default: + return false, "", errors.New("unexpected view") + } + }) + defer stub.Reset() + + var executed []string + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + executed = append(executed, sql) + return executor.Result{}, nil + }) + + if err := Handler.Prepare(context.Background(), txnExecutor, true); err != nil { + t.Fatalf("prepare: %v", err) + } + if err := Handler.HandleTenantUpgrade(context.Background(), 9, txnExecutor); err != nil { + t.Fatalf("tenant upgrade: %v", err) + } + if len(executed) != 1 || executed[0] != legacyForeignKeyTableDefinitionsSQL { + t.Fatalf("unexpected SQL: %v", executed) + } + if err := Handler.HandleClusterUpgrade(context.Background(), txnExecutor); err != nil { + t.Fatalf("cluster upgrade: %v", err) + } + if err := Handler.HandleCreateFrameworkDeps(txnExecutor); err == nil || !strings.Contains(err.Error(), "Only v1.2.0") { + t.Fatalf("unexpected framework-dependency result: %v", err) + } + }) +} + +func TestVersionHandleTenantUpgradeReturnsLegacyQueryError(t *testing.T) { + want := errors.New("legacy query failed") + txnExecutor := newVersionTxnExecutor(t, func(string) (executor.Result, error) { + return executor.Result{}, want + }) + if err := Handler.HandleTenantUpgrade(context.Background(), 9, txnExecutor); !errors.Is(err, want) { + t.Fatalf("expected legacy query error, got %v", err) + } +} + +func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) { + definitionResult := newLegacyForeignKeyDefinitionResult(t) + var updates []string + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + if sql == legacyForeignKeyTableDefinitionsSQL { + return definitionResult, nil + } + updates = append(updates, sql) + return executor.Result{}, nil + }) + + if err := upgradeLegacyForeignKeyMetadata(context.Background(), 9, txnExecutor); err != nil { + t.Fatalf("upgrade legacy foreign-key metadata: %v", err) + } + if len(updates) != 2 { + t.Fatalf("expected two metadata updates, got %d: %v", len(updates), updates) + } + for _, update := range updates { + if !strings.Contains(update, "constraint_id =") || !strings.Contains(update, "constraint_name = 'fk_child_parent'") { + t.Fatalf("unexpected update: %s", update) + } + } +} + +func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { + for _, createSQL := range []string{ + "select 1", + "create table child (a int); create table another_child (a int)", + "create table child (a int, foreign key (a) references parent (id))", + } { + t.Run(createSQL, func(t *testing.T) { + _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + createSQL: createSQL, + }) + if err == nil { + t.Fatalf("expected invalid persisted definition to fail: %s", createSQL) + } + }) + } +} + +func TestReferenceActionName(t *testing.T) { + for _, test := range []struct { + action tree.ReferenceOptionType + want string + }{ + {tree.REFERENCE_OPTION_CASCADE, "CASCADE"}, + {tree.REFERENCE_OPTION_SET_NULL, "SET_NULL"}, + {tree.REFERENCE_OPTION_NO_ACTION, "NO_ACTION"}, + {tree.REFERENCE_OPTION_SET_DEFAULT, "SET_DEFAULT"}, + {tree.REFERENCE_OPTION_RESTRICT, "RESTRICT"}, + {tree.ReferenceOptionType(-1), "NO_ACTION"}, + } { + if got := referenceActionName(test.action); got != test.want { + t.Fatalf("referenceActionName(%d) = %q, want %q", test.action, got, test.want) + } + } +} + +func newVersionTxnExecutor(t *testing.T, mocker func(string) (executor.Result, error)) executor.TxnExecutor { + t.Helper() + txnOperator := mock_frontend.NewMockTxnOperator(gomock.NewController(t)) + txnOperator.EXPECT().TxnOptions().Return(txn.TxnOptions{}).AnyTimes() + return executor.NewMemTxnExecutor(mocker, txnOperator) +} + +func newLegacyForeignKeyDefinitionResult(t *testing.T) executor.Result { + t.Helper() + mp := mpool.MustNewZeroNoFixed() + t.Cleanup(func() { mpool.DeleteMPool(mp) }) + result := executor.NewMemResult([]types.Type{ + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + }, mp) + result.NewBatchWithRowCount(1) + for column, value := range []string{ + "db", + "child", + "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", + } { + if err := executor.AppendStringRows(result, column, []string{value}); err != nil { + t.Fatalf("append legacy definition column %d: %v", column, err) + } + } + return result.GetResult() +} From 3761f5274498a84703d5595888ae2b87d8b41c8f Mon Sep 17 00:00:00 2001 From: daviszhen Date: Mon, 3 Aug 2026 12:16:43 +0800 Subject: [PATCH 08/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 225 ++++++++++++++++-- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 79 +++++- ...information_schema_key_column_usage.result | 24 ++ ...fk_information_schema_key_column_usage.sql | 16 ++ 4 files changed, 315 insertions(+), 29 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index 5f0e7858e32e5..700fd6108f9e6 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -16,6 +16,7 @@ package v4_0_6 import ( "context" "fmt" + "sort" "strings" "time" @@ -70,19 +71,42 @@ func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, return nil } -const legacyForeignKeyTableDefinitionsSQL = "SELECT DISTINCT fk.db_name, fk.table_name, tbl.rel_createsql " + +const legacyForeignKeyTableDefinitionsSQL = "SELECT fk.db_name, fk.table_name, tbl.rel_createsql, " + + "fk.constraint_name, fk.column_name, fk.refer_db_name, fk.refer_table_name, fk.refer_column_name, fk.on_delete, fk.on_update " + "FROM mo_catalog.mo_foreign_keys fk " + "JOIN mo_catalog.mo_tables tbl ON tbl.reldatabase = fk.db_name AND tbl.relname = fk.table_name " + - "WHERE fk.constraint_id = 0" + "WHERE fk.constraint_id = 0 " + + "ORDER BY fk.db_name, fk.table_name, fk.constraint_name, fk.column_name" type legacyForeignKeyTableDefinition struct { - database string - table string - createSQL string + database string + table string + createSQL string + foreignKeys []legacyForeignKeyCatalogRow } -// upgradeLegacyForeignKeyMetadata restores details that earlier catalog rows did -// not persist: composite column order and whether a RESTRICT action was omitted. +// legacyForeignKeyCatalogRow is the durable source for foreign keys that do +// not occur in rel_createsql, such as constraints added by ALTER TABLE. It is +// also the source of the generated name for an unnamed CREATE TABLE foreign +// key, because rel_createsql precedes adjustConstraintName. +type legacyForeignKeyCatalogRow struct { + constraintName string + columnName string + referDBName string + referTableName string + referColumnName string + onDelete string + onUpdate string +} + +type legacyForeignKeyCatalogConstraint struct { + name string + rows []legacyForeignKeyCatalogRow +} + +// upgradeLegacyForeignKeyMetadata restores zero-valued legacy FK ordinals. It +// uses the original CREATE statement when available and catalog rows for FKs +// added later with ALTER TABLE or named after the CREATE SQL was persisted. func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { definitions, err := getLegacyForeignKeyTableDefinitions(tenantID, txn) if err != nil { @@ -113,12 +137,30 @@ func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecuto defer res.Close() definitions := make([]legacyForeignKeyTableDefinition, 0) + definitionByTable := make(map[string]int) res.ReadRows(func(rows int, cols []*vector.Vector) bool { for i := 0; i < rows; i++ { - definitions = append(definitions, legacyForeignKeyTableDefinition{ - database: cols[0].GetStringAt(i), - table: cols[1].GetStringAt(i), - createSQL: cols[2].GetStringAt(i), + database := cols[0].GetStringAt(i) + table := cols[1].GetStringAt(i) + key := database + "\x00" + table + definitionIndex, ok := definitionByTable[key] + if !ok { + definitionIndex = len(definitions) + definitionByTable[key] = definitionIndex + definitions = append(definitions, legacyForeignKeyTableDefinition{ + database: database, + table: table, + createSQL: cols[2].GetStringAt(i), + }) + } + definitions[definitionIndex].foreignKeys = append(definitions[definitionIndex].foreignKeys, legacyForeignKeyCatalogRow{ + constraintName: cols[3].GetStringAt(i), + columnName: cols[4].GetStringAt(i), + referDBName: cols[5].GetStringAt(i), + referTableName: cols[6].GetStringAt(i), + referColumnName: cols[7].GetStringAt(i), + onDelete: cols[8].GetStringAt(i), + onUpdate: cols[9].GetStringAt(i), }) } return true @@ -145,32 +187,171 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) return nil, moerr.NewInternalErrorNoCtxf("legacy foreign-key table %s.%s does not have a CREATE TABLE definition", definition.database, definition.table) } + constraints := legacyForeignKeyCatalogConstraints(definition.foreignKeys) + matchedConstraints := make(map[string]bool) updates := make([]string, 0) for _, tableDef := range createTable.Defs { foreignKey, ok := tableDef.(*tree.ForeignKey) if !ok { continue } - if foreignKey.ConstraintSymbol == "" || foreignKey.Refer == nil { + if foreignKey.Refer == nil { return nil, moerr.NewInternalErrorNoCtxf("legacy foreign key in %s.%s has incomplete persisted definition", definition.database, definition.table) } - for ordinal, keyPart := range foreignKey.KeyParts { - updates = append(updates, fmt.Sprintf( - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s "+ - "WHERE constraint_id = 0 AND db_name = %s AND table_name = %s AND constraint_name = %s AND column_name = %s", + + if foreignKey.ConstraintSymbol != "" { + matchedConstraints[foreignKey.ConstraintSymbol] = true + updates = appendLegacyForeignKeyASTUpdates(updates, definition, foreignKey.ConstraintSymbol, foreignKey) + continue + } + + // An unnamed FK is assigned its UUID after rel_createsql is persisted. + // Match it to the catalog rows by its complete child/reference column set. + // If that signature is ambiguous, leave every candidate to the catalog + // fallback below rather than assigning one AST action to another FK. + matchedIndex := -1 + for i, constraint := range constraints { + if matchedConstraints[constraint.name] || !sameLegacyForeignKeyColumns(definition.database, foreignKey, constraint.rows) { + continue + } + if matchedIndex >= 0 { + matchedIndex = -1 + break + } + matchedIndex = i + } + if matchedIndex >= 0 { + constraint := constraints[matchedIndex] + matchedConstraints[constraint.name] = true + updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey) + } + } + + // rel_createsql is the original CREATE snapshot, so it cannot describe FKs + // introduced by ALTER TABLE. The catalog rows remain authoritative for their + // generated name, actions, and column pairs; assign stable ordinals from the + // catalog order without rewriting the actions. + for _, constraint := range constraints { + if matchedConstraints[constraint.name] { + continue + } + for ordinal, row := range constraint.rows { + updates = append(updates, legacyForeignKeyUpdateSQL( + definition, + constraint.name, + row.columnName, ordinal+1, - quoteSQLStringLiteral(referenceActionName(foreignKey.Refer.OnDelete)), - quoteSQLStringLiteral(referenceActionName(foreignKey.Refer.OnUpdate)), - quoteSQLStringLiteral(definition.database), - quoteSQLStringLiteral(definition.table), - quoteSQLStringLiteral(foreignKey.ConstraintSymbol), - quoteSQLStringLiteral(keyPart.ColName.ColName()), + legacyCatalogReferenceActionName(row.onDelete), + legacyCatalogReferenceActionName(row.onUpdate), )) } } return updates, nil } +func legacyForeignKeyCatalogConstraints(rows []legacyForeignKeyCatalogRow) []legacyForeignKeyCatalogConstraint { + byName := make(map[string][]legacyForeignKeyCatalogRow) + for _, row := range rows { + byName[row.constraintName] = append(byName[row.constraintName], row) + } + names := make([]string, 0, len(byName)) + for name := range byName { + names = append(names, name) + } + sort.Strings(names) + + constraints := make([]legacyForeignKeyCatalogConstraint, 0, len(names)) + for _, name := range names { + constraintRows := byName[name] + sort.Slice(constraintRows, func(i, j int) bool { + return constraintRows[i].columnName < constraintRows[j].columnName + }) + constraints = append(constraints, legacyForeignKeyCatalogConstraint{name: name, rows: constraintRows}) + } + return constraints +} + +func sameLegacyForeignKeyColumns(database string, foreignKey *tree.ForeignKey, rows []legacyForeignKeyCatalogRow) bool { + if len(foreignKey.KeyParts) != len(rows) || foreignKey.Refer == nil || len(foreignKey.Refer.KeyParts) != len(rows) { + return false + } + referDatabase := database + if foreignKey.Refer.TableName != nil && foreignKey.Refer.TableName.SchemaName != "" { + referDatabase = string(foreignKey.Refer.TableName.SchemaName) + } + referTable := "" + if foreignKey.Refer.TableName != nil { + referTable = string(foreignKey.Refer.TableName.ObjectName) + } + columns := make([]string, len(foreignKey.KeyParts)) + for i, keyPart := range foreignKey.KeyParts { + columns[i] = keyPart.ColName.ColName() + "\x00" + foreignKey.Refer.KeyParts[i].ColName.ColName() + } + sort.Strings(columns) + catalogColumns := make([]string, len(rows)) + for i, row := range rows { + catalogReferDatabase := row.referDBName + if catalogReferDatabase == "" { + catalogReferDatabase = database + } + if catalogReferDatabase != referDatabase || row.referTableName != referTable { + return false + } + catalogColumns[i] = row.columnName + "\x00" + row.referColumnName + } + sort.Strings(catalogColumns) + return strings.Join(columns, "\x00") == strings.Join(catalogColumns, "\x00") +} + +func appendLegacyForeignKeyASTUpdates( + updates []string, + definition legacyForeignKeyTableDefinition, + constraintName string, + foreignKey *tree.ForeignKey, +) []string { + for ordinal, keyPart := range foreignKey.KeyParts { + updates = append(updates, legacyForeignKeyUpdateSQL( + definition, + constraintName, + keyPart.ColName.ColName(), + ordinal+1, + referenceActionName(foreignKey.Refer.OnDelete), + referenceActionName(foreignKey.Refer.OnUpdate), + )) + } + return updates +} + +func legacyForeignKeyUpdateSQL( + definition legacyForeignKeyTableDefinition, + constraintName, columnName string, + ordinal int, + onDelete, onUpdate string, +) string { + return fmt.Sprintf( + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s "+ + "WHERE constraint_id = 0 AND db_name = %s AND table_name = %s AND constraint_name = %s AND column_name = %s", + ordinal, + quoteSQLStringLiteral(onDelete), + quoteSQLStringLiteral(onUpdate), + quoteSQLStringLiteral(definition.database), + quoteSQLStringLiteral(definition.table), + quoteSQLStringLiteral(constraintName), + quoteSQLStringLiteral(columnName), + ) +} + +// Legacy rows with constraint_id = 0 were written before omitted foreign-key +// actions were represented as NO_ACTION. Without an ALTER statement snapshot, +// an omitted action and explicit RESTRICT are indistinguishable; keep the same +// MySQL-compatible NO_ACTION normalization used for CREATE-table backfill. +func legacyCatalogReferenceActionName(action string) string { + if strings.EqualFold(strings.TrimSpace(action), "RESTRICT") || strings.TrimSpace(action) == "" { + return "NO_ACTION" + } + return action +} + func referenceActionName(action tree.ReferenceOptionType) string { switch action { case tree.REFERENCE_OPTION_CASCADE: diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index 60937d08b1383..896184cd9efea 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -221,7 +221,6 @@ func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { for _, createSQL := range []string{ "select 1", "create table child (a int); create table another_child (a int)", - "create table child (a int, foreign key (a) references parent (id))", } { t.Run(createSQL, func(t *testing.T) { _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ @@ -236,6 +235,55 @@ func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { } } +func TestLegacyForeignKeyMetadataUpdatesBackfillAlterTableForeignKey(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + createSQL: "create table child (b int, a int)", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_added_by_alter", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + {constraintName: "fk_added_by_alter", columnName: "b", referDBName: "db", referTableName: "parent", referColumnName: "b", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + }, + }) + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", + }, updates) +} + +func TestLegacyForeignKeyMetadataUpdatesBackfillUnnamedForeignKey(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + createSQL: "create table child (parent_id int, foreign key (parent_id) references parent (id))", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "catalog-generated-name", columnName: "parent_id", referDBName: "", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + }, + }) + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", + }, updates) +} + +func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalog(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + createSQL: "create table child (parent_id int, foreign key (parent_id) references parent (id))", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "catalog-fk-a", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "CASCADE", onUpdate: "CASCADE"}, + {constraintName: "catalog-fk-b", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + }, + }) + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'CASCADE' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-a' AND column_name = 'parent_id'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-b' AND column_name = 'parent_id'", + }, updates) +} + func TestReferenceActionName(t *testing.T) { for _, test := range []struct { action tree.ReferenceOptionType @@ -269,14 +317,31 @@ func newLegacyForeignKeyDefinitionResult(t *testing.T) executor.Result { types.T_varchar.ToType(), types.T_varchar.ToType(), types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), }, mp) - result.NewBatchWithRowCount(1) - for column, value := range []string{ - "db", - "child", - "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", + result.NewBatchWithRowCount(2) + for column, values := range [][]string{ + {"db", "db"}, + {"child", "child"}, + { + "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", + "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", + }, + {"fk_child_parent", "fk_child_parent"}, + {"child_id", "parent_id"}, + {"db", "db"}, + {"parent", "parent"}, + {"child_id", "parent_id"}, + {"CASCADE", "CASCADE"}, + {"SET_NULL", "SET_NULL"}, } { - if err := executor.AppendStringRows(result, column, []string{value}); err != nil { + if err := executor.AppendStringRows(result, column, values); err != nil { t.Fatalf("append legacy definition column %d: %v", column, err) } } diff --git a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result index 596ae16bd0d8c..9865137345fca 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result +++ b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result @@ -16,6 +16,30 @@ order by CONSTRAINT_NAME, ORDINAL_POSITION; ➤ constraint_schema[12,-1,0] ¦ constraint_name[12,-1,0] ¦ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ referenced_table_name[12,-1,0] ¦ referenced_column_name[12,-1,0] ¦ ordinal_position[4,32,0] 𝄀 fk_information_schema_key_column_usage ¦ fk_metadata_compound ¦ child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 fk_information_schema_key_column_usage ¦ fk_metadata_compound ¦ child ¦ parent_code ¦ parent ¦ code ¦ 2 +create table alter_child (id int primary key, parent_id int, parent_code int); +alter table alter_child add constraint fk_metadata_alter foreign key (parent_id, parent_code) references parent(id, code); +create table unnamed_child ( +id int primary key, +parent_id int, +parent_code int, +foreign key (parent_id, parent_code) references parent(id, code) +); +select TABLE_NAME as table_name, COLUMN_NAME as column_name, REFERENCED_TABLE_NAME as referenced_table_name, REFERENCED_COLUMN_NAME as referenced_column_name, ORDINAL_POSITION as ordinal_position +from information_schema.KEY_COLUMN_USAGE +where TABLE_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +order by TABLE_NAME, ORDINAL_POSITION; +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ referenced_table_name[12,-1,0] ¦ referenced_column_name[12,-1,0] ¦ ordinal_position[4,32,0] 𝄀 +alter_child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 +alter_child ¦ parent_code ¦ parent ¦ code ¦ 2 𝄀 +unnamed_child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 +unnamed_child ¦ parent_code ¦ parent ¦ code ¦ 2 +select TABLE_NAME as table_name, UPDATE_RULE as update_rule, DELETE_RULE as delete_rule +from information_schema.REFERENTIAL_CONSTRAINTS +where CONSTRAINT_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +order by TABLE_NAME; +➤ table_name[12,-1,0] ¦ update_rule[12,-1,0] ¦ delete_rule[12,-1,0] 𝄀 +alter_child ¦ NO ACTION ¦ NO ACTION 𝄀 +unnamed_child ¦ NO ACTION ¦ NO ACTION desc information_schema.KEY_COLUMN_USAGE; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 diff --git a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql index 1e4d57d8ec581..3538a6161c1b5 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql +++ b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql @@ -18,6 +18,22 @@ select CONSTRAINT_SCHEMA as constraint_schema, CONSTRAINT_NAME as constraint_nam from information_schema.KEY_COLUMN_USAGE where TABLE_SCHEMA = database() and REFERENCED_TABLE_NAME is not null order by CONSTRAINT_NAME, ORDINAL_POSITION; +create table alter_child (id int primary key, parent_id int, parent_code int); +alter table alter_child add constraint fk_metadata_alter foreign key (parent_id, parent_code) references parent(id, code); +create table unnamed_child ( + id int primary key, + parent_id int, + parent_code int, + foreign key (parent_id, parent_code) references parent(id, code) +); +select TABLE_NAME as table_name, COLUMN_NAME as column_name, REFERENCED_TABLE_NAME as referenced_table_name, REFERENCED_COLUMN_NAME as referenced_column_name, ORDINAL_POSITION as ordinal_position +from information_schema.KEY_COLUMN_USAGE +where TABLE_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +order by TABLE_NAME, ORDINAL_POSITION; +select TABLE_NAME as table_name, UPDATE_RULE as update_rule, DELETE_RULE as delete_rule +from information_schema.REFERENTIAL_CONSTRAINTS +where CONSTRAINT_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +order by TABLE_NAME; desc information_schema.KEY_COLUMN_USAGE; show create table information_schema.KEY_COLUMN_USAGE; drop database fk_information_schema_key_column_usage; From 9aa2194738de3c07678aba9498259c51d8faf5fd Mon Sep 17 00:00:00 2001 From: daviszhen Date: Mon, 3 Aug 2026 14:31:09 +0800 Subject: [PATCH 09/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 4 +- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 94 +++++++++++++++---- ...information_schema_key_column_usage.result | 9 +- ...fk_information_schema_key_column_usage.sql | 6 +- 4 files changed, 92 insertions(+), 21 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index 700fd6108f9e6..1495d2c37c51d 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -112,7 +112,9 @@ func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn ex if err != nil { return err } - + if len(definitions) == 0 { + return nil + } for _, definition := range definitions { updates, err := legacyForeignKeyMetadataUpdates(definition) if err != nil { diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index 896184cd9efea..5caa8e336dcb4 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -217,6 +217,43 @@ func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) } } +func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *testing.T) { + definitionResult := newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{ + { + database: "db", + table: "alter_child", + createSQL: "create table alter_child (a int, b int)", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_added_by_alter", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + {constraintName: "fk_added_by_alter", columnName: "b", referDBName: "db", referTableName: "parent", referColumnName: "b", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + }, + }, + { + database: "db", + table: "unnamed_child", + createSQL: "create table unnamed_child (parent_id int, foreign key (parent_id) references parent (id))", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "catalog-generated-name", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + }, + }, + }) + var updates []string + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + if sql == legacyForeignKeyTableDefinitionsSQL { + return definitionResult, nil + } + updates = append(updates, sql) + return executor.Result{}, nil + }) + + require.NoError(t, upgradeLegacyForeignKeyMetadata(context.Background(), 9, txnExecutor)) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'unnamed_child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", + }, updates) +} + func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { for _, createSQL := range []string{ "select 1", @@ -310,7 +347,32 @@ func newVersionTxnExecutor(t *testing.T, mocker func(string) (executor.Result, e } func newLegacyForeignKeyDefinitionResult(t *testing.T) executor.Result { + return newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{ + { + database: "db", + table: "child", + createSQL: "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_child_parent", columnName: "child_id", referDBName: "db", referTableName: "parent", referColumnName: "child_id", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + {constraintName: "fk_child_parent", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "parent_id", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + }, + }, + }) +} + +func newLegacyForeignKeyDefinitionResultForDefinitions(t *testing.T, definitions []legacyForeignKeyTableDefinition) executor.Result { t.Helper() + rows := make([]legacyForeignKeyTableDefinition, 0) + for _, definition := range definitions { + for _, foreignKey := range definition.foreignKeys { + rows = append(rows, legacyForeignKeyTableDefinition{ + database: definition.database, + table: definition.table, + createSQL: definition.createSQL, + foreignKeys: []legacyForeignKeyCatalogRow{foreignKey}, + }) + } + } mp := mpool.MustNewZeroNoFixed() t.Cleanup(func() { mpool.DeleteMPool(mp) }) result := executor.NewMemResult([]types.Type{ @@ -325,22 +387,22 @@ func newLegacyForeignKeyDefinitionResult(t *testing.T) executor.Result { types.T_varchar.ToType(), types.T_varchar.ToType(), }, mp) - result.NewBatchWithRowCount(2) - for column, values := range [][]string{ - {"db", "db"}, - {"child", "child"}, - { - "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", - "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", - }, - {"fk_child_parent", "fk_child_parent"}, - {"child_id", "parent_id"}, - {"db", "db"}, - {"parent", "parent"}, - {"child_id", "parent_id"}, - {"CASCADE", "CASCADE"}, - {"SET_NULL", "SET_NULL"}, - } { + result.NewBatchWithRowCount(len(rows)) + values := make([][]string, 10) + for _, row := range rows { + foreignKey := row.foreignKeys[0] + values[0] = append(values[0], row.database) + values[1] = append(values[1], row.table) + values[2] = append(values[2], row.createSQL) + values[3] = append(values[3], foreignKey.constraintName) + values[4] = append(values[4], foreignKey.columnName) + values[5] = append(values[5], foreignKey.referDBName) + values[6] = append(values[6], foreignKey.referTableName) + values[7] = append(values[7], foreignKey.referColumnName) + values[8] = append(values[8], foreignKey.onDelete) + values[9] = append(values[9], foreignKey.onUpdate) + } + for column, values := range values { if err := executor.AppendStringRows(result, column, values); err != nil { t.Fatalf("append legacy definition column %d: %v", column, err) } diff --git a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result index 9865137345fca..33bb07467a0f4 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result +++ b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.result @@ -24,21 +24,26 @@ parent_id int, parent_code int, foreign key (parent_id, parent_code) references parent(id, code) ); +create table restrict_alter_child (id int primary key, parent_id int, parent_code int); +alter table restrict_alter_child add constraint fk_metadata_alter_restrict foreign key (parent_id, parent_code) references parent(id, code) on delete restrict on update restrict; select TABLE_NAME as table_name, COLUMN_NAME as column_name, REFERENCED_TABLE_NAME as referenced_table_name, REFERENCED_COLUMN_NAME as referenced_column_name, ORDINAL_POSITION as ordinal_position from information_schema.KEY_COLUMN_USAGE -where TABLE_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +where TABLE_SCHEMA = database() and TABLE_NAME in ('alter_child', 'restrict_alter_child', 'unnamed_child') order by TABLE_NAME, ORDINAL_POSITION; ➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ referenced_table_name[12,-1,0] ¦ referenced_column_name[12,-1,0] ¦ ordinal_position[4,32,0] 𝄀 alter_child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 alter_child ¦ parent_code ¦ parent ¦ code ¦ 2 𝄀 +restrict_alter_child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 +restrict_alter_child ¦ parent_code ¦ parent ¦ code ¦ 2 𝄀 unnamed_child ¦ parent_id ¦ parent ¦ id ¦ 1 𝄀 unnamed_child ¦ parent_code ¦ parent ¦ code ¦ 2 select TABLE_NAME as table_name, UPDATE_RULE as update_rule, DELETE_RULE as delete_rule from information_schema.REFERENTIAL_CONSTRAINTS -where CONSTRAINT_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +where CONSTRAINT_SCHEMA = database() and TABLE_NAME in ('alter_child', 'restrict_alter_child', 'unnamed_child') order by TABLE_NAME; ➤ table_name[12,-1,0] ¦ update_rule[12,-1,0] ¦ delete_rule[12,-1,0] 𝄀 alter_child ¦ NO ACTION ¦ NO ACTION 𝄀 +restrict_alter_child ¦ RESTRICT ¦ RESTRICT 𝄀 unnamed_child ¦ NO ACTION ¦ NO ACTION desc information_schema.KEY_COLUMN_USAGE; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 diff --git a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql index 3538a6161c1b5..0fcdd49939585 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql +++ b/test/distributed/cases/foreign_key/fk_information_schema_key_column_usage.sql @@ -26,13 +26,15 @@ create table unnamed_child ( parent_code int, foreign key (parent_id, parent_code) references parent(id, code) ); +create table restrict_alter_child (id int primary key, parent_id int, parent_code int); +alter table restrict_alter_child add constraint fk_metadata_alter_restrict foreign key (parent_id, parent_code) references parent(id, code) on delete restrict on update restrict; select TABLE_NAME as table_name, COLUMN_NAME as column_name, REFERENCED_TABLE_NAME as referenced_table_name, REFERENCED_COLUMN_NAME as referenced_column_name, ORDINAL_POSITION as ordinal_position from information_schema.KEY_COLUMN_USAGE -where TABLE_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +where TABLE_SCHEMA = database() and TABLE_NAME in ('alter_child', 'restrict_alter_child', 'unnamed_child') order by TABLE_NAME, ORDINAL_POSITION; select TABLE_NAME as table_name, UPDATE_RULE as update_rule, DELETE_RULE as delete_rule from information_schema.REFERENTIAL_CONSTRAINTS -where CONSTRAINT_SCHEMA = database() and TABLE_NAME in ('alter_child', 'unnamed_child') +where CONSTRAINT_SCHEMA = database() and TABLE_NAME in ('alter_child', 'restrict_alter_child', 'unnamed_child') order by TABLE_NAME; desc information_schema.KEY_COLUMN_USAGE; show create table information_schema.KEY_COLUMN_USAGE; From 6819f5df36044f9db52a5ab732fd7c00cddb2115 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Mon, 3 Aug 2026 15:01:03 +0800 Subject: [PATCH 10/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 109 ++++++++++---- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 140 ++++++++++++------ 2 files changed, 173 insertions(+), 76 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index 1495d2c37c51d..96b78fc7759b8 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -71,24 +71,20 @@ func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, return nil } -const legacyForeignKeyTableDefinitionsSQL = "SELECT fk.db_name, fk.table_name, tbl.rel_createsql, " + +const legacyForeignKeyTableDefinitionsSQL = "SELECT fk.db_name, fk.table_name, " + "fk.constraint_name, fk.column_name, fk.refer_db_name, fk.refer_table_name, fk.refer_column_name, fk.on_delete, fk.on_update " + "FROM mo_catalog.mo_foreign_keys fk " + - "JOIN mo_catalog.mo_tables tbl ON tbl.reldatabase = fk.db_name AND tbl.relname = fk.table_name " + "WHERE fk.constraint_id = 0 " + "ORDER BY fk.db_name, fk.table_name, fk.constraint_name, fk.column_name" type legacyForeignKeyTableDefinition struct { database string table string - createSQL string foreignKeys []legacyForeignKeyCatalogRow } -// legacyForeignKeyCatalogRow is the durable source for foreign keys that do -// not occur in rel_createsql, such as constraints added by ALTER TABLE. It is -// also the source of the generated name for an unnamed CREATE TABLE foreign -// key, because rel_createsql precedes adjustConstraintName. +// legacyForeignKeyCatalogRow is the authoritative catalog source for the +// legacy foreign keys whose constraint_id has not yet been populated. type legacyForeignKeyCatalogRow struct { constraintName string columnName string @@ -104,9 +100,10 @@ type legacyForeignKeyCatalogConstraint struct { rows []legacyForeignKeyCatalogRow } -// upgradeLegacyForeignKeyMetadata restores zero-valued legacy FK ordinals. It -// uses the original CREATE statement when available and catalog rows for FKs -// added later with ALTER TABLE or named after the CREATE SQL was persisted. +// upgradeLegacyForeignKeyMetadata restores zero-valued legacy FK ordinals. The +// catalog identifies the rows to migrate, and SHOW CREATE TABLE supplies the +// current foreign-key declaration order and actions. In particular, do not use +// mo_tables.rel_createsql: it is a CREATE-time snapshot and omits later ALTERs. func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { definitions, err := getLegacyForeignKeyTableDefinitions(tenantID, txn) if err != nil { @@ -116,7 +113,11 @@ func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn ex return nil } for _, definition := range definitions { - updates, err := legacyForeignKeyMetadataUpdates(definition) + createSQL, err := getLegacyForeignKeyShowCreateSQL(tenantID, txn, definition) + if err != nil { + return err + } + updates, err := legacyForeignKeyMetadataUpdates(definition, createSQL) if err != nil { return err } @@ -150,19 +151,18 @@ func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecuto definitionIndex = len(definitions) definitionByTable[key] = definitionIndex definitions = append(definitions, legacyForeignKeyTableDefinition{ - database: database, - table: table, - createSQL: cols[2].GetStringAt(i), + database: database, + table: table, }) } definitions[definitionIndex].foreignKeys = append(definitions[definitionIndex].foreignKeys, legacyForeignKeyCatalogRow{ - constraintName: cols[3].GetStringAt(i), - columnName: cols[4].GetStringAt(i), - referDBName: cols[5].GetStringAt(i), - referTableName: cols[6].GetStringAt(i), - referColumnName: cols[7].GetStringAt(i), - onDelete: cols[8].GetStringAt(i), - onUpdate: cols[9].GetStringAt(i), + constraintName: cols[2].GetStringAt(i), + columnName: cols[3].GetStringAt(i), + referDBName: cols[4].GetStringAt(i), + referTableName: cols[5].GetStringAt(i), + referColumnName: cols[6].GetStringAt(i), + onDelete: cols[7].GetStringAt(i), + onUpdate: cols[8].GetStringAt(i), }) } return true @@ -170,8 +170,42 @@ func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecuto return definitions, nil } -func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) ([]string, error) { - statements, err := mysql.Parse(context.Background(), definition.createSQL, 1) +func getLegacyForeignKeyShowCreateSQL(tenantID int32, txn executor.TxnExecutor, definition legacyForeignKeyTableDefinition) (string, error) { + res, err := txn.Exec( + fmt.Sprintf("SHOW CREATE TABLE %s.%s", quoteSQLIdentifier(definition.database), quoteSQLIdentifier(definition.table)), + executor.StatementOption{}.WithAccountID(uint32(tenantID)), + ) + if err != nil { + return "", err + } + defer res.Close() + + var createSQL string + rowCount := 0 + validResult := true + res.ReadRows(func(rows int, cols []*vector.Vector) bool { + if len(cols) < 2 { + validResult = false + return false + } + for i := 0; i < rows; i++ { + rowCount++ + if rowCount != 1 { + validResult = false + return false + } + createSQL = cols[1].GetStringAt(i) + } + return true + }) + if !validResult || rowCount != 1 || createSQL == "" { + return "", moerr.NewInternalErrorNoCtxf("SHOW CREATE TABLE for legacy foreign-key table %s.%s returned an invalid result", definition.database, definition.table) + } + return createSQL, nil +} + +func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, createSQL string) ([]string, error) { + statements, err := mysql.Parse(context.Background(), createSQL, 1) if err != nil { return nil, moerr.NewInternalErrorNoCtxf("parse legacy foreign-key table %s.%s: %v", definition.database, definition.table, err) } @@ -201,14 +235,24 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) return nil, moerr.NewInternalErrorNoCtxf("legacy foreign key in %s.%s has incomplete persisted definition", definition.database, definition.table) } + // Match the current SHOW CREATE TABLE declaration to the catalog by both + // name and complete child/reference column set. The latter prevents a + // dropped and re-added constraint that reused its name from being matched + // to the old definition. if foreignKey.ConstraintSymbol != "" { - matchedConstraints[foreignKey.ConstraintSymbol] = true - updates = appendLegacyForeignKeyASTUpdates(updates, definition, foreignKey.ConstraintSymbol, foreignKey) + for _, constraint := range constraints { + if constraint.name == foreignKey.ConstraintSymbol && + sameLegacyForeignKeyColumns(definition.database, foreignKey, constraint.rows) { + matchedConstraints[constraint.name] = true + updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey) + break + } + } continue } - // An unnamed FK is assigned its UUID after rel_createsql is persisted. - // Match it to the catalog rows by its complete child/reference column set. + // An unnamed FK is assigned a generated name in the catalog. Match it to + // the catalog rows by its complete child/reference column set. // If that signature is ambiguous, leave every candidate to the catalog // fallback below rather than assigning one AST action to another FK. matchedIndex := -1 @@ -229,10 +273,9 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition) } } - // rel_createsql is the original CREATE snapshot, so it cannot describe FKs - // introduced by ALTER TABLE. The catalog rows remain authoritative for their - // generated name, actions, and column pairs; assign stable ordinals from the - // catalog order without rewriting the actions. + // The catalog remains authoritative when SHOW CREATE TABLE cannot be + // reconciled to an FK row. This is a defensive fallback for catalog drift; + // normal CREATE and ALTER paths are covered by the current SHOW output above. for _, constraint := range constraints { if matchedConstraints[constraint.name] { continue @@ -375,6 +418,10 @@ func quoteSQLStringLiteral(s string) string { return "'" + strings.NewReplacer(`\\`, `\\\\`, `'`, `''`).Replace(s) + "'" } +func quoteSQLIdentifier(s string) string { + return "`" + strings.ReplaceAll(s, "`", "``") + "`" +} + func (v *versionHandle) HandleClusterUpgrade(_ context.Context, txn executor.TxnExecutor) error { for _, entry := range clusterUpgEntries { start := time.Now() diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index 5caa8e336dcb4..26aae5dead973 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -62,13 +62,22 @@ func TestForeignKeyMetadataTenantUpgradeEntries(t *testing.T) { require.Contains(t, strings.ToLower(referentialConstraints.PreSql), "drop view if exists information_schema.referential_constraints") } +func TestLegacyForeignKeyMetadataQueryUsesForeignKeyCatalogOnly(t *testing.T) { + require.NotContains(t, strings.ToLower(legacyForeignKeyTableDefinitionsSQL), "rel_createsql") + require.NotContains(t, strings.ToLower(legacyForeignKeyTableDefinitionsSQL), "mo_tables") +} + func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ database: "db'one", table: "child", - createSQL: "create table child (a int, b int, constraint fk_default foreign key (b, a) references parent (b, a), " + - "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)", - }) + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_default", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a"}, + {constraintName: "fk_default", columnName: "b", referDBName: "db'one", referTableName: "parent", referColumnName: "b"}, + {constraintName: "fk_restrict", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a"}, + }, + }, "create table child (a int, b int, constraint fk_default foreign key (b, a) references parent (b, a), "+ + "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)") require.NoError(t, err) require.Len(t, updates, 3) @@ -200,6 +209,9 @@ func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) if sql == legacyForeignKeyTableDefinitionsSQL { return definitionResult, nil } + if sql == "SHOW CREATE TABLE `db`.`child`" { + return newShowCreateTableResult(t, "child", "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)"), nil + } updates = append(updates, sql) return executor.Result{}, nil }) @@ -220,20 +232,18 @@ func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *testing.T) { definitionResult := newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{ { - database: "db", - table: "alter_child", - createSQL: "create table alter_child (a int, b int)", + database: "db", + table: "alter_child", foreignKeys: []legacyForeignKeyCatalogRow{ {constraintName: "fk_added_by_alter", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "SET_NULL"}, {constraintName: "fk_added_by_alter", columnName: "b", referDBName: "db", referTableName: "parent", referColumnName: "b", onDelete: "CASCADE", onUpdate: "SET_NULL"}, }, }, { - database: "db", - table: "unnamed_child", - createSQL: "create table unnamed_child (parent_id int, foreign key (parent_id) references parent (id))", + database: "db", + table: "unnamed_child", foreignKeys: []legacyForeignKeyCatalogRow{ - {constraintName: "catalog-generated-name", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + {constraintName: "catalog_generated_name", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "NO_ACTION", onUpdate: "NO_ACTION"}, }, }, }) @@ -242,15 +252,21 @@ func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *t if sql == legacyForeignKeyTableDefinitionsSQL { return definitionResult, nil } + switch sql { + case "SHOW CREATE TABLE `db`.`alter_child`": + return newShowCreateTableResult(t, "alter_child", "create table alter_child (a int, b int, constraint fk_added_by_alter foreign key (b, a) references parent (b, a) on delete cascade on update set null)"), nil + case "SHOW CREATE TABLE `db`.`unnamed_child`": + return newShowCreateTableResult(t, "unnamed_child", "create table unnamed_child (parent_id int, constraint catalog_generated_name foreign key (parent_id) references parent (id))"), nil + } updates = append(updates, sql) return executor.Result{}, nil }) require.NoError(t, upgradeLegacyForeignKeyMetadata(context.Background(), 9, txnExecutor)) require.Equal(t, []string{ - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'unnamed_child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'unnamed_child' AND constraint_name = 'catalog_generated_name' AND column_name = 'parent_id'", }, updates) } @@ -261,10 +277,9 @@ func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { } { t.Run(createSQL, func(t *testing.T) { _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ - database: "db", - table: "child", - createSQL: createSQL, - }) + database: "db", + table: "child", + }, createSQL) if err == nil { t.Fatalf("expected invalid persisted definition to fail: %s", createSQL) } @@ -274,30 +289,42 @@ func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { func TestLegacyForeignKeyMetadataUpdatesBackfillAlterTableForeignKey(t *testing.T) { updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ - database: "db", - table: "child", - createSQL: "create table child (b int, a int)", + database: "db", + table: "child", foreignKeys: []legacyForeignKeyCatalogRow{ {constraintName: "fk_added_by_alter", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "SET_NULL"}, {constraintName: "fk_added_by_alter", columnName: "b", referDBName: "db", referTableName: "parent", referColumnName: "b", onDelete: "CASCADE", onUpdate: "SET_NULL"}, }, - }) + }, "create table child (b int, a int, constraint fk_added_by_alter foreign key (b, a) references parent (b, a) on delete cascade on update set null)") require.NoError(t, err) require.Equal(t, []string{ - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", + }, updates) +} + +func TestLegacyForeignKeyMetadataUpdatesDoNotMatchReusedConstraintName(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_reused", columnName: "b", referDBName: "db", referTableName: "parent", referColumnName: "b", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + }, + }, "create table child (a int, b int, constraint fk_reused foreign key (a) references parent (a))") + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_reused' AND column_name = 'b'", }, updates) } func TestLegacyForeignKeyMetadataUpdatesBackfillUnnamedForeignKey(t *testing.T) { updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ - database: "db", - table: "child", - createSQL: "create table child (parent_id int, foreign key (parent_id) references parent (id))", + database: "db", + table: "child", foreignKeys: []legacyForeignKeyCatalogRow{ {constraintName: "catalog-generated-name", columnName: "parent_id", referDBName: "", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, }, - }) + }, "create table child (parent_id int, foreign key (parent_id) references parent (id))") require.NoError(t, err) require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", @@ -306,14 +333,13 @@ func TestLegacyForeignKeyMetadataUpdatesBackfillUnnamedForeignKey(t *testing.T) func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalog(t *testing.T) { updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ - database: "db", - table: "child", - createSQL: "create table child (parent_id int, foreign key (parent_id) references parent (id))", + database: "db", + table: "child", foreignKeys: []legacyForeignKeyCatalogRow{ {constraintName: "catalog-fk-a", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "CASCADE", onUpdate: "CASCADE"}, {constraintName: "catalog-fk-b", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, }, - }) + }, "create table child (parent_id int, foreign key (parent_id) references parent (id))") require.NoError(t, err) require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'CASCADE' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-a' AND column_name = 'parent_id'", @@ -339,6 +365,17 @@ func TestReferenceActionName(t *testing.T) { } } +func TestLegacyForeignKeyShowCreateSQLQuotesIdentifiers(t *testing.T) { + definition := legacyForeignKeyTableDefinition{database: "db`name", table: "child`name"} + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + require.Equal(t, "SHOW CREATE TABLE `db``name`.`child``name`", sql) + return newShowCreateTableResult(t, "child`name", "create table `child``name` (id int)"), nil + }) + createSQL, err := getLegacyForeignKeyShowCreateSQL(9, txnExecutor, definition) + require.NoError(t, err) + require.Equal(t, "create table `child``name` (id int)", createSQL) +} + func newVersionTxnExecutor(t *testing.T, mocker func(string) (executor.Result, error)) executor.TxnExecutor { t.Helper() txnOperator := mock_frontend.NewMockTxnOperator(gomock.NewController(t)) @@ -349,9 +386,8 @@ func newVersionTxnExecutor(t *testing.T, mocker func(string) (executor.Result, e func newLegacyForeignKeyDefinitionResult(t *testing.T) executor.Result { return newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{ { - database: "db", - table: "child", - createSQL: "create table child (parent_id int, child_id int, constraint fk_child_parent foreign key (child_id, parent_id) references parent (child_id, parent_id) on delete cascade on update set null)", + database: "db", + table: "child", foreignKeys: []legacyForeignKeyCatalogRow{ {constraintName: "fk_child_parent", columnName: "child_id", referDBName: "db", referTableName: "parent", referColumnName: "child_id", onDelete: "CASCADE", onUpdate: "SET_NULL"}, {constraintName: "fk_child_parent", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "parent_id", onDelete: "CASCADE", onUpdate: "SET_NULL"}, @@ -368,7 +404,6 @@ func newLegacyForeignKeyDefinitionResultForDefinitions(t *testing.T, definitions rows = append(rows, legacyForeignKeyTableDefinition{ database: definition.database, table: definition.table, - createSQL: definition.createSQL, foreignKeys: []legacyForeignKeyCatalogRow{foreignKey}, }) } @@ -385,22 +420,20 @@ func newLegacyForeignKeyDefinitionResultForDefinitions(t *testing.T, definitions types.T_varchar.ToType(), types.T_varchar.ToType(), types.T_varchar.ToType(), - types.T_varchar.ToType(), }, mp) result.NewBatchWithRowCount(len(rows)) - values := make([][]string, 10) + values := make([][]string, 9) for _, row := range rows { foreignKey := row.foreignKeys[0] values[0] = append(values[0], row.database) values[1] = append(values[1], row.table) - values[2] = append(values[2], row.createSQL) - values[3] = append(values[3], foreignKey.constraintName) - values[4] = append(values[4], foreignKey.columnName) - values[5] = append(values[5], foreignKey.referDBName) - values[6] = append(values[6], foreignKey.referTableName) - values[7] = append(values[7], foreignKey.referColumnName) - values[8] = append(values[8], foreignKey.onDelete) - values[9] = append(values[9], foreignKey.onUpdate) + values[2] = append(values[2], foreignKey.constraintName) + values[3] = append(values[3], foreignKey.columnName) + values[4] = append(values[4], foreignKey.referDBName) + values[5] = append(values[5], foreignKey.referTableName) + values[6] = append(values[6], foreignKey.referColumnName) + values[7] = append(values[7], foreignKey.onDelete) + values[8] = append(values[8], foreignKey.onUpdate) } for column, values := range values { if err := executor.AppendStringRows(result, column, values); err != nil { @@ -409,3 +442,20 @@ func newLegacyForeignKeyDefinitionResultForDefinitions(t *testing.T, definitions } return result.GetResult() } + +func newShowCreateTableResult(t *testing.T, tableName, createSQL string) executor.Result { + t.Helper() + mp := mpool.MustNewZeroNoFixed() + t.Cleanup(func() { mpool.DeleteMPool(mp) }) + result := executor.NewMemResult([]types.Type{ + types.T_varchar.ToType(), + types.T_varchar.ToType(), + }, mp) + result.NewBatchWithRowCount(1) + for column, value := range []string{tableName, createSQL} { + if err := executor.AppendStringRows(result, column, []string{value}); err != nil { + t.Fatalf("append SHOW CREATE TABLE column %d: %v", column, err) + } + } + return result.GetResult() +} From f02b1029d1cf69d07cc3f9086b356f5de348161f Mon Sep 17 00:00:00 2001 From: daviszhen Date: Mon, 3 Aug 2026 15:42:48 +0800 Subject: [PATCH 11/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 62 +++++++++++-------- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 43 ++++++------- 2 files changed, 54 insertions(+), 51 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index 96b78fc7759b8..bd7c395010809 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -243,8 +243,12 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, for _, constraint := range constraints { if constraint.name == foreignKey.ConstraintSymbol && sameLegacyForeignKeyColumns(definition.database, foreignKey, constraint.rows) { + onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) + if err != nil { + return nil, err + } matchedConstraints[constraint.name] = true - updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey) + updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey, onDelete, onUpdate) break } } @@ -268,8 +272,12 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, } if matchedIndex >= 0 { constraint := constraints[matchedIndex] + onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) + if err != nil { + return nil, err + } matchedConstraints[constraint.name] = true - updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey) + updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey, onDelete, onUpdate) } } @@ -280,14 +288,18 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, if matchedConstraints[constraint.name] { continue } + onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) + if err != nil { + return nil, err + } for ordinal, row := range constraint.rows { updates = append(updates, legacyForeignKeyUpdateSQL( definition, constraint.name, row.columnName, ordinal+1, - legacyCatalogReferenceActionName(row.onDelete), - legacyCatalogReferenceActionName(row.onUpdate), + onDelete, + onUpdate, )) } } @@ -353,6 +365,7 @@ func appendLegacyForeignKeyASTUpdates( definition legacyForeignKeyTableDefinition, constraintName string, foreignKey *tree.ForeignKey, + onDelete, onUpdate string, ) []string { for ordinal, keyPart := range foreignKey.KeyParts { updates = append(updates, legacyForeignKeyUpdateSQL( @@ -360,13 +373,27 @@ func appendLegacyForeignKeyASTUpdates( constraintName, keyPart.ColName.ColName(), ordinal+1, - referenceActionName(foreignKey.Refer.OnDelete), - referenceActionName(foreignKey.Refer.OnUpdate), + onDelete, + onUpdate, )) } return updates } +func legacyForeignKeyCatalogConstraintActions(constraint legacyForeignKeyCatalogConstraint) (string, string, error) { + if len(constraint.rows) == 0 { + return "", "", moerr.NewInternalErrorNoCtxf("legacy foreign key %s has no catalog rows", constraint.name) + } + onDelete := legacyCatalogReferenceActionName(constraint.rows[0].onDelete) + onUpdate := legacyCatalogReferenceActionName(constraint.rows[0].onUpdate) + for _, row := range constraint.rows[1:] { + if legacyCatalogReferenceActionName(row.onDelete) != onDelete || legacyCatalogReferenceActionName(row.onUpdate) != onUpdate { + return "", "", moerr.NewInternalErrorNoCtxf("legacy foreign key %s has inconsistent catalog actions", constraint.name) + } + } + return onDelete, onUpdate, nil +} + func legacyForeignKeyUpdateSQL( definition legacyForeignKeyTableDefinition, constraintName, columnName string, @@ -387,9 +414,9 @@ func legacyForeignKeyUpdateSQL( } // Legacy rows with constraint_id = 0 were written before omitted foreign-key -// actions were represented as NO_ACTION. Without an ALTER statement snapshot, -// an omitted action and explicit RESTRICT are indistinguishable; keep the same -// MySQL-compatible NO_ACTION normalization used for CREATE-table backfill. +// actions were represented as NO_ACTION. SHOW CREATE TABLE renders an omitted +// action as RESTRICT, so it cannot recover that distinction either. Preserve +// the established legacy migration policy: normalize RESTRICT to NO_ACTION. func legacyCatalogReferenceActionName(action string) string { if strings.EqualFold(strings.TrimSpace(action), "RESTRICT") || strings.TrimSpace(action) == "" { return "NO_ACTION" @@ -397,23 +424,6 @@ func legacyCatalogReferenceActionName(action string) string { return action } -func referenceActionName(action tree.ReferenceOptionType) string { - switch action { - case tree.REFERENCE_OPTION_CASCADE: - return "CASCADE" - case tree.REFERENCE_OPTION_SET_NULL: - return "SET_NULL" - case tree.REFERENCE_OPTION_NO_ACTION: - return "NO_ACTION" - case tree.REFERENCE_OPTION_SET_DEFAULT: - return "SET_DEFAULT" - case tree.REFERENCE_OPTION_RESTRICT: - return "RESTRICT" - default: - return "NO_ACTION" - } -} - func quoteSQLStringLiteral(s string) string { return "'" + strings.NewReplacer(`\\`, `\\\\`, `'`, `''`).Replace(s) + "'" } diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index 26aae5dead973..0990f29746936 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -29,7 +29,6 @@ import ( mock_frontend "github.com/matrixorigin/matrixone/pkg/frontend/test" "github.com/matrixorigin/matrixone/pkg/pb/txn" "github.com/matrixorigin/matrixone/pkg/sql/mongodb" - "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree" "github.com/matrixorigin/matrixone/pkg/util/executor" "github.com/matrixorigin/matrixone/pkg/util/sysview" "github.com/stretchr/testify/require" @@ -72,9 +71,9 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { database: "db'one", table: "child", foreignKeys: []legacyForeignKeyCatalogRow{ - {constraintName: "fk_default", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a"}, - {constraintName: "fk_default", columnName: "b", referDBName: "db'one", referTableName: "parent", referColumnName: "b"}, - {constraintName: "fk_restrict", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a"}, + {constraintName: "fk_default", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a", onDelete: "NO_ACTION", onUpdate: "NO_ACTION"}, + {constraintName: "fk_default", columnName: "b", referDBName: "db'one", referTableName: "parent", referColumnName: "b", onDelete: "NO_ACTION", onUpdate: "NO_ACTION"}, + {constraintName: "fk_restrict", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, }, }, "create table child (a int, b int, constraint fk_default foreign key (b, a) references parent (b, a), "+ "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)") @@ -86,7 +85,7 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { "constraint_name = 'fk_default' AND column_name = 'b'", "constraint_id = 2, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", "constraint_name = 'fk_default' AND column_name = 'a'", - "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT'", + "constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", "constraint_name = 'fk_restrict' AND column_name = 'a'", "db_name = 'db''one'", } { @@ -243,7 +242,7 @@ func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *t database: "db", table: "unnamed_child", foreignKeys: []legacyForeignKeyCatalogRow{ - {constraintName: "catalog_generated_name", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "NO_ACTION", onUpdate: "NO_ACTION"}, + {constraintName: "catalog_generated_name", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, }, }, }) @@ -256,7 +255,7 @@ func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *t case "SHOW CREATE TABLE `db`.`alter_child`": return newShowCreateTableResult(t, "alter_child", "create table alter_child (a int, b int, constraint fk_added_by_alter foreign key (b, a) references parent (b, a) on delete cascade on update set null)"), nil case "SHOW CREATE TABLE `db`.`unnamed_child`": - return newShowCreateTableResult(t, "unnamed_child", "create table unnamed_child (parent_id int, constraint catalog_generated_name foreign key (parent_id) references parent (id))"), nil + return newShowCreateTableResult(t, "unnamed_child", "create table unnamed_child (parent_id int, constraint catalog_generated_name foreign key (parent_id) references parent (id) on delete restrict on update restrict)"), nil } updates = append(updates, sql) return executor.Result{}, nil @@ -303,6 +302,18 @@ func TestLegacyForeignKeyMetadataUpdatesBackfillAlterTableForeignKey(t *testing. }, updates) } +func TestLegacyForeignKeyMetadataUpdatesRejectInconsistentCatalogActions(t *testing.T) { + _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_child_parent", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "CASCADE"}, + {constraintName: "fk_child_parent", columnName: "b", referDBName: "db", referTableName: "parent", referColumnName: "b", onDelete: "SET_NULL", onUpdate: "CASCADE"}, + }, + }, "create table child (a int, b int, constraint fk_child_parent foreign key (a, b) references parent (a, b))") + require.ErrorContains(t, err, "inconsistent catalog actions") +} + func TestLegacyForeignKeyMetadataUpdatesDoNotMatchReusedConstraintName(t *testing.T) { updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ database: "db", @@ -347,24 +358,6 @@ func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalo }, updates) } -func TestReferenceActionName(t *testing.T) { - for _, test := range []struct { - action tree.ReferenceOptionType - want string - }{ - {tree.REFERENCE_OPTION_CASCADE, "CASCADE"}, - {tree.REFERENCE_OPTION_SET_NULL, "SET_NULL"}, - {tree.REFERENCE_OPTION_NO_ACTION, "NO_ACTION"}, - {tree.REFERENCE_OPTION_SET_DEFAULT, "SET_DEFAULT"}, - {tree.REFERENCE_OPTION_RESTRICT, "RESTRICT"}, - {tree.ReferenceOptionType(-1), "NO_ACTION"}, - } { - if got := referenceActionName(test.action); got != test.want { - t.Fatalf("referenceActionName(%d) = %q, want %q", test.action, got, test.want) - } - } -} - func TestLegacyForeignKeyShowCreateSQLQuotesIdentifiers(t *testing.T) { definition := legacyForeignKeyTableDefinition{database: "db`name", table: "child`name"} txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { From 700975eb17247e1c9d716fb28c62c16a40db3a7d Mon Sep 17 00:00:00 2001 From: daviszhen Date: Mon, 3 Aug 2026 16:07:35 +0800 Subject: [PATCH 12/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 62 ++++++++-------- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 74 +++++++++++++++++++ 2 files changed, 105 insertions(+), 31 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index bd7c395010809..c3516d0c5919c 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -25,6 +25,7 @@ import ( "github.com/matrixorigin/matrixone/pkg/bootstrap/versions" "github.com/matrixorigin/matrixone/pkg/catalog" "github.com/matrixorigin/matrixone/pkg/common/moerr" + "github.com/matrixorigin/matrixone/pkg/common/sqlquote" "github.com/matrixorigin/matrixone/pkg/container/vector" "github.com/matrixorigin/matrixone/pkg/sql/parsers/dialect/mysql" "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree" @@ -101,9 +102,10 @@ type legacyForeignKeyCatalogConstraint struct { } // upgradeLegacyForeignKeyMetadata restores zero-valued legacy FK ordinals. The -// catalog identifies the rows to migrate, and SHOW CREATE TABLE supplies the -// current foreign-key declaration order and actions. In particular, do not use -// mo_tables.rel_createsql: it is a CREATE-time snapshot and omits later ALTERs. +// catalog identifies the rows and actions to migrate, and SHOW CREATE TABLE +// supplies the current foreign-key declaration name and column order. In +// particular, do not use mo_tables.rel_createsql: it is a CREATE-time snapshot +// and omits later ALTERs. func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { definitions, err := getLegacyForeignKeyTableDefinitions(tenantID, txn) if err != nil { @@ -172,7 +174,7 @@ func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecuto func getLegacyForeignKeyShowCreateSQL(tenantID int32, txn executor.TxnExecutor, definition legacyForeignKeyTableDefinition) (string, error) { res, err := txn.Exec( - fmt.Sprintf("SHOW CREATE TABLE %s.%s", quoteSQLIdentifier(definition.database), quoteSQLIdentifier(definition.table)), + fmt.Sprintf("SHOW CREATE TABLE %s", sqlquote.QualifiedIdent(definition.database, definition.table)), executor.StatementOption{}.WithAccountID(uint32(tenantID)), ) if err != nil { @@ -281,27 +283,33 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, } } - // The catalog remains authoritative when SHOW CREATE TABLE cannot be - // reconciled to an FK row. This is a defensive fallback for catalog drift; - // normal CREATE and ALTER paths are covered by the current SHOW output above. + // A one-column FK needs no declaration-order recovery. For a composite FK, + // constraint_id is the only stored order and legacy rows have it zero; never + // fabricate an ordinal by sorting catalog column names when SHOW CREATE TABLE + // cannot be reconciled. for _, constraint := range constraints { if matchedConstraints[constraint.name] { continue } + if len(constraint.rows) != 1 { + return nil, moerr.NewInternalErrorNoCtxf( + "cannot reconcile column order for legacy composite foreign key %s in %s.%s", + constraint.name, definition.database, definition.table, + ) + } onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) if err != nil { return nil, err } - for ordinal, row := range constraint.rows { - updates = append(updates, legacyForeignKeyUpdateSQL( - definition, - constraint.name, - row.columnName, - ordinal+1, - onDelete, - onUpdate, - )) - } + row := constraint.rows[0] + updates = append(updates, legacyForeignKeyUpdateSQL( + definition, + constraint.name, + row.columnName, + 1, + onDelete, + onUpdate, + )) } return updates, nil } @@ -404,12 +412,12 @@ func legacyForeignKeyUpdateSQL( "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s "+ "WHERE constraint_id = 0 AND db_name = %s AND table_name = %s AND constraint_name = %s AND column_name = %s", ordinal, - quoteSQLStringLiteral(onDelete), - quoteSQLStringLiteral(onUpdate), - quoteSQLStringLiteral(definition.database), - quoteSQLStringLiteral(definition.table), - quoteSQLStringLiteral(constraintName), - quoteSQLStringLiteral(columnName), + sqlquote.String(onDelete), + sqlquote.String(onUpdate), + sqlquote.String(definition.database), + sqlquote.String(definition.table), + sqlquote.String(constraintName), + sqlquote.String(columnName), ) } @@ -424,14 +432,6 @@ func legacyCatalogReferenceActionName(action string) string { return action } -func quoteSQLStringLiteral(s string) string { - return "'" + strings.NewReplacer(`\\`, `\\\\`, `'`, `''`).Replace(s) + "'" -} - -func quoteSQLIdentifier(s string) string { - return "`" + strings.ReplaceAll(s, "`", "``") + "`" -} - func (v *versionHandle) HandleClusterUpgrade(_ context.Context, txn executor.TxnExecutor) error { for _, entry := range clusterUpgEntries { start := time.Now() diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index 0990f29746936..b9a519212e0d1 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -328,6 +328,66 @@ func TestLegacyForeignKeyMetadataUpdatesDoNotMatchReusedConstraintName(t *testin }, updates) } +func TestLegacyForeignKeyMetadataUpdatesEscapeCatalogIdentifiers(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: `db\name`, + table: `child\name`, + foreignKeys: []legacyForeignKeyCatalogRow{ + { + constraintName: `fk\' OR 1=1 -- `, + columnName: `child\column`, + referDBName: `db\name`, + referTableName: `parent\name`, + referColumnName: `id\column`, + onDelete: "CASCADE", + onUpdate: "SET_NULL", + }, + }, + }, "create table `child\\name` (`child\\column` int, constraint `fk\\' OR 1=1 -- ` foreign key (`child\\column`) references `parent\\name` (`id\\column`))") + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' " + + "WHERE constraint_id = 0 AND db_name = 'db\\\\name' AND table_name = 'child\\\\name' " + + "AND constraint_name = 'fk\\\\'' OR 1=1 -- ' AND column_name = 'child\\\\column'", + }, updates) +} + +func TestLegacyForeignKeyMetadataUpdatesEscapeTrailingBackslashIdentifiers(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db\\", + table: "child\\", + foreignKeys: []legacyForeignKeyCatalogRow{ + { + constraintName: "fk\\", + columnName: "child\\", + referDBName: "db\\", + referTableName: "parent\\", + referColumnName: "id\\", + onDelete: "CASCADE", + onUpdate: "SET_NULL", + }, + }, + }, "create table `child\\` (`child\\` int, constraint `fk\\` foreign key (`child\\`) references `parent\\` (`id\\`))") + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' " + + "WHERE constraint_id = 0 AND db_name = 'db\\\\' AND table_name = 'child\\\\' " + + "AND constraint_name = 'fk\\\\' AND column_name = 'child\\\\'", + }, updates) +} + +func TestLegacyForeignKeyMetadataUpdatesRejectUnmatchedCompositeForeignKey(t *testing.T) { + _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_legacy", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + {constraintName: "fk_legacy", columnName: "z", referDBName: "db", referTableName: "parent", referColumnName: "z", onDelete: "CASCADE", onUpdate: "SET_NULL"}, + }, + }, "create table child (a int, z int, constraint fk_legacy foreign key (a, z) references parent (z, a))") + require.ErrorContains(t, err, "cannot reconcile column order") +} + func TestLegacyForeignKeyMetadataUpdatesBackfillUnnamedForeignKey(t *testing.T) { updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ database: "db", @@ -358,6 +418,20 @@ func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalo }, updates) } +func TestLegacyForeignKeyMetadataUpdatesRejectAmbiguousUnnamedCompositeForeignKeys(t *testing.T) { + _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "catalog-fk-a", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "CASCADE"}, + {constraintName: "catalog-fk-a", columnName: "z", referDBName: "db", referTableName: "parent", referColumnName: "z", onDelete: "CASCADE", onUpdate: "CASCADE"}, + {constraintName: "catalog-fk-b", columnName: "a", referDBName: "db", referTableName: "parent", referColumnName: "a", onDelete: "CASCADE", onUpdate: "CASCADE"}, + {constraintName: "catalog-fk-b", columnName: "z", referDBName: "db", referTableName: "parent", referColumnName: "z", onDelete: "CASCADE", onUpdate: "CASCADE"}, + }, + }, "create table child (a int, z int, foreign key (z, a) references parent (z, a))") + require.ErrorContains(t, err, "cannot reconcile column order") +} + func TestLegacyForeignKeyShowCreateSQLQuotesIdentifiers(t *testing.T) { definition := legacyForeignKeyTableDefinition{database: "db`name", table: "child`name"} txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { From 5c3fbad37891d20e6e3c9b52e0a68bb1d03426e5 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Mon, 3 Aug 2026 19:18:46 +0800 Subject: [PATCH 13/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 19 ++++++++-------- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 22 +++++++++++++++---- pkg/util/sysview/predefined.go | 17 ++++++++++---- pkg/util/sysview/predefined_test.go | 22 +++++++++++++++++-- .../fk_information_schema_metadata.result | 14 ++++++------ .../fk_information_schema_metadata.sql | 6 ++--- 6 files changed, 71 insertions(+), 29 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index c3516d0c5919c..e5e8da7f3c675 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -102,10 +102,8 @@ type legacyForeignKeyCatalogConstraint struct { } // upgradeLegacyForeignKeyMetadata restores zero-valued legacy FK ordinals. The -// catalog identifies the rows and actions to migrate, and SHOW CREATE TABLE -// supplies the current foreign-key declaration name and column order. In -// particular, do not use mo_tables.rel_createsql: it is a CREATE-time snapshot -// and omits later ALTERs. +// catalog identifies the rows and actions to migrate, while SHOW CREATE TABLE +// supplies the current foreign-key declaration name and column order. func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { definitions, err := getLegacyForeignKeyTableDefinitions(tenantID, txn) if err != nil { @@ -421,12 +419,15 @@ func legacyForeignKeyUpdateSQL( ) } -// Legacy rows with constraint_id = 0 were written before omitted foreign-key -// actions were represented as NO_ACTION. SHOW CREATE TABLE renders an omitted -// action as RESTRICT, so it cannot recover that distinction either. Preserve -// the established legacy migration policy: normalize RESTRICT to NO_ACTION. +// The catalog is the authoritative action source. SHOW CREATE TABLE is used +// only to reconcile the current constraint declaration and its column order: +// it can render an omitted action and an explicit RESTRICT identically. Keep a +// catalog RESTRICT unchanged, which preserves explicit legacy actions and is +// the conservative policy when an ALTER-added or unnamed constraint cannot be +// distinguished from an omitted action. func legacyCatalogReferenceActionName(action string) string { - if strings.EqualFold(strings.TrimSpace(action), "RESTRICT") || strings.TrimSpace(action) == "" { + action = strings.TrimSpace(action) + if action == "" { return "NO_ACTION" } return action diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index fb41b46061976..a544e328c8b6a 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -87,7 +87,7 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { "constraint_name = 'fk_default' AND column_name = 'b'", "constraint_id = 2, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", "constraint_name = 'fk_default' AND column_name = 'a'", - "constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", + "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT'", "constraint_name = 'fk_restrict' AND column_name = 'a'", "db_name = 'db''one'", } { @@ -266,7 +266,7 @@ func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *t require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'unnamed_child' AND constraint_name = 'catalog_generated_name' AND column_name = 'parent_id'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'unnamed_child' AND constraint_name = 'catalog_generated_name' AND column_name = 'parent_id'", }, updates) } @@ -303,6 +303,20 @@ func TestLegacyForeignKeyMetadataUpdatesBackfillAlterTableForeignKey(t *testing. }, updates) } +func TestLegacyForeignKeyMetadataUpdatesPreservesRestrictForAlterFallback(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_added_by_alter", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + }, + }, "create table child (parent_id int)") + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'parent_id'", + }, updates) +} + func TestLegacyForeignKeyMetadataUpdatesRejectInconsistentCatalogActions(t *testing.T) { _, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ database: "db", @@ -399,7 +413,7 @@ func TestLegacyForeignKeyMetadataUpdatesBackfillUnnamedForeignKey(t *testing.T) }, "create table child (parent_id int, foreign key (parent_id) references parent (id))") require.NoError(t, err) require.Equal(t, []string{ - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", }, updates) } @@ -415,7 +429,7 @@ func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalo require.NoError(t, err) require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'CASCADE' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-a' AND column_name = 'parent_id'", - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-b' AND column_name = 'parent_id'", + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-b' AND column_name = 'parent_id'", }, updates) } diff --git a/pkg/util/sysview/predefined.go b/pkg/util/sysview/predefined.go index 024c5acfe2fe2..51db6ac514a0d 100644 --- a/pkg/util/sysview/predefined.go +++ b/pkg/util/sysview/predefined.go @@ -410,16 +410,25 @@ var ( "fk.constraint_name AS CONSTRAINT_NAME, " + "'def' AS UNIQUE_CONSTRAINT_CATALOG, " + "fk.refer_db_name AS UNIQUE_CONSTRAINT_SCHEMA, " + - "min(idx.type) AS UNIQUE_CONSTRAINT_NAME," + + "idx.name AS UNIQUE_CONSTRAINT_NAME," + "'NONE' AS MATCH_OPTION, " + "replace(fk.on_update, '_', ' ') AS UPDATE_RULE, " + "replace(fk.on_delete, '_', ' ') AS DELETE_RULE, " + "fk.table_name AS TABLE_NAME, " + "fk.refer_table_name AS REFERENCED_TABLE_NAME " + - "FROM mo_catalog.mo_foreign_keys fk " + + "FROM (" + + "SELECT db_name, table_name, constraint_name, refer_db_name, refer_table_name, on_update, on_delete, " + + "group_concat(concat(constraint_id, ':', length(refer_column_name), ':', refer_column_name) order by constraint_id) AS referenced_columns " + + "FROM mo_catalog.mo_foreign_keys " + + "GROUP BY db_name, table_name, constraint_name, refer_db_name, refer_table_name, on_update, on_delete" + + ") fk " + "JOIN mo_catalog.mo_tables tbl ON (tbl.reldatabase = fk.refer_db_name AND tbl.relname = fk.refer_table_name AND tbl.account_id = current_account_id()) " + - "JOIN mo_catalog.mo_indexes idx ON (idx.table_id = tbl.rel_id AND idx.column_name = fk.refer_column_name) " + - "GROUP BY fk.db_name, fk.constraint_name, fk.refer_db_name, fk.on_update, fk.on_delete, fk.table_name, fk.refer_table_name" + "JOIN (" + + "SELECT table_id, name, group_concat(concat(ordinal_position, ':', length(column_name), ':', column_name) order by ordinal_position) AS indexed_columns " + + "FROM mo_catalog.mo_indexes " + + "WHERE type = 'PRIMARY' OR type = 'UNIQUE' " + + "GROUP BY table_id, name" + + ") idx ON (idx.table_id = tbl.rel_id AND idx.indexed_columns = fk.referenced_columns)" InformationSchemaEnginesDDL = "CREATE TABLE information_schema.ENGINES (" + "ENGINE varchar(64)," + diff --git a/pkg/util/sysview/predefined_test.go b/pkg/util/sysview/predefined_test.go index 92f407b4b0088..3fe480ad28faa 100644 --- a/pkg/util/sysview/predefined_test.go +++ b/pkg/util/sysview/predefined_test.go @@ -15,12 +15,14 @@ package sysview import ( + "context" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/matrixorigin/matrixone/pkg/catalog" + "github.com/matrixorigin/matrixone/pkg/sql/parsers/dialect/mysql" ) func TestInformationSchemaMetadataViewsHideTemporaryTables(t *testing.T) { @@ -80,6 +82,22 @@ func TestInformationSchemaReferentialConstraintsDDL_UsesMySQLDefaultAction(t *te assert.Contains(t, InformationSchemaReferentialConstraintsDDL, "tbl.reldatabase = fk.refer_db_name AND tbl.relname = fk.refer_table_name") assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "idx.table_id = tbl.rel_id AND idx.column_name = fk.refer_column_name") - assert.Contains(t, InformationSchemaReferentialConstraintsDDL, "GROUP BY fk.db_name, fk.constraint_name") + "idx.table_id = tbl.rel_id AND idx.indexed_columns = fk.referenced_columns") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "group_concat(concat(constraint_id, ':', length(refer_column_name), ':', refer_column_name) order by constraint_id) AS referenced_columns") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "group_concat(concat(ordinal_position, ':', length(column_name), ':', column_name) order by ordinal_position) AS indexed_columns") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "WHERE type = 'PRIMARY' OR type = 'UNIQUE'") + assert.Contains(t, InformationSchemaReferentialConstraintsDDL, + "idx.name AS UNIQUE_CONSTRAINT_NAME") + assert.NotContains(t, InformationSchemaReferentialConstraintsDDL, "min(idx.type)") +} + +func TestInformationSchemaReferentialConstraintsDDL_Parses(t *testing.T) { + statements, err := mysql.Parse(context.Background(), InformationSchemaReferentialConstraintsDDL, 1) + assert.NoError(t, err) + for _, statement := range statements { + statement.Free() + } } diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result index 3a8e76e4f7da5..b377e2b578050 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result @@ -1,8 +1,8 @@ drop database if exists mysql_compat_model11_min2; create database mysql_compat_model11_min2; use mysql_compat_model11_min2; -create table p (id int primary key); -create table p_compound (id int, code int, primary key (id, code)); +create table p (id int primary key, key p_secondary (id)); +create table p_compound (id int, code int, unique key uq_p_compound (id, code), key p_compound_secondary (id, code)); create table unrelated (id int, unique key unrelated_id (id)); create table c ( id int primary key, @@ -14,14 +14,14 @@ constraint fk_c_p foreign key (parent_id) references p(id), constraint fk_c_p_compound foreign key (compound_parent_id, parent_code) references p_compound(id, code), constraint fk_c_p_restrict foreign key (restrict_parent_id) references p(id) on delete restrict on update restrict ); -select constraint_name, delete_rule, update_rule +select constraint_name, unique_constraint_name, delete_rule, update_rule from information_schema.referential_constraints where constraint_schema = database() order by constraint_name; -➤ constraint_name[12,-1,0] ¦ delete_rule[12,-1,0] ¦ update_rule[12,-1,0] 𝄀 -fk_c_p ¦ NO ACTION ¦ NO ACTION 𝄀 -fk_c_p_compound ¦ NO ACTION ¦ NO ACTION 𝄀 -fk_c_p_restrict ¦ RESTRICT ¦ RESTRICT +➤ constraint_name[12,-1,0] ¦ unique_constraint_name[12,-1,0] ¦ delete_rule[12,-1,0] ¦ update_rule[12,-1,0] 𝄀 +fk_c_p ¦ PRIMARY ¦ NO ACTION ¦ NO ACTION 𝄀 +fk_c_p_compound ¦ uq_p_compound ¦ NO ACTION ¦ NO ACTION 𝄀 +fk_c_p_restrict ¦ PRIMARY ¦ RESTRICT ¦ RESTRICT select count(*) as referential_constraint_count from information_schema.referential_constraints where constraint_schema = database(); diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql index 9bc53133d56ad..4fa098033d746 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql @@ -3,8 +3,8 @@ drop database if exists mysql_compat_model11_min2; create database mysql_compat_model11_min2; use mysql_compat_model11_min2; -create table p (id int primary key); -create table p_compound (id int, code int, primary key (id, code)); +create table p (id int primary key, key p_secondary (id)); +create table p_compound (id int, code int, unique key uq_p_compound (id, code), key p_compound_secondary (id, code)); create table unrelated (id int, unique key unrelated_id (id)); create table c ( id int primary key, @@ -17,7 +17,7 @@ create table c ( constraint fk_c_p_restrict foreign key (restrict_parent_id) references p(id) on delete restrict on update restrict ); -select constraint_name, delete_rule, update_rule +select constraint_name, unique_constraint_name, delete_rule, update_rule from information_schema.referential_constraints where constraint_schema = database() order by constraint_name; From faedfbdb0cfc646072bcab954dc6201df8afe75a Mon Sep 17 00:00:00 2001 From: daviszhen Date: Tue, 4 Aug 2026 10:35:01 +0800 Subject: [PATCH 14/24] update --- .../versions/v4_0_6/tenant_upgrade_list.go | 16 + pkg/bootstrap/versions/v4_0_6/upgrade.go | 232 +- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 139 +- pkg/frontend/predefined.go | 3 + pkg/pb/plan/plan.pb.go | 1986 +++++++++-------- pkg/sql/compile/ddl.go | 30 +- pkg/sql/plan/build_ddl.go | 165 +- pkg/sql/plan/build_ddl_test.go | 91 + pkg/sql/plan/build_dml_util.go | 74 +- pkg/sql/plan/build_dml_util_test.go | 24 +- pkg/sql/plan/deepcopy.go | 15 +- pkg/util/sysview/predefined.go | 16 +- pkg/util/sysview/predefined_test.go | 14 +- proto/plan.proto | 14 + .../fk_information_schema_metadata.result | 9 + .../fk_information_schema_metadata.sql | 6 + 16 files changed, 1739 insertions(+), 1095 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go b/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go index 66d1e9e246c5b..2b400f90c1bf9 100644 --- a/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go +++ b/pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go @@ -26,10 +26,26 @@ import ( var tenantUpgEntries = []versions.UpgradeEntry{ newMongoDBCatalogTable(mongodb.TableConnections, mongodb.ConnectionsDDL), newMongoDBCatalogTable(mongodb.TableMappings, mongodb.MappingsDDL), + addForeignKeyMetadataColumn("referenced_index_name", "varchar(5000) not null default ''", "on_update"), + addForeignKeyMetadataColumn("on_delete_origin", "varchar(64) not null default 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'", "referenced_index_name"), + addForeignKeyMetadataColumn("on_update_origin", "varchar(64) not null default 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'", "on_delete_origin"), upgradeInformationSchemaKeyColumnUsage(), upgradeInformationSchemaReferentialConstraints(), } +func addForeignKeyMetadataColumn(column, definition, after string) versions.UpgradeEntry { + return versions.UpgradeEntry{ + Schema: catalog.MO_CATALOG, + TableName: catalog.MOForeignKeys, + UpgType: versions.ADD_COLUMN, + UpgSql: fmt.Sprintf("alter table %s.%s add column %s %s after %s", catalog.MO_CATALOG, catalog.MOForeignKeys, column, definition, after), + CheckFunc: func(txn executor.TxnExecutor, accountID uint32) (bool, error) { + columnInfo, err := versions.CheckTableColumn(txn, accountID, catalog.MO_CATALOG, catalog.MOForeignKeys, column) + return columnInfo.IsExits, err + }, + } +} + func newMongoDBCatalogTable(name, ddl string) versions.UpgradeEntry { return versions.UpgradeEntry{ Schema: catalog.MO_CATALOG, diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index e5e8da7f3c675..8676a1324279d 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -54,10 +54,6 @@ func (v *versionHandle) Prepare(_ context.Context, txn executor.TxnExecutor, _ b } func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { - if err := upgradeLegacyForeignKeyMetadata(ctx, tenantID, txn); err != nil { - return err - } - for _, entry := range tenantUpgEntries { start := time.Now() if err := entry.Upgrade(txn, uint32(tenantID)); err != nil { @@ -68,6 +64,9 @@ func (v *versionHandle) HandleTenantUpgrade(ctx context.Context, tenantID int32, getLogger(txn.Txn().TxnOptions().CN).Info("tenant upgrade entry complete", zap.String("upgrade entry", entry.String()), zap.Int64("time cost(ms)", time.Since(start).Milliseconds()), zap.String("toVersion", v.metadata.Version)) } + if err := upgradeLegacyForeignKeyMetadata(ctx, tenantID, txn); err != nil { + return err + } getLogger(txn.Txn().TxnOptions().CN).Info("tenant upgrade success", zap.Int32("tenantId", tenantID), zap.String("toVersion", v.metadata.Version)) return nil } @@ -78,6 +77,17 @@ const legacyForeignKeyTableDefinitionsSQL = "SELECT fk.db_name, fk.table_name, " "WHERE fk.constraint_id = 0 " + "ORDER BY fk.db_name, fk.table_name, fk.constraint_name, fk.column_name" +// legacyForeignKeyReferencedIndexDefinitionsSQL intentionally has a broader +// predicate than legacyForeignKeyTableDefinitionsSQL. Older upgrades may have +// assigned constraint_id while leaving the referenced key absent, so every FK +// whose new metadata column is empty must be reconciled with current catalog +// state. +const legacyForeignKeyReferencedIndexDefinitionsSQL = "SELECT fk.db_name, fk.table_name, " + + "fk.constraint_name, fk.column_name, fk.refer_db_name, fk.refer_table_name, fk.refer_column_name, fk.on_delete, fk.on_update " + + "FROM mo_catalog.mo_foreign_keys fk " + + "WHERE fk.referenced_index_name = '' " + + "ORDER BY fk.db_name, fk.table_name, fk.constraint_name, fk.column_name" + type legacyForeignKeyTableDefinition struct { database string table string @@ -105,15 +115,33 @@ type legacyForeignKeyCatalogConstraint struct { // catalog identifies the rows and actions to migrate, while SHOW CREATE TABLE // supplies the current foreign-key declaration name and column order. func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { - definitions, err := getLegacyForeignKeyTableDefinitions(tenantID, txn) + ordinalDefinitions, err := getLegacyForeignKeyTableDefinitions(legacyForeignKeyTableDefinitionsSQL, tenantID, txn) if err != nil { return err } - if len(definitions) == 0 { - return nil + referencedIndexDefinitions, err := getLegacyForeignKeyTableDefinitions(legacyForeignKeyReferencedIndexDefinitionsSQL, tenantID, txn) + if err != nil { + return err } - for _, definition := range definitions { + + showCreateByTable := make(map[string]string) + getShowCreate := func(definition legacyForeignKeyTableDefinition) (string, error) { + key := definition.database + "\x00" + definition.table + if createSQL, ok := showCreateByTable[key]; ok { + return createSQL, nil + } createSQL, err := getLegacyForeignKeyShowCreateSQL(tenantID, txn, definition) + if err != nil { + return "", err + } + showCreateByTable[key] = createSQL + return createSQL, nil + } + + // constraint_id and action origins have a legacy zero-value sentinel, so + // only those rows need the ordinal/action migration. + for _, definition := range ordinalDefinitions { + createSQL, err := getShowCreate(definition) if err != nil { return err } @@ -129,11 +157,184 @@ func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn ex res.Close() } } + + // referenced_index_name is independent of the legacy ordinal sentinel. + // Backfill it for both zero-ordinal rows and already-numbered historical + // rows, without reinterpreting their action metadata. + for _, definition := range referencedIndexDefinitions { + createSQL, err := getShowCreate(definition) + if err != nil { + return err + } + referencedKeys, err := legacyForeignKeyReferencedKeys(definition, createSQL) + if err != nil { + return err + } + for constraintName, key := range referencedKeys { + indexName, err := getLegacyForeignKeyReferencedIndexName(tenantID, txn, key) + if err != nil { + return err + } + if indexName == "" { + continue + } + res, err := txn.Exec(legacyForeignKeyReferencedIndexUpdateSQL(definition, constraintName, indexName), executor.StatementOption{}.WithAccountID(uint32(tenantID))) + if err != nil { + return err + } + res.Close() + } + } return nil } -func getLegacyForeignKeyTableDefinitions(tenantID int32, txn executor.TxnExecutor) ([]legacyForeignKeyTableDefinition, error) { - res, err := txn.Exec(legacyForeignKeyTableDefinitionsSQL, executor.StatementOption{}.WithAccountID(uint32(tenantID))) +type legacyForeignKeyReferencedKey struct { + database string + table string + columns []string +} + +// legacyForeignKeyReferencedKeys reconciles the current SHOW CREATE output +// with catalog constraints. It never reads rel_createsql: ALTER-added FKs are +// deliberately matched by their current child/reference column pairs. +func legacyForeignKeyReferencedKeys(definition legacyForeignKeyTableDefinition, createSQL string) (map[string]legacyForeignKeyReferencedKey, error) { + statements, err := mysql.Parse(context.Background(), createSQL, 1) + if err != nil { + return nil, moerr.NewInternalErrorNoCtxf("parse legacy foreign-key table %s.%s: %v", definition.database, definition.table, err) + } + defer func() { + for _, statement := range statements { + statement.Free() + } + }() + if len(statements) != 1 { + return nil, moerr.NewInternalErrorNoCtxf("legacy foreign-key table %s.%s has %d statements", definition.database, definition.table, len(statements)) + } + createTable, ok := statements[0].(*tree.CreateTable) + if !ok { + return nil, moerr.NewInternalErrorNoCtxf("legacy foreign-key table %s.%s does not have a CREATE TABLE definition", definition.database, definition.table) + } + + constraints := legacyForeignKeyCatalogConstraints(definition.foreignKeys) + matched := make(map[string]bool) + keys := make(map[string]legacyForeignKeyReferencedKey) + for _, tableDef := range createTable.Defs { + foreignKey, ok := tableDef.(*tree.ForeignKey) + if !ok || foreignKey.Refer == nil { + continue + } + matchedIndex := -1 + for i, constraint := range constraints { + if matched[constraint.name] || !sameLegacyForeignKeyColumns(definition.database, foreignKey, constraint.rows) { + continue + } + if foreignKey.ConstraintSymbol != "" && foreignKey.ConstraintSymbol != constraint.name { + continue + } + if matchedIndex >= 0 { + matchedIndex = -1 + break + } + matchedIndex = i + } + if matchedIndex < 0 { + continue + } + constraint := constraints[matchedIndex] + matched[constraint.name] = true + database := definition.database + if foreignKey.Refer.TableName.SchemaName != "" { + database = string(foreignKey.Refer.TableName.SchemaName) + } + columns := make([]string, len(foreignKey.Refer.KeyParts)) + for i, keyPart := range foreignKey.Refer.KeyParts { + columns[i] = keyPart.ColName.ColName() + } + keys[constraint.name] = legacyForeignKeyReferencedKey{ + database: database, + table: string(foreignKey.Refer.TableName.ObjectName), + columns: columns, + } + } + for _, constraint := range constraints { + if matched[constraint.name] || len(constraint.rows) != 1 { + continue + } + row := constraint.rows[0] + database := row.referDBName + if database == "" { + database = definition.database + } + keys[constraint.name] = legacyForeignKeyReferencedKey{database: database, table: row.referTableName, columns: []string{row.referColumnName}} + } + return keys, nil +} + +func getLegacyForeignKeyReferencedIndexName(tenantID int32, txn executor.TxnExecutor, key legacyForeignKeyReferencedKey) (string, error) { + query := fmt.Sprintf( + "SELECT idx.name, idx.type, idx.ordinal_position, idx.column_name FROM mo_catalog.mo_indexes idx "+ + "JOIN mo_catalog.mo_tables tbl ON idx.table_id = tbl.rel_id "+ + "WHERE tbl.account_id = %d AND tbl.reldatabase = %s AND tbl.relname = %s AND (idx.type = 'PRIMARY' OR idx.type = 'UNIQUE') "+ + "ORDER BY CASE WHEN idx.type = 'PRIMARY' THEN 0 ELSE 1 END, idx.name, idx.ordinal_position", + tenantID, sqlquote.String(key.database), sqlquote.String(key.table), + ) + res, err := txn.Exec(query, executor.StatementOption{}.WithAccountID(uint32(tenantID))) + if err != nil { + return "", err + } + defer res.Close() + type candidate struct { + name string + primary bool + columns []string + } + candidates := make(map[string]*candidate) + res.ReadRows(func(rows int, cols []*vector.Vector) bool { + for i := 0; i < rows; i++ { + name := cols[0].GetStringAt(i) + candidateKey := cols[1].GetStringAt(i) + "\x00" + name + entry := candidates[candidateKey] + if entry == nil { + entry = &candidate{name: name, primary: strings.EqualFold(cols[1].GetStringAt(i), "PRIMARY")} + candidates[candidateKey] = entry + } + entry.columns = append(entry.columns, cols[3].GetStringAt(i)) + } + return true + }) + ordered := make([]*candidate, 0, len(candidates)) + for _, candidate := range candidates { + ordered = append(ordered, candidate) + } + sort.Slice(ordered, func(i, j int) bool { + if ordered[i].primary != ordered[j].primary { + return ordered[i].primary + } + return ordered[i].name < ordered[j].name + }) + for _, candidate := range ordered { + if len(candidate.columns) != len(key.columns) { + continue + } + if strings.Join(candidate.columns, "\x00") == strings.Join(key.columns, "\x00") { + return candidate.name, nil + } + } + // Legacy MatrixOne accepted some FK shapes that do not name an exact + // PRIMARY/UNIQUE key. Leave the value empty rather than inventing a wrong + // UNIQUE_CONSTRAINT_NAME; new FK creation rejects those shapes. + return "", nil +} + +func legacyForeignKeyReferencedIndexUpdateSQL(definition legacyForeignKeyTableDefinition, constraintName, indexName string) string { + return fmt.Sprintf( + "UPDATE mo_catalog.mo_foreign_keys SET referenced_index_name = %s WHERE db_name = %s AND table_name = %s AND constraint_name = %s", + sqlquote.String(indexName), sqlquote.String(definition.database), sqlquote.String(definition.table), sqlquote.String(constraintName), + ) +} + +func getLegacyForeignKeyTableDefinitions(query string, tenantID int32, txn executor.TxnExecutor) ([]legacyForeignKeyTableDefinition, error) { + res, err := txn.Exec(query, executor.StatementOption{}.WithAccountID(uint32(tenantID))) if err != nil { return nil, err } @@ -407,11 +608,13 @@ func legacyForeignKeyUpdateSQL( onDelete, onUpdate string, ) string { return fmt.Sprintf( - "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s "+ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s, on_delete_origin = %s, on_update_origin = %s "+ "WHERE constraint_id = 0 AND db_name = %s AND table_name = %s AND constraint_name = %s AND column_name = %s", ordinal, sqlquote.String(onDelete), sqlquote.String(onUpdate), + sqlquote.String(legacyCatalogReferenceActionOrigin(onDelete)), + sqlquote.String(legacyCatalogReferenceActionOrigin(onUpdate)), sqlquote.String(definition.database), sqlquote.String(definition.table), sqlquote.String(constraintName), @@ -419,6 +622,13 @@ func legacyForeignKeyUpdateSQL( ) } +func legacyCatalogReferenceActionOrigin(action string) string { + if strings.EqualFold(strings.TrimSpace(action), "NO_ACTION") { + return "ACTION_ORIGIN_DEFAULT" + } + return "ACTION_ORIGIN_LEGACY_AMBIGUOUS" +} + // The catalog is the authoritative action source. SHOW CREATE TABLE is used // only to reconcile the current constraint declaration and its column order: // it can render an omitted action and an explicit RESTRICT identically. Keep a diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index a544e328c8b6a..b36e84e5e2b88 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -36,7 +36,7 @@ import ( ) func TestMongoDBCatalogUpgradeEntries(t *testing.T) { - require.Len(t, tenantUpgEntries, 4) + require.Len(t, tenantUpgEntries, 7) require.Len(t, clusterUpgEntries, 1) require.Equal(t, retireKafkaSinkDaemonTasks.UpgSql, clusterUpgEntries[0].UpgSql) require.Equal(t, mongodb.TableConnections, tenantUpgEntries[0].TableName) @@ -48,15 +48,22 @@ func TestMongoDBCatalogUpgradeEntries(t *testing.T) { } func TestForeignKeyMetadataTenantUpgradeEntries(t *testing.T) { - require.Len(t, tenantUpgEntries, 4) + require.Len(t, tenantUpgEntries, 7) - keyColumnUsage := tenantUpgEntries[2] + for i, column := range []string{"referenced_index_name", "on_delete_origin", "on_update_origin"} { + entry := tenantUpgEntries[2+i] + require.Equal(t, versions.ADD_COLUMN, entry.UpgType) + require.Equal(t, catalog.MOForeignKeys, entry.TableName) + require.Contains(t, entry.UpgSql, "add column "+column) + } + + keyColumnUsage := tenantUpgEntries[5] require.Equal(t, versions.CREATE_VIEW, keyColumnUsage.UpgType) require.Equal(t, "KEY_COLUMN_USAGE", keyColumnUsage.TableName) require.Equal(t, sysview.InformationSchemaKeyColumnUsageDDL, keyColumnUsage.UpgSql) require.Contains(t, strings.ToLower(keyColumnUsage.PreSql), "drop table if exists information_schema.key_column_usage") - referentialConstraints := tenantUpgEntries[3] + referentialConstraints := tenantUpgEntries[6] require.Equal(t, versions.MODIFY_VIEW, referentialConstraints.UpgType) require.Equal(t, "REFERENTIAL_CONSTRAINTS", referentialConstraints.TableName) require.Equal(t, sysview.InformationSchemaReferentialConstraintsDDL, referentialConstraints.UpgSql) @@ -64,8 +71,11 @@ func TestForeignKeyMetadataTenantUpgradeEntries(t *testing.T) { } func TestLegacyForeignKeyMetadataQueryUsesForeignKeyCatalogOnly(t *testing.T) { - require.NotContains(t, strings.ToLower(legacyForeignKeyTableDefinitionsSQL), "rel_createsql") - require.NotContains(t, strings.ToLower(legacyForeignKeyTableDefinitionsSQL), "mo_tables") + for _, query := range []string{legacyForeignKeyTableDefinitionsSQL, legacyForeignKeyReferencedIndexDefinitionsSQL} { + require.NotContains(t, strings.ToLower(query), "rel_createsql") + require.NotContains(t, strings.ToLower(query), "mo_tables") + } + require.Contains(t, legacyForeignKeyReferencedIndexDefinitionsSQL, "referenced_index_name = ''") } func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { @@ -83,11 +93,11 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { require.Len(t, updates, 3) for _, expected := range []string{ - "constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", + "constraint_id = 1, on_delete = 'NO_ACTION', on_update = 'NO_ACTION', on_delete_origin = 'ACTION_ORIGIN_DEFAULT', on_update_origin = 'ACTION_ORIGIN_DEFAULT'", "constraint_name = 'fk_default' AND column_name = 'b'", - "constraint_id = 2, on_delete = 'NO_ACTION', on_update = 'NO_ACTION'", + "constraint_id = 2, on_delete = 'NO_ACTION', on_update = 'NO_ACTION', on_delete_origin = 'ACTION_ORIGIN_DEFAULT', on_update_origin = 'ACTION_ORIGIN_DEFAULT'", "constraint_name = 'fk_default' AND column_name = 'a'", - "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT'", + "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT', on_delete_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS', on_update_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'", "constraint_name = 'fk_restrict' AND column_name = 'a'", "db_name = 'db''one'", } { @@ -95,6 +105,29 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { } } +func TestLegacyForeignKeyReferencedIndexNameSelectsExactPrimaryKey(t *testing.T) { + var queries []string + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + queries = append(queries, sql) + return newLegacyForeignKeyIndexResult(t, [][]string{ + {"PRIMARY", "PRIMARY", "1", "id"}, + {"uq_parent_id", "UNIQUE", "1", "id"}, + {"uq_parent_compound", "UNIQUE", "1", "id"}, + {"uq_parent_compound", "UNIQUE", "2", "code"}, + }), nil + }) + name, err := getLegacyForeignKeyReferencedIndexName(9, txnExecutor, legacyForeignKeyReferencedKey{ + database: "db", + table: "parent", + columns: []string{"id"}, + }) + require.NoError(t, err) + require.Equal(t, "PRIMARY", name) + require.Len(t, queries, 1) + require.Contains(t, queries[0], "tbl.reldatabase = 'db'") + require.Contains(t, queries[0], "ORDER BY CASE WHEN idx.type = 'PRIMARY' THEN 0 ELSE 1 END") +} + func TestVersionHandleMetadata(t *testing.T) { meta := Handler.Metadata() require.Equal(t, "4.0.6", meta.Version) @@ -180,7 +213,7 @@ func TestVersionHandleLifecycleWithNoLegacyDefinitions(t *testing.T) { if err := Handler.HandleTenantUpgrade(context.Background(), 9, txnExecutor); err != nil { t.Fatalf("tenant upgrade: %v", err) } - if len(executed) != 1 || executed[0] != legacyForeignKeyTableDefinitionsSQL { + if len(executed) == 0 || executed[len(executed)-1] != legacyForeignKeyReferencedIndexDefinitionsSQL { t.Fatalf("unexpected SQL: %v", executed) } if err := Handler.HandleClusterUpgrade(context.Background(), txnExecutor); err != nil { @@ -219,6 +252,7 @@ func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) if err := upgradeLegacyForeignKeyMetadata(context.Background(), 9, txnExecutor); err != nil { t.Fatalf("upgrade legacy foreign-key metadata: %v", err) } + updates = legacyForeignKeyMigrationUpdatesForAssertion(updates) if len(updates) != 2 { t.Fatalf("expected two metadata updates, got %d: %v", len(updates), updates) } @@ -229,6 +263,39 @@ func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) } } +func TestLegacyForeignKeyMetadataUpgradeBackfillsReferencedIndexForNumberedLegacyForeignKey(t *testing.T) { + definition := legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{{ + constraintName: "fk_child_parent", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT", + }}, + } + var updates []string + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + switch sql { + case legacyForeignKeyTableDefinitionsSQL: + // constraint_id was assigned by an earlier upgrade; it must not be + // required to backfill the referenced key. + return executor.Result{}, nil + case legacyForeignKeyReferencedIndexDefinitionsSQL: + return newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{definition}), nil + case "SHOW CREATE TABLE `db`.`child`": + return newShowCreateTableResult(t, "child", "create table child (parent_id int, constraint fk_child_parent foreign key (parent_id) references parent (id))"), nil + } + if strings.HasPrefix(sql, "SELECT idx.name, idx.type") { + return newLegacyForeignKeyIndexResult(t, [][]string{{"PRIMARY", "PRIMARY", "1", "id"}}), nil + } + updates = append(updates, sql) + return executor.Result{}, nil + }) + + require.NoError(t, upgradeLegacyForeignKeyMetadata(context.Background(), 9, txnExecutor)) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET referenced_index_name = 'PRIMARY' WHERE db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_child_parent'", + }, updates) +} + func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *testing.T) { definitionResult := newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{ { @@ -267,7 +334,7 @@ func TestLegacyForeignKeyMetadataUpgradeBackfillsAlterAndUnnamedForeignKeys(t *t "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'alter_child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'unnamed_child' AND constraint_name = 'catalog_generated_name' AND column_name = 'parent_id'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesRejectInvalidDefinitions(t *testing.T) { @@ -300,7 +367,7 @@ func TestLegacyForeignKeyMetadataUpdatesBackfillAlterTableForeignKey(t *testing. require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'b'", "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 2, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'a'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesPreservesRestrictForAlterFallback(t *testing.T) { @@ -314,7 +381,7 @@ func TestLegacyForeignKeyMetadataUpdatesPreservesRestrictForAlterFallback(t *tes require.NoError(t, err) require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'parent_id'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesRejectInconsistentCatalogActions(t *testing.T) { @@ -340,7 +407,7 @@ func TestLegacyForeignKeyMetadataUpdatesDoNotMatchReusedConstraintName(t *testin require.NoError(t, err) require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_reused' AND column_name = 'b'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesEscapeCatalogIdentifiers(t *testing.T) { @@ -364,7 +431,7 @@ func TestLegacyForeignKeyMetadataUpdatesEscapeCatalogIdentifiers(t *testing.T) { "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' " + "WHERE constraint_id = 0 AND db_name = 'db\\\\name' AND table_name = 'child\\\\name' " + "AND constraint_name = 'fk\\\\'' OR 1=1 -- ' AND column_name = 'child\\\\column'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesEscapeTrailingBackslashIdentifiers(t *testing.T) { @@ -388,7 +455,7 @@ func TestLegacyForeignKeyMetadataUpdatesEscapeTrailingBackslashIdentifiers(t *te "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL' " + "WHERE constraint_id = 0 AND db_name = 'db\\\\' AND table_name = 'child\\\\' " + "AND constraint_name = 'fk\\\\' AND column_name = 'child\\\\'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesRejectUnmatchedCompositeForeignKey(t *testing.T) { @@ -414,7 +481,7 @@ func TestLegacyForeignKeyMetadataUpdatesBackfillUnnamedForeignKey(t *testing.T) require.NoError(t, err) require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-generated-name' AND column_name = 'parent_id'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalog(t *testing.T) { @@ -430,7 +497,7 @@ func TestLegacyForeignKeyMetadataUpdatesLeaveAmbiguousUnnamedForeignKeysToCatalo require.Equal(t, []string{ "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'CASCADE' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-a' AND column_name = 'parent_id'", "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT' WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'catalog-fk-b' AND column_name = 'parent_id'", - }, updates) + }, legacyForeignKeyMigrationUpdatesForAssertion(updates)) } func TestLegacyForeignKeyMetadataUpdatesRejectAmbiguousUnnamedCompositeForeignKeys(t *testing.T) { @@ -542,6 +609,42 @@ func newShowCreateTableResult(t *testing.T, tableName, createSQL string) executo return result.GetResult() } +func newLegacyForeignKeyIndexResult(t *testing.T, rows [][]string) executor.Result { + t.Helper() + mp := mpool.MustNewZeroNoFixed() + t.Cleanup(func() { mpool.DeleteMPool(mp) }) + result := executor.NewMemResult([]types.Type{ + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + types.T_varchar.ToType(), + }, mp) + result.NewBatchWithRowCount(len(rows)) + for column := 0; column < 4; column++ { + values := make([]string, len(rows)) + for row := range rows { + values[row] = rows[row][column] + } + if err := executor.AppendStringRows(result, column, values); err != nil { + t.Fatalf("append legacy index column %d: %v", column, err) + } + } + return result.GetResult() +} + +func legacyForeignKeyMigrationUpdatesForAssertion(updates []string) []string { + ret := make([]string, 0, len(updates)) + for _, update := range updates { + if strings.HasPrefix(update, "SELECT ") { + continue + } + update = strings.ReplaceAll(update, + ", on_delete_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS', on_update_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'", "") + ret = append(ret, update) + } + return ret +} + func TestRetireKafkaSinkDaemonTasks(t *testing.T) { const filter = "task_metadata_executor = 4 and task_status in (0, 1, 3, 6, 7, 9)" require.Equal(t, filter, activeKafkaSinkTaskFilter()) diff --git a/pkg/frontend/predefined.go b/pkg/frontend/predefined.go index 31a91c616ce82..1cf25e7c8552f 100644 --- a/pkg/frontend/predefined.go +++ b/pkg/frontend/predefined.go @@ -478,6 +478,9 @@ var ( refer_column_id BIGINT UNSIGNED not null default 0, on_delete varchar(128) not null, on_update varchar(128) not null, + referenced_index_name varchar(5000) not null default '', + on_delete_origin varchar(64) not null default 'ACTION_ORIGIN_EXPLICIT', + on_update_origin varchar(64) not null default 'ACTION_ORIGIN_EXPLICIT', primary key( constraint_name, diff --git a/pkg/pb/plan/plan.pb.go b/pkg/pb/plan/plan.pb.go index a870fc9fed007..4f609809c3fa0 100644 --- a/pkg/pb/plan/plan.pb.go +++ b/pkg/pb/plan/plan.pb.go @@ -542,6 +542,38 @@ func (ForeignKeyDef_RefAction) EnumDescriptor() ([]byte, []int) { return fileDescriptor_2d655ab2f7683c23, []int{30, 0} } +// Whether a reference action was written in the FK declaration. This is +// persisted separately from RefAction because an omitted action and an +// explicit RESTRICT have the same execution behavior but distinct MySQL +// metadata/SHOW CREATE representations. +type ForeignKeyDef_RefActionOrigin int32 + +const ( + ForeignKeyDef_ACTION_ORIGIN_EXPLICIT ForeignKeyDef_RefActionOrigin = 0 + ForeignKeyDef_ACTION_ORIGIN_DEFAULT ForeignKeyDef_RefActionOrigin = 1 + ForeignKeyDef_ACTION_ORIGIN_LEGACY_AMBIGUOUS ForeignKeyDef_RefActionOrigin = 2 +) + +var ForeignKeyDef_RefActionOrigin_name = map[int32]string{ + 0: "ACTION_ORIGIN_EXPLICIT", + 1: "ACTION_ORIGIN_DEFAULT", + 2: "ACTION_ORIGIN_LEGACY_AMBIGUOUS", +} + +var ForeignKeyDef_RefActionOrigin_value = map[string]int32{ + "ACTION_ORIGIN_EXPLICIT": 0, + "ACTION_ORIGIN_DEFAULT": 1, + "ACTION_ORIGIN_LEGACY_AMBIGUOUS": 2, +} + +func (x ForeignKeyDef_RefActionOrigin) String() string { + return proto.EnumName(ForeignKeyDef_RefActionOrigin_name, int32(x)) +} + +func (ForeignKeyDef_RefActionOrigin) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2d655ab2f7683c23, []int{30, 1} +} + type OrderBySpec_OrderByFlag int32 const ( @@ -4155,12 +4187,16 @@ type ForeignKeyDef struct { // Foreign key parent table Id ForeignTbl uint64 `protobuf:"varint,3,opt,name=foreign_tbl,json=foreignTbl,proto3" json:"foreign_tbl,omitempty"` // Foreign key parent table dependent column colids - ForeignCols []uint64 `protobuf:"varint,4,rep,packed,name=foreign_cols,json=foreignCols,proto3" json:"foreign_cols,omitempty"` - OnDelete ForeignKeyDef_RefAction `protobuf:"varint,5,opt,name=on_delete,json=onDelete,proto3,enum=plan.ForeignKeyDef_RefAction" json:"on_delete,omitempty"` - OnUpdate ForeignKeyDef_RefAction `protobuf:"varint,6,opt,name=on_update,json=onUpdate,proto3,enum=plan.ForeignKeyDef_RefAction" json:"on_update,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ForeignCols []uint64 `protobuf:"varint,4,rep,packed,name=foreign_cols,json=foreignCols,proto3" json:"foreign_cols,omitempty"` + OnDelete ForeignKeyDef_RefAction `protobuf:"varint,5,opt,name=on_delete,json=onDelete,proto3,enum=plan.ForeignKeyDef_RefAction" json:"on_delete,omitempty"` + OnUpdate ForeignKeyDef_RefAction `protobuf:"varint,6,opt,name=on_update,json=onUpdate,proto3,enum=plan.ForeignKeyDef_RefAction" json:"on_update,omitempty"` + // Exact PRIMARY/UNIQUE parent key selected when this FK was bound. + ReferencedIndexName string `protobuf:"bytes,7,opt,name=referenced_index_name,json=referencedIndexName,proto3" json:"referenced_index_name,omitempty"` + OnDeleteOrigin ForeignKeyDef_RefActionOrigin `protobuf:"varint,8,opt,name=on_delete_origin,json=onDeleteOrigin,proto3,enum=plan.ForeignKeyDef_RefActionOrigin" json:"on_delete_origin,omitempty"` + OnUpdateOrigin ForeignKeyDef_RefActionOrigin `protobuf:"varint,9,opt,name=on_update_origin,json=onUpdateOrigin,proto3,enum=plan.ForeignKeyDef_RefActionOrigin" json:"on_update_origin,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ForeignKeyDef) Reset() { *m = ForeignKeyDef{} } @@ -4238,6 +4274,27 @@ func (m *ForeignKeyDef) GetOnUpdate() ForeignKeyDef_RefAction { return ForeignKeyDef_RESTRICT } +func (m *ForeignKeyDef) GetReferencedIndexName() string { + if m != nil { + return m.ReferencedIndexName + } + return "" +} + +func (m *ForeignKeyDef) GetOnDeleteOrigin() ForeignKeyDef_RefActionOrigin { + if m != nil { + return m.OnDeleteOrigin + } + return ForeignKeyDef_ACTION_ORIGIN_EXPLICIT +} + +func (m *ForeignKeyDef) GetOnUpdateOrigin() ForeignKeyDef_RefActionOrigin { + if m != nil { + return m.OnUpdateOrigin + } + return ForeignKeyDef_ACTION_ORIGIN_EXPLICIT +} + type CheckDef struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name for anonymous constraints, __mo_chk_[INDEX_ID] @@ -14429,6 +14486,7 @@ func init() { proto.RegisterEnum("plan.SubqueryRef_Type", SubqueryRef_Type_name, SubqueryRef_Type_value) proto.RegisterEnum("plan.Function_FuncFlag", Function_FuncFlag_name, Function_FuncFlag_value) proto.RegisterEnum("plan.ForeignKeyDef_RefAction", ForeignKeyDef_RefAction_name, ForeignKeyDef_RefAction_value) + proto.RegisterEnum("plan.ForeignKeyDef_RefActionOrigin", ForeignKeyDef_RefActionOrigin_name, ForeignKeyDef_RefActionOrigin_value) proto.RegisterEnum("plan.OrderBySpec_OrderByFlag", OrderBySpec_OrderByFlag_name, OrderBySpec_OrderByFlag_value) proto.RegisterEnum("plan.FrameClause_FrameType", FrameClause_FrameType_name, FrameClause_FrameType_value) proto.RegisterEnum("plan.FrameBound_BoundType", FrameBound_BoundType_name, FrameBound_BoundType_value) @@ -14604,913 +14662,920 @@ func init() { func init() { proto.RegisterFile("plan.proto", fileDescriptor_2d655ab2f7683c23) } var fileDescriptor_2d655ab2f7683c23 = []byte{ - // 14485 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0xbd, 0x6d, 0x8c, 0x23, 0xd9, - 0xb2, 0x20, 0x54, 0x2e, 0xdb, 0x65, 0x3b, 0xfc, 0x51, 0x59, 0xa7, 0xab, 0xbb, 0xdd, 0x3d, 0xfd, - 0x51, 0x9d, 0xdd, 0xd3, 0xd3, 0xd3, 0x33, 0xd3, 0x33, 0xd3, 0x3d, 0x1f, 0x3d, 0xf7, 0xdd, 0xb7, - 0xf7, 0xba, 0x6c, 0x57, 0x95, 0xa7, 0x5d, 0x76, 0xdd, 0xb4, 0xab, 0x7b, 0xe6, 0x2e, 0x4f, 0xa9, - 0x2c, 0x67, 0xda, 0x95, 0x53, 0xe9, 0x4c, 0x4f, 0x66, 0xba, 0xab, 0xea, 0x4a, 0x2b, 0xae, 0xf8, - 0xf1, 0x96, 0x45, 0xfc, 0x40, 0x42, 0xc0, 0xaf, 0x15, 0x0f, 0x24, 0x84, 0x84, 0x40, 0x08, 0xf4, - 0xc4, 0x63, 0x85, 0xc4, 0xf2, 0xc4, 0x9f, 0x45, 0x7c, 0x08, 0xb1, 0x02, 0x04, 0x48, 0x0b, 0x3c, - 0xfe, 0xb2, 0x02, 0x09, 0x24, 0x24, 0xf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8e, 0x06, 0x42, 0x4f, 0x04, 0x74, 0x8c, 0xd0, 0xea, 0x4e, 0xe6, 0xd1, 0x3a, 0x42, - 0x31, 0xc5, 0x6e, 0x42, 0xc1, 0x34, 0x42, 0x0b, 0x11, 0x35, 0xd1, 0xe5, 0x08, 0x80, 0x38, 0xe4, - 0x38, 0xc4, 0x6d, 0x8a, 0x4e, 0x47, 0x00, 0xa6, 0x42, 0x19, 0xc9, 0x22, 0xbc, 0x22, 0xf0, 0x32, - 0x90, 0x7d, 0x0e, 0x15, 0xd3, 0x1a, 0xd9, 0x53, 0xc3, 0xe1, 0x7d, 0xda, 0xda, 0xc9, 0x3c, 0x2a, - 0x3f, 0xdd, 0x7c, 0x42, 0x6b, 0x22, 0xc6, 0x1c, 0xac, 0x69, 0x29, 0x32, 0xf6, 0x1c, 0xaa, 0x22, - 0xfd, 0xe9, 0x53, 0x1a, 0x58, 0x46, 0xf9, 0x94, 0x54, 0xbe, 0x4f, 0x9f, 0x3e, 0x3f, 0x58, 0xd3, - 0xd2, 0x84, 0xec, 0x01, 0x54, 0xe2, 0x25, 0x82, 0x19, 0xaf, 0x88, 0x56, 0xa5, 0xa0, 0xd8, 0xad, - 0xef, 0x02, 0xcf, 0x45, 0x82, 0x6d, 0x31, 0x6e, 0x11, 0x80, 0xed, 0x00, 0x98, 0xd6, 0xd8, 0x98, - 0x3b, 0x21, 0xa2, 0xaf, 0x8a, 0x01, 0x94, 0x60, 0xec, 0x0e, 0x94, 0xe6, 0x33, 0xec, 0xe5, 0x4b, - 0xc3, 0xa9, 0x5f, 0x13, 0x04, 0x09, 0x08, 0x4b, 0x47, 0x3e, 0x47, 0xec, 0x75, 0x31, 0xbb, 0x11, - 0x00, 0xa7, 0xf7, 0xb5, 0x35, 0x42, 0x54, 0x5d, 0x54, 0x2c, 0xd2, 0xb8, 0x8a, 0xec, 0x60, 0xd7, - 0x76, 0xeb, 0x37, 0x88, 0x83, 0x79, 0x82, 0xdd, 0x82, 0x6c, 0xe0, 0x8f, 0xea, 0x37, 0xa9, 0xff, - 0xc0, 0xfb, 0xdf, 0xbe, 0x98, 0xf9, 0x1a, 0x82, 0x77, 0x0b, 0x90, 0xa7, 0xd5, 0xa4, 0xde, 0x82, - 0xe2, 0x91, 0xe1, 0x1b, 0x53, 0xcd, 0x1a, 0x33, 0x05, 0xb2, 0x33, 0x2f, 0x10, 0xeb, 0x08, 0x7f, - 0xaa, 0x5d, 0xd8, 0x78, 0x69, 0xf8, 0x88, 0x63, 0x90, 0x73, 0x8d, 0xa9, 0x45, 0xc8, 0x92, 0x46, - 0xbf, 0x71, 0xed, 0x04, 0x97, 0x41, 0x68, 0x4d, 0x85, 0x90, 0x10, 0x29, 0x84, 0x4f, 0x1c, 0xef, - 0x44, 0xac, 0x91, 0xa2, 0x26, 0x52, 0xea, 0x3f, 0x93, 0x81, 0x8d, 0xa6, 0xe7, 0x60, 0x71, 0xd7, - 0xa1, 0xe0, 0x5b, 0x8e, 0x9e, 0x54, 0xb7, 0xe1, 0x5b, 0xce, 0x91, 0x17, 0x20, 0x62, 0xe4, 0x71, - 0x04, 0x5f, 0xb5, 0x1b, 0x23, 0x8f, 0x10, 0x51, 0x03, 0xb2, 0x52, 0x03, 0x6e, 0x40, 0x31, 0x3c, - 0x71, 0x74, 0x82, 0xe7, 0x08, 0x5e, 0x08, 0x4f, 0x9c, 0x1e, 0xa2, 0xae, 0x43, 0xc1, 0x3c, 0xe1, - 0x98, 0x3c, 0x61, 0x36, 0xcc, 0x13, 0x44, 0xa8, 0x5f, 0x41, 0x49, 0x33, 0xce, 0x45, 0x33, 0xae, - 0xc2, 0x06, 0x16, 0x20, 0xe4, 0x5f, 0x4e, 0xcb, 0x87, 0x27, 0x4e, 0xc7, 0x44, 0x30, 0x36, 0xc2, - 0x36, 0xa9, 0x0d, 0x39, 0x2d, 0x3f, 0xf2, 0x9c, 0x8e, 0xa9, 0x0e, 0x01, 0x9a, 0x9e, 0xef, 0xff, - 0xce, 0x5d, 0xd8, 0x86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 0xa3, 0xa8, 0x15, 0xed, 0xe0, 0x98, 0xd2, 0xec, 0x11, 0x28, - 0xbc, 0x66, 0x2a, 0x56, 0xe6, 0xc9, 0x1a, 0xc1, 0xa9, 0x60, 0x12, 0x8c, 0xff, 0xfb, 0x3a, 0x14, - 0xf7, 0xe6, 0xee, 0x08, 0x27, 0x83, 0xdd, 0x87, 0xdc, 0x78, 0xee, 0x8e, 0xa8, 0x2f, 0xf1, 0xb6, - 0x1b, 0xaf, 0x29, 0x8d, 0x90, 0x28, 0xad, 0x0c, 0x7f, 0x82, 0x52, 0x6e, 0x49, 0x5a, 0x21, 0x9c, - 0x66, 0x6e, 0x32, 0xd1, 0x47, 0x9e, 0x3b, 0xb6, 0x27, 0xd4, 0xa3, 0x8a, 0x56, 0x32, 0x26, 0x93, - 0x26, 0x01, 0x58, 0x03, 0x36, 0x13, 0x34, 0x57, 0xd4, 0x72, 0x24, 0x98, 0x6e, 0xf0, 0x92, 0x1a, - 0x93, 0x89, 0x6f, 0x4d, 0x8c, 0xd0, 0xe2, 0xf4, 0x24, 0x9b, 0xaa, 0x71, 0x76, 0x92, 0x6f, 0xff, - 0x61, 0x86, 0xb7, 0x79, 0xcf, 0x31, 0x26, 0xac, 0x08, 0xb9, 0x5e, 0xbf, 0xd7, 0x56, 0xd6, 0x58, - 0x05, 0x8a, 0x9d, 0xde, 0xb0, 0xad, 0xf5, 0x1a, 0x5d, 0x25, 0x43, 0xc2, 0x65, 0xd8, 0xd8, 0xed, - 0xb6, 0x95, 0x75, 0xc4, 0xbc, 0xec, 0x77, 0x1b, 0xc3, 0x4e, 0xb7, 0xad, 0xe4, 0x38, 0x46, 0xeb, - 0x34, 0x87, 0x4a, 0x91, 0x29, 0x50, 0x39, 0xd2, 0xfa, 0xad, 0xe3, 0x66, 0x5b, 0xef, 0x1d, 0x77, - 0xbb, 0x8a, 0xc2, 0xae, 0xc0, 0x66, 0x0c, 0xe9, 0x73, 0xe0, 0x0e, 0x66, 0x79, 0xd9, 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d6, 0x08, 0x29, 0xce, 0xd9, 0xbb, 0x90, 0x0d, 0xe6, 0x27, 0x24, 0xd7, 0xca, 0x4f, 0xb7, - 0x96, 0x76, 0x28, 0xac, 0x28, 0x98, 0x9f, 0xb0, 0x87, 0x90, 0x1b, 0x79, 0xbe, 0x2f, 0x64, 0x9b, - 0x12, 0x35, 0x38, 0xda, 0x9c, 0x51, 0x45, 0x45, 0x3c, 0x56, 0x18, 0x92, 0x44, 0x8b, 0x89, 0x92, - 0xdd, 0x11, 0x2b, 0x0c, 0xd9, 0x03, 0xb1, 0xe5, 0xa6, 0xe4, 0x5a, 0xb4, 0x21, 0x63, 0x39, 0x88, - 0xc5, 0x49, 0x9a, 0x1a, 0x17, 0xa4, 0xff, 0xc6, 0x44, 0xd1, 0x4e, 0x8c, 0x6d, 0x9a, 0x1a, 0x17, - 0xec, 0x01, 0x64, 0x5f, 0x5b, 0x23, 0x52, 0x85, 0xe3, 0xda, 0xc4, 0x24, 0xbd, 0xa4, 0xee, 0x21, - 0x9a, 0x56, 0x96, 0xe7, 0x98, 0xa4, 0x15, 0xc7, 0x73, 0xb9, 0xe7, 0x39, 0xe6, 0x4b, 0x9a, 0x4b, - 0x42, 0xa2, 0x02, 0x62, 0xcc, 0x2f, 0x50, 0xde, 0x29, 0x5c, 0x55, 0x30, 0xe6, 0x17, 0x1d, 0x13, - 0xb7, 0x22, 0xd7, 0x7c, 0x4d, 0xba, 0x70, 0x46, 0xc3, 0x9f, 0x68, 0xac, 0x05, 0x96, 0x63, 0x8d, - 0x42, 0xfb, 0xb5, 0x1d, 0x5e, 0x92, 0xb6, 0x9b, 0xd1, 0x64, 0xd0, 0xee, 0x06, 0xe4, 0xac, 0x8b, - 0x99, 0xaf, 0x1e, 0x40, 0x41, 0xd4, 0xb2, 0x64, 0xf1, 0xdd, 0x80, 0xa2, 0x1d, 0xe0, 0x3a, 0x0c, - 0x42, 0xa1, 0xc9, 0x15, 0xec, 0xa0, 0x89, 0x49, 0x14, 0xc8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1, 0x1a, 0x27, 0x5a, - 0xd6, 0x38, 0x52, 0x57, 0x58, 0xac, 0xaa, 0xc7, 0x28, 0x2d, 0x4d, 0xa8, 0x7e, 0x08, 0x15, 0x19, - 0xc0, 0x6e, 0x41, 0xd6, 0xb4, 0xc6, 0x2b, 0xc4, 0x31, 0x82, 0xd5, 0x97, 0x50, 0x69, 0x46, 0xdb, - 0xef, 0x9b, 0x7a, 0xf6, 0x14, 0x6a, 0x24, 0x3b, 0x46, 0x27, 0x91, 0xf0, 0x58, 0x5f, 0x21, 0x3c, - 0x2a, 0x48, 0xd3, 0x3c, 0x11, 0xd2, 0xe3, 0x73, 0x28, 0x1f, 0xf9, 0xde, 0xcc, 0xf2, 0x43, 0x2a, - 0x56, 0x81, 0xec, 0x99, 0x75, 0x29, 0x4a, 0xc5, 0x9f, 0x89, 0x3b, 0x6a, 0x5d, 0x76, 0x47, 0x3d, - 0x85, 0x62, 0x94, 0xed, 0x47, 0xe7, 0xf9, 0x05, 0x0a, 0x61, 0xca, 0x63, 0x5b, 0x01, 0x56, 0xf6, - 0x04, 0x60, 0x16, 0x03, 0xc4, 0xc0, 0x45, 0x36, 0x8e, 0x28, 0x5c, 0x93, 0x28, 0xd4, 0xdb, 0x50, - 0x78, 0x69, 0x5b, 0xe7, 0xa2, 0xfb, 0xaf, 0x6d, 0xeb, 0x3c, 0xea, 0x3e, 0xfe, 0x56, 0xff, 0x9f, - 0x12, 0x14, 0x69, 0xa5, 0xb6, 0xde, 0xec, 0x01, 0xfc, 0x29, 0xaa, 0xe0, 0x8e, 0x58, 0x6e, 0xb9, - 0x15, 0x0a, 0x28, 0x5f, 0x7c, 0xb7, 0x01, 0x24, 0xa9, 0xc1, 0x65, 0x60, 0x29, 0x8c, 0x85, 0x05, - 0xea, 0x50, 0xb4, 0xab, 0x21, 0x1b, 0x71, 0xe3, 0x3c, 0x01, 0xb0, 0x27, 0x5c, 0xc3, 0x21, 0x73, - 0x9c, 0x6b, 0x81, 0x57, 0x22, 0x4b, 0xe6, 0xc4, 0xb1, 0x22, 0xfb, 0x8a, 0xd4, 0x1e, 0x4c, 0x90, - 0x44, 0xb4, 0xfc, 0x00, 0x05, 0x1f, 0x1d, 0x11, 0x68, 0x51, 0x92, 0xbd, 0x07, 0x39, 0xdc, 0x2e, - 0x84, 0x3d, 0x74, 0x25, 0x1a, 0x41, 0x69, 0xbf, 0xd3, 0x88, 0x80, 0x3d, 0x82, 0x02, 0x09, 0x29, - 0x0b, 0x65, 0x96, 0x34, 0xda, 0xd1, 0xf6, 0xa1, 0x45, 0x68, 0xf6, 0x3e, 0xe4, 0xc7, 0x67, 0xd6, - 0x25, 0x17, 0x58, 0x71, 0x99, 0xa9, 0x25, 0xad, 0x71, 0x0a, 0xf6, 0x00, 0x6a, 0xbe, 0x35, 0xd6, - 0xc9, 0x27, 0x88, 0x32, 0x28, 0xa8, 0xd7, 0x48, 0xc4, 0x54, 0x7c, 0x6b, 0xdc, 0x44, 0xe0, 0xf0, - 0xc4, 0x09, 0xd8, 0x43, 0xd8, 0xa0, 0xc5, 0x85, 0x0a, 0xa0, 0x54, 0x73, 0xb4, 0x52, 0x35, 0x81, - 0x65, 0x9f, 0x02, 0x08, 0x35, 0x53, 0x3f, 0xb9, 0x24, 0x5f, 0x7a, 0xbc, 0x98, 0x64, 0xfe, 0x97, - 0x95, 0xd1, 0xf7, 0x20, 0x8f, 0x4c, 0x12, 0xd4, 0xaf, 0x53, 0xc9, 0x5b, 0x69, 0x0e, 0xa2, 0x96, - 0x12, 0x9e, 0x3d, 0x82, 0x22, 0x32, 0x0a, 0xad, 0xea, 0xba, 0xac, 0x77, 0x0b, 0xae, 0xc2, 0x3d, - 0xc6, 0x3a, 0x1f, 0x7c, 0xef, 0xb0, 0xc7, 0x90, 0x33, 0x71, 0x31, 0xdf, 0xa0, 0x12, 0xaf, 0x49, - 0xf3, 0x82, 0xb2, 0xac, 0x65, 0x8d, 0xc9, 0x14, 0x20, 0x1a, 0x76, 0x00, 0x35, 0x64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0xa2, - 0x68, 0x03, 0x72, 0x55, 0xce, 0xe6, 0x62, 0x08, 0xf8, 0x41, 0x59, 0x89, 0x20, 0xd4, 0xb2, 0xbb, - 0x50, 0xf6, 0xe6, 0x61, 0x8c, 0xe7, 0x47, 0x67, 0xc0, 0x41, 0x44, 0x10, 0xe7, 0x8f, 0xdd, 0xe0, - 0x51, 0x7e, 0xd2, 0xca, 0x93, 0xfc, 0xb1, 0xa6, 0x16, 0xe7, 0x27, 0x82, 0xfb, 0x50, 0x0d, 0xed, - 0xa9, 0x45, 0xa7, 0x85, 0xf3, 0xa9, 0x65, 0xf2, 0x90, 0x46, 0x1e, 0x25, 0xd7, 0x14, 0x30, 0x2c, - 0x65, 0x6a, 0x4d, 0x3d, 0xff, 0x92, 0x97, 0xb2, 0xc1, 0x4b, 0xe1, 0x20, 0x2a, 0xe5, 0x43, 0x60, - 0xe7, 0x86, 0x1d, 0xea, 0xe9, 0xa2, 0xb8, 0x76, 0xac, 0x20, 0x66, 0x28, 0x17, 0x77, 0x0d, 0x36, - 0x4c, 0x3b, 0x38, 0xeb, 0xf4, 0x85, 0x66, 0x2c, 0x52, 0xd8, 0x97, 0x60, 0x64, 0xe0, 0xc6, 0x1c, - 0x5a, 0x5c, 0x8b, 0xcb, 0x6a, 0x25, 0x84, 0xec, 0x22, 0x00, 0x05, 0xbb, 0x6b, 0x85, 0xe7, 0x9e, - 0x8f, 0x39, 0xb9, 0xe2, 0x9b, 0x00, 0x70, 0x03, 0x44, 0x52, 0xac, 0x88, 0x78, 0x2f, 0xab, 0xc5, - 0x69, 0x54, 0x29, 0x39, 0x1f, 0x12, 0xb6, 0xc2, 0x9b, 0x9f, 0x40, 0xd8, 0x03, 0xa8, 0x51, 0xf3, - 0x49, 0x31, 0xc6, 0x3e, 0xd0, 0xe9, 0x56, 0x56, 0xab, 0x20, 0x94, 0xec, 0x69, 0xa4, 0xfa, 0x0a, - 0x6e, 0xa4, 0xfa, 0xa7, 0x1b, 0xbe, 0x6f, 0x5c, 0xea, 0x53, 0xe3, 0x3b, 0xcf, 0x27, 0xdf, 0x47, - 0x56, 0xbb, 0x26, 0x0f, 0x5b, 0x03, 0xd1, 0x87, 0x88, 0x7d, 0x63, 0x56, 0xdb, 0xf5, 0x7c, 0x72, - 0x8c, 0xac, 0xcc, 0x8a, 0x58, 0xb2, 0xe2, 0x69, 0x82, 0x49, 0x4b, 0x0f, 0x78, 0x74, 0xa5, 0x56, - 0x26, 0xd8, 0x2e, 0x81, 0x50, 0x4f, 0x0d, 0x9e, 0x71, 0x79, 0xb9, 0x25, 0x42, 0x9d, 0x9e, 0x91, - 0x24, 0xe4, 0x88, 0x53, 0xcb, 0x30, 0xe9, 0xc4, 0x8c, 0x10, 0x07, 0x96, 0x41, 0xe7, 0xd1, 0xc1, - 0x33, 0x7d, 0x36, 0x0f, 0x79, 0x58, 0xa4, 0x96, 0x0f, 0x9e, 0x1d, 0xcd, 0x43, 0x01, 0x9e, 0x58, - 0x21, 0x1d, 0x90, 0x11, 0x78, 0xdf, 0x0a, 0x51, 0xd9, 0x0c, 0x9e, 0x45, 0x7e, 0xe2, 0xab, 0x62, - 0x6c, 0x9f, 0x09, 0x47, 0xb0, 0x0a, 0xd5, 0x18, 0xa9, 0x4f, 0xe7, 0x3c, 0x0e, 0x32, 0xab, 0x95, - 0x23, 0x82, 0xc3, 0xb9, 0x83, 0x13, 0x3b, 0x32, 0x46, 0xa7, 0x96, 0xee, 0x63, 0x53, 0xae, 0xf3, - 0xa9, 0x23, 0x88, 0x86, 0xad, 0x79, 0x07, 0x78, 0x42, 0x3f, 0xb5, 0x43, 0x72, 0xd0, 0x64, 0xb5, - 0x22, 0x01, 0x0e, 0xec, 0x10, 0xd7, 0x31, 0x47, 0x0a, 0x0e, 0xa4, 0x22, 0x6e, 0x10, 0xd1, 0x26, - 0x21, 0x0e, 0x09, 0x4e, 0x05, 0x3d, 0x02, 0x25, 0x45, 0x8b, 0xe5, 0xdd, 0x24, 0xd2, 0x9a, 0x44, -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, 0x35, 0x60, 0x33, 0x89, 0x06, - 0xe6, 0x21, 0xd8, 0x57, 0x65, 0x57, 0x7f, 0x2a, 0x7c, 0x38, 0xb2, 0xaa, 0xec, 0x54, 0x4c, 0xf1, - 0x7d, 0xa8, 0xf2, 0xd0, 0x17, 0x3e, 0x6e, 0x01, 0x29, 0x49, 0x25, 0xad, 0x42, 0x40, 0x3e, 0x4e, - 0x01, 0x09, 0x18, 0x61, 0xea, 0x85, 0x17, 0xa4, 0x25, 0x25, 0x02, 0x86, 0xdb, 0x76, 0xe1, 0x85, - 0x56, 0x32, 0xa3, 0x9f, 0xb8, 0xf9, 0x9f, 0xd8, 0xae, 0x89, 0xac, 0x17, 0x1a, 0x93, 0xa0, 0x5e, - 0xa7, 0x95, 0x59, 0x16, 0xb0, 0xa1, 0x31, 0x09, 0xd0, 0xf0, 0x37, 0xb8, 0xb1, 0xc1, 0xdb, 0x7d, - 0x43, 0xf6, 0x4c, 0x49, 0x66, 0x88, 0x56, 0x36, 0x24, 0x9b, 0xe4, 0x4b, 0x60, 0xd1, 0x09, 0xa5, - 0x64, 0xc7, 0xdf, 0x5c, 0xe2, 0xc6, 0x4d, 0x71, 0x44, 0x19, 0x5b, 0xf1, 0x77, 0xa1, 0xcc, 0x3d, - 0x15, 0x7a, 0x10, 0x5a, 0xb3, 0xfa, 0x3b, 0xd4, 0x20, 0xe0, 0xa0, 0x41, 0x68, 0xcd, 0xd8, 0x97, - 0x50, 0x4d, 0x5b, 0x59, 0xb7, 0x56, 0x1c, 0xf4, 0x11, 0x5b, 0x68, 0x95, 0x91, 0x6c, 0x77, 0xdd, - 0xe7, 0x51, 0xed, 0xa4, 0x21, 0x51, 0x46, 0x7e, 0x98, 0x55, 0x71, 0xbd, 0xb0, 0x19, 0xc1, 0x70, - 0x00, 0x23, 0x03, 0x3b, 0xbc, 0x20, 0xa5, 0x2a, 0x1e, 0xc0, 0xd8, 0x74, 0x44, 0xe3, 0x28, 0xb2, - 0x22, 0x5b, 0xc0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, 0x8c, 0x3f, 0x5f, 0xf9, 0x76, - 0x68, 0x0d, 0x9e, 0x45, 0x7b, 0x98, 0x04, 0x42, 0xc3, 0xdb, 0xb4, 0x42, 0x6b, 0x14, 0x0e, 0xbe, - 0x77, 0x22, 0xf3, 0x56, 0x82, 0xb0, 0x9f, 0x01, 0x3b, 0x31, 0x46, 0x67, 0x13, 0x9f, 0xe2, 0x24, - 0xbf, 0x9f, 0x5b, 0xbe, 0x1d, 0x8b, 0xdb, 0xb2, 0x34, 0x28, 0xda, 0x56, 0x42, 0xf6, 0x2b, 0x4e, - 0xc5, 0xae, 0xc1, 0xc6, 0xd4, 0xb8, 0x68, 0x79, 0x33, 0x11, 0xc0, 0x2e, 0x52, 0xec, 0x19, 0x5c, - 0x43, 0x15, 0x20, 0x7a, 0xb1, 0x03, 0x79, 0x48, 0x9c, 0x2b, 0xf2, 0xe7, 0x1b, 0xaf, 0x9c, 0x1a, - 0x41, 0x72, 0x0b, 0x5f, 0xf8, 0x85, 0x77, 0x61, 0x3b, 0x72, 0xef, 0x98, 0xd6, 0xcc, 0x72, 0x4d, - 0xcb, 0x1d, 0xd9, 0xf1, 0x1d, 0xff, 0x25, 0xe6, 0xbf, 0x22, 0x88, 0x5b, 0x12, 0xad, 0xfa, 0x27, + // 14597 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0xbd, 0x6d, 0x8c, 0x1b, 0xd9, + 0xb6, 0x28, 0xd4, 0x6e, 0xdb, 0x6d, 0x7b, 0xf9, 0xa3, 0xab, 0x77, 0x3a, 0x89, 0x93, 0xc9, 0x24, + 0x9d, 0x4a, 0x26, 0x93, 0xc9, 0xcc, 0x64, 0x66, 0x92, 0xf9, 0xc8, 0x9c, 0x7b, 0xee, 0x3b, 0xc7, + 0x6d, 0xbb, 0xbb, 0x3d, 0x71, 0xdb, 0x7d, 0xca, 0xee, 0x64, 0xe6, 0x3c, 0x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 0x3b, 0x50, 0x32, 0xe6, 0xa1, 0xa7, 0xdb, 0xee, 0xc8, 0xaf, 0x67, 0x09, 0x5f, + 0x44, 0x40, 0xc7, 0x1d, 0xf9, 0x6c, 0x1b, 0xf2, 0xe7, 0xb6, 0x19, 0x9e, 0xd6, 0x73, 0x54, 0x22, + 0x4f, 0x20, 0x34, 0x18, 0x19, 0x8e, 0x55, 0xcf, 0x73, 0x28, 0x25, 0x10, 0x1a, 0x52, 0x25, 0x1b, + 0x3b, 0x99, 0x87, 0x25, 0x8d, 0x27, 0xd8, 0x6d, 0x00, 0xcb, 0x9d, 0x4f, 0x5f, 0x19, 0xce, 0xdc, + 0x0a, 0xea, 0x05, 0x42, 0x25, 0x20, 0xea, 0x2f, 0xa0, 0x34, 0x0d, 0x26, 0x07, 0x96, 0x61, 0x5a, + 0x3e, 0xbb, 0x0e, 0x85, 0x69, 0x30, 0xd1, 0x43, 0x63, 0x22, 0xba, 0xb0, 0x31, 0x0d, 0x26, 0x43, + 0x63, 0xc2, 0x6e, 0x40, 0x91, 0x10, 0x97, 0x33, 0xde, 0x87, 0xbc, 0x86, 0x84, 0xd8, 0x63, 0xf5, + 0xcf, 0x36, 0xa0, 0xd0, 0xb5, 0x43, 0xcb, 0x37, 0x1c, 0x76, 0x0d, 0x36, 0xec, 0xc0, 0x9d, 0x3b, + 0x0e, 0x65, 0x2f, 0x6a, 0x22, 0xc5, 0xae, 0x41, 0xde, 0x7e, 0xf6, 0xca, 0x70, 0x78, 0xde, 0x83, + 0x35, 0x8d, 0x27, 0x59, 0x1d, 0x36, 0xec, 0xcf, 0xbe, 0x44, 0x44, 0x56, 0x20, 0x44, 0x9a, 0x30, + 0x4f, 0x9f, 0x20, 0x26, 0x17, 0x61, 0x28, 0x4d, 0x98, 0x2f, 0x3f, 0x47, 0x0c, 0xf6, 0x3e, 0x4b, + 0x18, 0x4a, 0x63, 0x2d, 0x73, 0xaa, 0x05, 0x07, 0xa0, 0x8a, 0xb5, 0xcc, 0x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xc4, 0x72, 0x2d, 0xdf, + 0x08, 0x2d, 0x53, 0x47, 0xb9, 0xb8, 0x4d, 0x03, 0x27, 0xa6, 0x79, 0x5f, 0xa2, 0x50, 0xd6, 0x54, + 0x26, 0x89, 0x94, 0xfa, 0x03, 0x14, 0xc4, 0xdc, 0xe0, 0xe6, 0x88, 0xeb, 0x2e, 0x2d, 0xd7, 0xf9, + 0xe6, 0x88, 0x70, 0x76, 0x0f, 0xaa, 0xa2, 0x11, 0x41, 0xe8, 0xdb, 0xee, 0x44, 0x70, 0x5d, 0x85, + 0x03, 0x07, 0x04, 0x43, 0x1d, 0x06, 0xf9, 0x42, 0x37, 0x4e, 0x6c, 0x07, 0xd7, 0x77, 0x56, 0xe8, + 0x66, 0x73, 0xc7, 0x69, 0x70, 0x90, 0xda, 0x87, 0xa2, 0x9c, 0xc9, 0x3f, 0x48, 0x9d, 0xea, 0x0c, + 0x2a, 0xc9, 0x1e, 0xfe, 0x61, 0x3a, 0xc2, 0x75, 0x94, 0x20, 0xf4, 0x7c, 0xcb, 0x94, 0x2e, 0x23, + 0x3b, 0x18, 0x50, 0x5a, 0xfd, 0xd3, 0x0c, 0x94, 0x49, 0x57, 0xea, 0x93, 0x26, 0xc8, 0x3e, 0x02, + 0x36, 0xf2, 0x2d, 0x23, 0xb4, 0x74, 0xeb, 0x22, 0xf4, 0x0d, 0xa1, 0x11, 0x71, 0xb5, 0x4a, 0xe1, + 0x98, 0x36, 0x22, 0xb8, 0x52, 0x74, 0x07, 0xca, 0x33, 0xc3, 0x0f, 0xa4, 0x36, 0xce, 0x6b, 0x07, + 0x0e, 0x12, 0xba, 0xb0, 0xe2, 0x4e, 0x7c, 0x63, 0xaa, 0x87, 0xde, 0x99, 0xe5, 0x72, 0x3b, 0x84, + 0x5b, 0x60, 0x35, 0x82, 0x0f, 0x11, 0x4c, 0xe6, 0xc8, 0xff, 0x90, 0x81, 0xea, 0x11, 0x67, 0xd0, + 0xe7, 0xd6, 0x65, 0x8b, 0x9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b9, 0x7a, 0x82, 0x88, 0x06, 0xbb, 0xed, 0x86, + 0xfe, 0xa5, 0x56, 0x75, 0x93, 0x30, 0x76, 0x13, 0xed, 0xdd, 0xae, 0x37, 0x3a, 0xb3, 0xcc, 0xfa, + 0x3b, 0x52, 0x17, 0xe5, 0x69, 0xf6, 0x35, 0x54, 0x89, 0xb1, 0x30, 0x89, 0x95, 0xd7, 0x6f, 0x91, + 0x94, 0x4f, 0xb2, 0x8c, 0x44, 0x69, 0x69, 0x4a, 0xdc, 0x41, 0xed, 0x40, 0x0f, 0xad, 0xe9, 0xcc, + 0xf3, 0xd1, 0xe2, 0x79, 0x57, 0xfa, 0x01, 0x87, 0x12, 0x84, 0x2a, 0x51, 0x74, 0x72, 0xaa, 0x7b, + 0xe3, 0x71, 0x60, 0x85, 0xf5, 0xdb, 0xb4, 0x6e, 0x6a, 0xf2, 0x00, 0xb5, 0x4f, 0x50, 0x52, 0x49, + 0x02, 0xdd, 0xbc, 0x74, 0x8d, 0xa9, 0x3d, 0xaa, 0xdf, 0xe1, 0x86, 0x95, 0x1d, 0xb4, 0x38, 0x20, + 0x69, 0xdb, 0xec, 0xa4, 0x6c, 0x9b, 0x2b, 0x90, 0x37, 0x4f, 0x70, 0x39, 0xde, 0xa5, 0x62, 0x73, + 0xe6, 0x49, 0xc7, 0x64, 0x1f, 0x43, 0x69, 0x26, 0x45, 0x60, 0x5d, 0x4d, 0x7a, 0x70, 0x22, 0xc9, + 0xa8, 0xc5, 0x14, 0x6c, 0x07, 0xca, 0x7b, 0x96, 0x11, 0xce, 0x7d, 0x6b, 0xcf, 0x31, 0x26, 0xf5, + 0x7b, 0x54, 0x52, 0x12, 0x84, 0xad, 0x73, 0xbc, 0x89, 0x3d, 0x32, 0x68, 0xe5, 0xdf, 0xe7, 0x1a, + 0xb0, 0x80, 0x74, 0xcc, 0xd8, 0x24, 0x30, 0x84, 0x5a, 0xfb, 0x5e, 0xd2, 0x24, 0x30, 0x1c, 0xe9, + 0xf4, 0x8c, 0xc7, 0xc2, 0x9a, 0x79, 0xa3, 0xd3, 0xfa, 0x03, 0x5a, 0x6f, 0x55, 0x39, 0x14, 0x6d, + 0x04, 0xde, 0xdc, 0x27, 0x9b, 0x8a, 0x46, 0xf8, 0x8b, 0x05, 0x41, 0x96, 0x5a, 0x86, 0x09, 0x89, + 0x77, 0xb0, 0x96, 0x94, 0x67, 0xbb, 0x79, 0x92, 0xf8, 0x37, 0x7f, 0x09, 0x6c, 0x99, 0x37, 0xde, + 0x26, 0x55, 0xf3, 0x42, 0xaa, 0xfe, 0x6c, 0xfd, 0x59, 0x46, 0x7d, 0x01, 0xd5, 0x94, 0xd0, 0x58, + 0xb9, 0x3b, 0x70, 0x25, 0xd9, 0x98, 0x0a, 0xff, 0x07, 0x4f, 0x48, 0x03, 0xc8, 0x76, 0x27, 0xc2, + 0xb9, 0xcb, 0x0d, 0x20, 0x4a, 0xab, 0xff, 0x65, 0x16, 0x2a, 0x07, 0x46, 0x70, 0x7a, 0x68, 0xcc, + 0x06, 0xa1, 0x11, 0x06, 0xc8, 0x4a, 0xa7, 0x46, 0x70, 0x3a, 0x35, 0x66, 0xdc, 0x5c, 0xc9, 0x70, + 0xbf, 0x8e, 0x80, 0xa1, 0xad, 0x82, 0x4c, 0x8c, 0xc9, 0xbe, 0x7b, 0xf4, 0x5c, 0x38, 0x6d, 0xa2, + 0x34, 0x8a, 0xb0, 0xe0, 0x74, 0x3e, 0x1e, 0x47, 0x55, 0xc9, 0x24, 0xbb, 0x0f, 0x55, 0xf1, 0x93, + 0x6c, 0x95, 0x0b, 0x71, 0x4a, 0x9f, 0x06, 0xb2, 0xa7, 0x50, 0x16, 0x80, 0xa1, 0x14, 0xb8, 0xb5, + 0xc8, 0x19, 0x17, 0x23, 0xb4, 0x24, 0x15, 0xfb, 0x15, 0x5c, 0x4d, 0x24, 0xf7, 0x3c, 0xff, 0x70, + 0xee, 0x84, 0x76, 0xb3, 0x27, 0xb4, 0xbd, 0x77, 0x96, 0x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0xb8, 0x25, 0x70, 0xfb, 0x0a, 0x7f, 0xaa, 0x6d, 0x00, 0xcd, 0x3b, 0x0f, 0xac, 0x90, 0x3c, + 0xe1, 0xd7, 0xa9, 0x8b, 0xa9, 0x13, 0x55, 0xef, 0xfc, 0xc8, 0x0b, 0x22, 0x17, 0xc4, 0xfa, 0x6a, + 0x17, 0x84, 0xfa, 0x09, 0x14, 0x50, 0x5f, 0x30, 0x42, 0x83, 0xdd, 0x17, 0xce, 0x47, 0xae, 0xe5, + 0x08, 0x2f, 0x6c, 0x5c, 0x87, 0x70, 0x47, 0x76, 0x65, 0xbd, 0x94, 0xe7, 0x6e, 0xc2, 0xc8, 0x8f, + 0xf6, 0x2a, 0x51, 0xa0, 0xd0, 0x40, 0xde, 0x81, 0x12, 0x36, 0x8d, 0x8e, 0x8e, 0x84, 0x5c, 0x28, + 0xfa, 0xde, 0x79, 0x13, 0xd3, 0xea, 0xff, 0x98, 0x81, 0x72, 0xdf, 0x37, 0x71, 0x93, 0x1c, 0xcc, + 0xac, 0xd1, 0x5b, 0x3d, 0x26, 0xa8, 0xaf, 0x78, 0x8e, 0x63, 0x90, 0x38, 0x16, 0x46, 0x76, 0x04, + 0x60, 0x9f, 0x41, 0x6e, 0x8c, 0x62, 0x37, 0x9b, 0x34, 0x92, 0x12, 0xc5, 0xcb, 0xdf, 0x28, 0x88, + 0x35, 0x22, 0x55, 0xff, 0x76, 0x54, 0x3f, 0x49, 0xe7, 0xe4, 0xf1, 0xc7, 0x1a, 0x1d, 0x8b, 0x0e, + 0x9a, 0x4a, 0x86, 0x15, 0x21, 0xd7, 0x6a, 0x0f, 0x9a, 0xdc, 0x90, 0x40, 0x93, 0x62, 0xa0, 0xef, + 0x75, 0xb4, 0xc1, 0x50, 0xc9, 0xd1, 0x39, 0x2b, 0x01, 0xba, 0x8d, 0xc1, 0x50, 0x29, 0x32, 0x80, + 0x8d, 0xe3, 0x5e, 0xe7, 0x57, 0xc7, 0x6d, 0x45, 0x51, 0xff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9e, 0x3d, 0x78, 0xaa, 0x49, 0x8a, 0xfb, 0x50, 0x8b, 0x58, 0x83, + 0xd3, 0x7c, 0xc8, 0x27, 0xde, 0x14, 0xac, 0x41, 0x07, 0xb4, 0xbf, 0xcd, 0xc0, 0x4d, 0x7e, 0xb2, + 0x41, 0xe2, 0xff, 0xd0, 0x0a, 0x02, 0x63, 0x62, 0xed, 0x79, 0xfe, 0xde, 0xfc, 0x37, 0xbf, 0xb9, + 0x64, 0x0f, 0x61, 0xf3, 0xc8, 0xf0, 0x2d, 0x37, 0x8c, 0x8e, 0x16, 0x85, 0x67, 0x66, 0x11, 0xcc, + 0x9e, 0x81, 0xc2, 0x41, 0x3c, 0x4c, 0xae, 0x29, 0x8f, 0xcb, 0x16, 0xfd, 0xcf, 0x4b, 0x54, 0x68, + 0xec, 0x95, 0x5a, 0x76, 0x10, 0x6a, 0x68, 0xe9, 0xb3, 0xaf, 0x41, 0x71, 0xbc, 0x73, 0xb4, 0x58, + 0x50, 0x8d, 0xd5, 0x13, 0x8a, 0xb3, 0xd8, 0x25, 0x63, 0x6d, 0xb9, 0x46, 0x84, 0xb1, 0xba, 0xfb, + 0x35, 0x28, 0xf3, 0xd9, 0x2c, 0x9d, 0x75, 0xfd, 0x35, 0x59, 0x89, 0x30, 0xce, 0xfa, 0x21, 0x94, + 0x13, 0xb5, 0xae, 0x50, 0xae, 0x21, 0xae, 0x0b, 0x89, 0x13, 0xf5, 0xac, 0x08, 0xd3, 0x85, 0xb8, + 0x74, 0xf5, 0x9f, 0x5f, 0x07, 0x85, 0x9c, 0x63, 0x1a, 0x85, 0x57, 0xd0, 0x09, 0x65, 0xca, 0x2c, + 0xcb, 0xbc, 0xd5, 0x2c, 0xdb, 0x81, 0xbc, 0x63, 0x4f, 0xa3, 0x68, 0xb5, 0xd4, 0xb9, 0x0f, 0x21, + 0x70, 0xae, 0x3d, 0xdf, 0x9e, 0x90, 0x01, 0x99, 0x8c, 0xdc, 0x24, 0xff, 0x20, 0xda,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0x13, 0x83, 0x46, 0xc2, 0xd1, 0xa7, 0x9e, 0x69, 0xd5, 0x9f, + 0x27, 0x2f, 0x9e, 0xd2, 0xa4, 0xed, 0x1b, 0x38, 0x28, 0xce, 0xa1, 0x67, 0x5a, 0x5a, 0x79, 0x12, + 0x27, 0xd8, 0x33, 0xa8, 0xc7, 0x4c, 0x38, 0x77, 0xb1, 0x5e, 0xb4, 0xf5, 0x6c, 0x77, 0x14, 0xd6, + 0xbb, 0x34, 0xa6, 0xd7, 0x22, 0xfc, 0x31, 0xa2, 0x5b, 0x02, 0xcb, 0x9a, 0xa0, 0x90, 0x70, 0x10, + 0xbb, 0x58, 0x60, 0x9b, 0x56, 0xfd, 0x30, 0x79, 0xb1, 0x8c, 0x8b, 0x4e, 0x24, 0xa1, 0xfd, 0x6a, + 0x60, 0x9b, 0x96, 0x56, 0x1b, 0xa7, 0xd2, 0xea, 0x7f, 0x90, 0x87, 0xa2, 0xb4, 0xea, 0x58, 0x19, + 0x0a, 0xc7, 0xbd, 0xe7, 0xbd, 0xfe, 0xcb, 0x1e, 0xbf, 0x9f, 0xda, 0x18, 0x0c, 0xda, 0xda, 0x50, + 0x31, 0x59, 0x0d, 0x80, 0xee, 0x7c, 0xe9, 0x83, 0x66, 0xa3, 0xc7, 0xef, 0xab, 0xd2, 0x4d, 0x33, + 0x9e, 0x5e, 0x67, 0x5b, 0x50, 0xdd, 0x3b, 0xee, 0xf1, 0x48, 0x4a, 0x02, 0x65, 0x11, 0xd4, 0xfe, + 0x96, 0x1f, 0xce, 0x72, 0x50, 0x0e, 0x41, 0x87, 0x8d, 0x61, 0x5b, 0xeb, 0x48, 0x50, 0x9e, 0x5d, + 0x85, 0xad, 0x88, 0x4a, 0x96, 0xa0, 0x14, 0xb0, 0x21, 0x47, 0x5a, 0xff, 0x9b, 0x76, 0x73, 0xa8, + 0x00, 0x1d, 0xec, 0xee, 0xef, 0x2b, 0x65, 0x56, 0x81, 0x62, 0xab, 0x33, 0x18, 0x76, 0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, 0x1d, 0xb8, + 0xc5, 0x79, 0x7a, 0xf7, 0xb8, 0xd3, 0x6d, 0xe9, 0x83, 0x4e, 0xab, 0xad, 0x1f, 0xf7, 0x06, 0x47, + 0xed, 0x66, 0x67, 0xaf, 0xd3, 0x6e, 0x29, 0x6b, 0xec, 0x26, 0x5c, 0x5b, 0xa2, 0xe0, 0x77, 0x58, + 0x33, 0xec, 0x06, 0x5c, 0x5d, 0xc2, 0x11, 0x27, 0xaf, 0x7f, 0x93, 0x2b, 0xde, 0x51, 0x76, 0xbe, + 0xc9, 0x15, 0xef, 0x2b, 0xef, 0xa9, 0x03, 0xd8, 0x92, 0x3b, 0x3a, 0xdd, 0x96, 0x21, 0x53, 0x73, + 0x1b, 0xf2, 0x5d, 0xeb, 0x95, 0xe5, 0xc8, 0x6b, 0x1f, 0x94, 0x40, 0x68, 0xff, 0xe4, 0xfb, 0x4e, + 0xf4, 0xdc, 0x01, 0x25, 0x50, 0x85, 0xef, 0x25, 0x5e, 0x5c, 0xa0, 0x4b, 0xc2, 0xff, 0x52, 0x06, + 0x8a, 0x91, 0x9e, 0x70, 0x1f, 0xd6, 0x87, 0x03, 0x71, 0x28, 0xb8, 0xfd, 0x38, 0x7e, 0x60, 0x66, + 0x28, 0x7f, 0x69, 0xeb, 0xc3, 0x01, 0xfb, 0x08, 0x36, 0xf8, 0xa5, 0x6f, 0xe1, 0x10, 0xdc, 0x4e, + 0xeb, 0x1e, 0x43, 0xc2, 0x69, 0x82, 0x86, 0x7d, 0x01, 0xa5, 0xa8, 0xb5, 0xc2, 0x43, 0x76, 0x3d, + 0x9d, 0x21, 0x42, 0x6b, 0x31, 0xa5, 0xda, 0x85, 0x5a, 0xba, 0x40, 0x76, 0x1b, 0x80, 0x17, 0x99, + 0x70, 0x03, 0x27, 0x20, 0xec, 0x26, 0xc8, 0xbb, 0xe8, 0x2d, 0x6a, 0x58, 0x35, 0xba, 0x9b, 0xde, + 0x52, 0xff, 0x34, 0x07, 0x10, 0x5b, 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, 0x85, 0x90, 0xff, 0x60, 0x1f, 0x41, 0xfe, 0xc4, 0x9a, - 0xd8, 0xae, 0x90, 0xde, 0x57, 0x17, 0x33, 0xee, 0x22, 0xf2, 0x60, 0x4d, 0xe3, 0x54, 0xec, 0x13, - 0xd8, 0x18, 0x79, 0xd3, 0x48, 0x39, 0x48, 0xee, 0xf4, 0x4b, 0x15, 0x21, 0xf6, 0x60, 0x4d, 0x13, - 0x74, 0xec, 0x0b, 0x28, 0xfa, 0x9e, 0xe3, 0xe0, 0xdc, 0x09, 0xb5, 0xa1, 0xbe, 0x98, 0x47, 0x13, - 0xf8, 0x83, 0x35, 0x2d, 0xa6, 0x55, 0x9f, 0x40, 0x41, 0x34, 0x16, 0x87, 0x61, 0xb7, 0xbd, 0xdf, - 0x11, 0x23, 0xd8, 0xec, 0x1f, 0x1e, 0x76, 0x86, 0xfc, 0x3d, 0x13, 0xad, 0xdf, 0xed, 0xee, 0x36, - 0x9a, 0x2f, 0x94, 0xf5, 0xdd, 0x22, 0x6c, 0xf0, 0x29, 0x56, 0xff, 0x34, 0x03, 0x9b, 0x0b, 0x1d, - 0x60, 0xcf, 0x21, 0x47, 0x56, 0x3b, 0x1f, 0x9e, 0x07, 0x2b, 0x7b, 0x29, 0xa5, 0xb9, 0x4d, 0x82, - 0x39, 0xd4, 0xaf, 0xa0, 0x96, 0x86, 0x4b, 0xa7, 0x19, 0x55, 0x28, 0x69, 0xed, 0x46, 0x4b, 0xef, - 0xf7, 0xba, 0xdf, 0xf2, 0xe3, 0x41, 0x4a, 0xbe, 0xd2, 0x3a, 0x74, 0x8c, 0xf0, 0x37, 0x41, 0x59, - 0x1c, 0x18, 0xb6, 0x8f, 0xf6, 0xe5, 0x74, 0xe6, 0x58, 0xa4, 0xc6, 0x4b, 0x53, 0x76, 0x67, 0xc5, - 0x48, 0x0a, 0x32, 0x1e, 0x24, 0x3c, 0x4a, 0xa5, 0xd5, 0x3f, 0x01, 0xb6, 0x3c, 0x82, 0x7f, 0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x6a, 0x12, 0xa4, 0x59, 0x86, 0xa9, 0x64, 0x70, + 0x96, 0x52, 0xa0, 0xae, 0x37, 0x32, 0x1c, 0x65, 0x9d, 0x42, 0xaf, 0x25, 0x9c, 0xee, 0xa6, 0x2a, + 0x59, 0x1c, 0xba, 0x08, 0xd6, 0xf5, 0xce, 0x8f, 0x7c, 0xdb, 0xf3, 0xed, 0xf0, 0x92, 0xa3, 0x73, + 0x8f, 0xfe, 0x69, 0x11, 0x36, 0x90, 0x92, 0x77, 0x58, 0x41, 0xc3, 0x34, 0x63, 0x18, 0x6d, 0xb1, + 0x9c, 0xd7, 0x49, 0xbf, 0x58, 0x40, 0x64, 0x90, 0x3f, 0xa4, 0xfb, 0x65, 0x11, 0xb9, 0x8e, 0x48, + 0xcd, 0xa2, 0xa0, 0xdd, 0x25, 0x64, 0x76, 0xf7, 0x17, 0xff, 0xf0, 0xaf, 0x6f, 0x67, 0xfe, 0xab, + 0xbf, 0xbe, 0x9d, 0xf9, 0x9f, 0xff, 0xfa, 0xf6, 0xda, 0x9f, 0xff, 0xaf, 0xb7, 0x33, 0xbf, 0xfe, + 0x78, 0x62, 0x87, 0xa7, 0xf3, 0x93, 0xc7, 0x23, 0x6f, 0xfa, 0xc9, 0xd4, 0x08, 0x7d, 0xfb, 0x82, + 0x2b, 0x3a, 0x32, 0xe1, 0x5a, 0x9f, 0xcc, 0xce, 0x26, 0x9f, 0xcc, 0x4e, 0x3e, 0x41, 0x91, 0x7b, + 0xb2, 0x31, 0xf3, 0xbd, 0xd0, 0x7b, 0xfa, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x3a, 0xe4, 0xbd, + 0x36, 0x6d, 0x96, 0x00, 0x00, } func (m *Type) Marshal() (dAtA []byte, err error) { @@ -17999,6 +18064,23 @@ func (m *ForeignKeyDef) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.OnUpdateOrigin != 0 { + i = encodeVarintPlan(dAtA, i, uint64(m.OnUpdateOrigin)) + i-- + dAtA[i] = 0x48 + } + if m.OnDeleteOrigin != 0 { + i = encodeVarintPlan(dAtA, i, uint64(m.OnDeleteOrigin)) + i-- + dAtA[i] = 0x40 + } + if len(m.ReferencedIndexName) > 0 { + i -= len(m.ReferencedIndexName) + copy(dAtA[i:], m.ReferencedIndexName) + i = encodeVarintPlan(dAtA, i, uint64(len(m.ReferencedIndexName))) + i-- + dAtA[i] = 0x3a + } if m.OnUpdate != 0 { i = encodeVarintPlan(dAtA, i, uint64(m.OnUpdate)) i-- @@ -29107,6 +29189,16 @@ func (m *ForeignKeyDef) ProtoSize() (n int) { if m.OnUpdate != 0 { n += 1 + sovPlan(uint64(m.OnUpdate)) } + l = len(m.ReferencedIndexName) + if l > 0 { + n += 1 + l + sovPlan(uint64(l)) + } + if m.OnDeleteOrigin != 0 { + n += 1 + sovPlan(uint64(m.OnDeleteOrigin)) + } + if m.OnUpdateOrigin != 0 { + n += 1 + sovPlan(uint64(m.OnUpdateOrigin)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -39631,6 +39723,76 @@ func (m *ForeignKeyDef) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReferencedIndexName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlan + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlan + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReferencedIndexName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OnDeleteOrigin", wireType) + } + m.OnDeleteOrigin = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OnDeleteOrigin |= ForeignKeyDef_RefActionOrigin(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OnUpdateOrigin", wireType) + } + m.OnUpdateOrigin = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OnUpdateOrigin |= ForeignKeyDef_RefActionOrigin(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipPlan(dAtA[iNdEx:]) diff --git a/pkg/sql/compile/ddl.go b/pkg/sql/compile/ddl.go index 4542f45475d21..f8951bd5cc4f7 100644 --- a/pkg/sql/compile/ddl.go +++ b/pkg/sql/compile/ddl.go @@ -1547,12 +1547,15 @@ func (s *Scope) CreateTable(c *Compile) error { } dedupFkName.Insert(fkey.Name) newDef := &plan.ForeignKeyDef{ - Name: fkey.Name, - Cols: make([]uint64, len(fkey.Cols)), - ForeignTbl: fkey.ForeignTbl, - ForeignCols: make([]uint64, len(fkey.ForeignCols)), - OnDelete: fkey.OnDelete, - OnUpdate: fkey.OnUpdate, + Name: fkey.Name, + Cols: make([]uint64, len(fkey.Cols)), + ForeignTbl: fkey.ForeignTbl, + ForeignCols: make([]uint64, len(fkey.ForeignCols)), + OnDelete: fkey.OnDelete, + OnUpdate: fkey.OnUpdate, + ReferencedIndexName: fkey.ReferencedIndexName, + OnDeleteOrigin: fkey.OnDeleteOrigin, + OnUpdateOrigin: fkey.OnUpdateOrigin, } copy(newDef.ForeignCols, fkey.ForeignCols) @@ -1687,12 +1690,15 @@ func (s *Scope) CreateTable(c *Compile) error { for _, info := range fkRefersToMe { //update foreignCols in fk newDef := &plan.ForeignKeyDef{ - Name: info.Def.Name, - Cols: make([]uint64, len(info.Def.Cols)), - ForeignTbl: tblId, - ForeignCols: make([]uint64, len(info.Def.ForeignCols)), - OnDelete: info.Def.OnDelete, - OnUpdate: info.Def.OnUpdate, + Name: info.Def.Name, + Cols: make([]uint64, len(info.Def.Cols)), + ForeignTbl: tblId, + ForeignCols: make([]uint64, len(info.Def.ForeignCols)), + OnDelete: info.Def.OnDelete, + OnUpdate: info.Def.OnUpdate, + ReferencedIndexName: info.Def.ReferencedIndexName, + OnDeleteOrigin: info.Def.OnDeleteOrigin, + OnUpdateOrigin: info.Def.OnUpdateOrigin, } //child table column ids of the child table copy(newDef.Cols, info.Def.Cols) diff --git a/pkg/sql/plan/build_ddl.go b/pkg/sql/plan/build_ddl.go index f7344d6cf312d..912186ea910c8 100644 --- a/pkg/sql/plan/build_ddl.go +++ b/pkg/sql/plan/build_ddl.go @@ -21,6 +21,7 @@ import ( "iter" "path" "slices" + "sort" "strconv" "strings" "time" @@ -1601,11 +1602,11 @@ func buildTableDefs(stmt *tree.CreateTable, ctx CompilerContext, createTable *pl createTable.TableDef.Fkeys = append(createTable.TableDef.Fkeys, fkData.Def) } - createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, fkData.UpdateSql) - // save self reference foreign keys if fkData.IsSelfRefer { fkDatasOfFKSelfRefer = append(fkDatasOfFKSelfRefer, fkData) + } else { + createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, fkData.UpdateSql) } case *tree.CheckIndex: if err := rejectWindowFunction(ctx, def.Expr); err != nil { @@ -1920,6 +1921,8 @@ func buildTableDefs(stmt *tree.CreateTable, ctx CompilerContext, createTable *pl if err := checkFkColsAreValid(ctx, selfRefer, createTable.TableDef); err != nil { return err } + selfRefer.UpdateSql = getSqlForAddFk(createTable.Database, createTable.TableDef.Name, selfRefer) + createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, selfRefer.UpdateSql) } } @@ -1940,6 +1943,12 @@ func buildTableDefs(stmt *tree.CreateTable, ctx CompilerContext, createTable *pl if err != nil { return err } + // The child was created while foreign_key_checks was disabled, + // so its catalog row already exists with no parent key name. Now + // that the parent has been bound, persist the exact key selected + // by checkFkColsAreValid. + createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, + getSqlForUpdateFkReferencedIndex(rkey.Db, rkey.Tbl, constraintName, data.Def.ReferencedIndexName)) info := &plan.ForeignKeyInfo{ Db: rkey.Db, Table: rkey.Tbl, @@ -4594,9 +4603,6 @@ type FkData struct { UpdateSql string // forward reference ForwardRefer bool - // reference options omitted by the user are MySQL NO ACTION in metadata. - DefaultOnDelete bool - DefaultOnUpdate bool } // getForeignKeyData prepares the foreign key data. @@ -4607,14 +4613,14 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d refer := def.Refer fkData := FkData{ Def: &plan.ForeignKeyDef{ - Name: def.ConstraintSymbol, - Cols: make([]uint64, len(def.KeyParts)), - OnDelete: getRefAction(refer.OnDelete), - OnUpdate: getRefAction(refer.OnUpdate), - ForeignCols: make([]uint64, len(refer.KeyParts)), + Name: def.ConstraintSymbol, + Cols: make([]uint64, len(def.KeyParts)), + OnDelete: getRefAction(refer.OnDelete), + OnUpdate: getRefAction(refer.OnUpdate), + ForeignCols: make([]uint64, len(refer.KeyParts)), + OnDeleteOrigin: foreignKeyActionOrigin(refer.OnDelete), + OnUpdateOrigin: foreignKeyActionOrigin(refer.OnUpdate), }, - DefaultOnDelete: refer.OnDelete == tree.REFERENCE_OPTION_INVALID, - DefaultOnUpdate: refer.OnUpdate == tree.REFERENCE_OPTION_INVALID, } // get fk columns of create table @@ -4679,16 +4685,12 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d fkData.ParentDbName = parentDbName fkData.ParentTableName = parentTableName fkData.Def.ForeignTbl = 0 - fkData.UpdateSql = getSqlForAddFk(dbName, tableDef.Name, &fkData) return &fkData, nil } fkData.ParentDbName = parentDbName fkData.ParentTableName = parentTableName - // make insert mo_foreign_keys - fkData.UpdateSql = getSqlForAddFk(dbName, tableDef.Name, &fkData) - _, parentTableDef, err := ctx.Resolve(parentDbName, parentTableName, nil) if err != nil { return nil, err @@ -4700,6 +4702,10 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d } if !enabled { fkData.ForwardRefer = true + // There is no parent key to bind yet, but the catalog row is the + // durable record that lets the later parent CREATE reconcile this + // forward reference. Its referenced_index_name is backfilled then. + fkData.UpdateSql = getSqlForAddFk(dbName, tableDef.Name, &fkData) return &fkData, nil } return nil, moerr.NewNoSuchTable(ctx.GetContext(), ctx.DefaultDatabase(), parentTableName) @@ -4718,10 +4724,18 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d if err := checkFkColsAreValid(ctx, &fkData, parentTableDef); err != nil { return nil, err } + fkData.UpdateSql = getSqlForAddFk(dbName, tableDef.Name, &fkData) return &fkData, nil } +func foreignKeyActionOrigin(option tree.ReferenceOptionType) plan.ForeignKeyDef_RefActionOrigin { + if option == tree.REFERENCE_OPTION_INVALID { + return plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT + } + return plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT +} + /* checkFkColsAreValid check foreign key columns is valid or not, then it saves them. the columns referred by the foreign key in the children table must appear in the unique keys or primary key @@ -4732,31 +4746,19 @@ create table f1 (a int ,b int, c int ,d int ,e int, primary key(a,b), unique key(c,d), unique key (e)) -Case 1: - - single column like "a" ,"b", "c", "d", "e" can be used as the column in foreign key of the child table - due to they are the member of the primary key or some Unique key. +The referenced columns must exactly match one PRIMARY or UNIQUE key, in the +same order. Prefixes are not enough: with PRIMARY KEY(a, b), only (a, b) is +valid; neither (a) nor (b) identifies the referenced constraint. -Case 2: - - "a, b" can be used as the columns in the foreign key of the child table - due to they are the member of the primary key. - - "c, d" can be used as the columns in the foreign key of the child table - due to they are the member of some unique key. - -Case 3: - - "a, c" can not be used due to they belong to the different primary key / unique key +When more than one exact key exists, PRIMARY is selected first; otherwise the +lexicographically first named UNIQUE key is selected. Persisting this selected +name makes information_schema.REFERENTIAL_CONSTRAINTS deterministic. */ func checkFkColsAreValid(ctx CompilerContext, fkData *FkData, parentTableDef *TableDef) error { // colId in parent table-> position in parent table columnIdPos := make(map[uint64]int) // columnName in parent table -> position in parent table columnNamePos := make(map[string]int) - // columnName of index and pk of parent table -> colId in parent table - uniqueColumns := make([]map[string]uint64, 0, len(parentTableDef.Cols)) - // 1. collect parent column info for i, col := range parentTableDef.Cols { columnIdPos[col.ColId] = i @@ -4773,64 +4775,50 @@ func checkFkColsAreValid(ctx CompilerContext, fkData *FkData, parentTableDef *Ta return err } - // columnName in uk or pk -> its colId in the parent table - collectIndexColumn := func(names []string) { - ret := make(map[string]uint64) - // columnName -> its colId in the parent table - for _, colName := range names { - ret[colName] = parentTableDef.Cols[columnNamePos[colName]].ColId - } - uniqueColumns = append(uniqueColumns, ret) + type referencedKey struct { + name string + columns []string } - - // 3. collect pk column info of the parent table + keys := make([]referencedKey, 0, len(parentTableDef.Indexes)+1) if parentTableDef.Pkey != nil { - collectIndexColumn(parentTableDef.Pkey.Names) + keys = append(keys, referencedKey{name: "PRIMARY", columns: parentTableDef.Pkey.Names}) } - - // 4. collect index column info of the parent table - // secondary key? - // now tableRef.Indices are empty, you can not test it for _, index := range parentTableDef.Indexes { if index.Unique { - collectIndexColumn(index.Parts) - } - } - - // 5. check if there is at least one unique key or primary key should have - // the columns referenced by the foreign keys in the children tables. - matchCol := make([]uint64, 0, len(fkData.ColsReferred.Cols)) - // iterate on every pk or uk - for _, uniqueColumn := range uniqueColumns { - // iterate on the referred column of fk - for i, colName := range fkData.ColsReferred.Cols { - // check if the referred column exists in this pk or uk - if colId, ok := uniqueColumn[colName]; ok { - // check column type - // left part of expr: column type in parent table - // right part of expr: column type in child table - if parentTableDef.Cols[columnIdPos[colId]].Typ.Id != fkData.ColTyps[i].Id { - return moerr.NewInternalErrorf(ctx.GetContext(), "type of reference column '%v' is not match for column '%v'", colName, fkData.Cols.Cols[i]) - } - matchCol = append(matchCol, colId) - } else { - // column in fk does not exist in this pk or uk - matchCol = matchCol[:0] + keys = append(keys, referencedKey{name: index.IndexName, columns: index.Parts}) + } + } + sort.SliceStable(keys, func(i, j int) bool { + if keys[i].name == "PRIMARY" || keys[j].name == "PRIMARY" { + return keys[i].name == "PRIMARY" + } + return keys[i].name < keys[j].name + }) + + for _, key := range keys { + if len(key.columns) != len(fkData.ColsReferred.Cols) { + continue + } + matchCols := make([]uint64, len(key.columns)) + matched := true + for i, colName := range key.columns { + if colName != fkData.ColsReferred.Cols[i] { + matched = false break } + colID := parentTableDef.Cols[columnNamePos[colName]].ColId + if parentTableDef.Cols[columnIdPos[colID]].Typ.Id != fkData.ColTyps[i].Id { + return moerr.NewInternalErrorf(ctx.GetContext(), "type of reference column '%v' is not match for column '%v'", colName, fkData.Cols.Cols[i]) + } + matchCols[i] = colID } - - if len(matchCol) > 0 { - break + if matched { + fkData.Def.ForeignCols = matchCols + fkData.Def.ReferencedIndexName = key.name + return nil } } - - if len(matchCol) == 0 { - return moerr.NewInternalError(ctx.GetContext(), "failed to add the foreign key constraint") - } else { - fkData.Def.ForeignCols = matchCol - } - return nil + return moerr.NewInternalError(ctx.GetContext(), "failed to add the foreign key constraint") } func checkFkVirtualGeneratedColumns(ctx context.Context, parentTableDef *TableDef, referredCols []string) error { @@ -4854,11 +4842,14 @@ func buildFkDataOfForwardRefer(ctx CompilerContext, createTable *plan.CreateTable) (*FkData, error) { fkData := FkData{ Def: &plan.ForeignKeyDef{ - Name: constraintName, - Cols: make([]uint64, len(fkDefs)), - OnDelete: convertIntoReferAction(fkDefs[0].OnDelete), - OnUpdate: convertIntoReferAction(fkDefs[0].OnUpdate), - ForeignCols: make([]uint64, len(fkDefs)), + Name: constraintName, + Cols: make([]uint64, len(fkDefs)), + OnDelete: convertIntoReferAction(fkDefs[0].OnDelete), + OnUpdate: convertIntoReferAction(fkDefs[0].OnUpdate), + ForeignCols: make([]uint64, len(fkDefs)), + ReferencedIndexName: fkDefs[0].ReferencedIndexName, + OnDeleteOrigin: convertIntoReferActionOrigin(fkDefs[0].OnDeleteOrigin), + OnUpdateOrigin: convertIntoReferActionOrigin(fkDefs[0].OnUpdateOrigin), }, } // 1. get tableDef of the child table diff --git a/pkg/sql/plan/build_ddl_test.go b/pkg/sql/plan/build_ddl_test.go index f793f8fdf04b4..1a3007924aa91 100644 --- a/pkg/sql/plan/build_ddl_test.go +++ b/pkg/sql/plan/build_ddl_test.go @@ -1790,3 +1790,94 @@ func TestPartitionCreateSQLIsModeIndependentForAddPartition(t *testing.T) { require.NoError(t, err) require.Len(t, defs, 1) } + +func TestCheckFkColsAreValidRecordsExactReferencedKey(t *testing.T) { + ctx := NewMockCompilerContext(true) + ctx.SetContext(context.Background()) + intType := plan.Type{Id: int32(types.T_int32)} + parent := &TableDef{ + Name: "parent", + Cols: []*plan.ColDef{ + {ColId: 1, Name: "id", Typ: intType}, + {ColId: 2, Name: "code", Typ: intType}, + }, + Pkey: &plan.PrimaryKeyDef{Names: []string{"id"}}, + Indexes: []*plan.IndexDef{ + {IndexName: "uq_parent_id", Unique: true, Parts: []string{"id"}}, + {IndexName: "uq_parent_code", Unique: true, Parts: []string{"code"}}, + }, + } + newFK := func(columns ...string) *FkData { + return &FkData{ + ParentTableName: "parent", + Cols: &plan.FkColName{Cols: columns}, + ColsReferred: &plan.FkColName{Cols: columns}, + Def: &plan.ForeignKeyDef{}, + ColTyps: map[int]*plan.Type{ + 0: &intType, + }, + } + } + + fk := newFK("id") + require.NoError(t, checkFkColsAreValid(ctx, fk, parent)) + require.Equal(t, "PRIMARY", fk.Def.ReferencedIndexName) + require.Equal(t, []uint64{1}, fk.Def.ForeignCols) + + composite := newFK("id", "code") + composite.ColTyps[1] = &intType + require.Error(t, checkFkColsAreValid(ctx, composite, parent), "a partial/mismatched key must not be accepted") + + unique := newFK("code") + require.NoError(t, checkFkColsAreValid(ctx, unique, parent)) + require.Equal(t, "uq_parent_code", unique.Def.ReferencedIndexName) +} + +func TestForwardForeignKeyCatalogLifecycle(t *testing.T) { + ctx := NewMockCompilerContext(true) + ctx.SetContext(context.Background()) + ctx.ResolveVariableFunc = func(name string, _, _ bool) (interface{}, error) { + if name == "foreign_key_checks" { + return int64(0), nil + } + return nil, moerr.NewInternalError(context.Background(), "unexpected variable") + } + intType := plan.Type{Id: int32(types.T_int32)} + child := &TableDef{ + Name: "child", + Cols: []*plan.ColDef{{ColId: 1, Name: "parent_id", Typ: intType}}, + } + stmt, err := parsers.ParseOne(context.Background(), dialect.MYSQL, + "create table child (parent_id int, constraint fk_child_parent foreign key (parent_id) references parent (id))", 1) + require.NoError(t, err) + defer stmt.Free() + var foreignKey *tree.ForeignKey + for _, def := range stmt.(*tree.CreateTable).Defs { + if foreignKey, _ = def.(*tree.ForeignKey); foreignKey != nil { + break + } + } + require.NotNil(t, foreignKey) + + data, err := getForeignKeyData(ctx, "db", child, foreignKey) + require.NoError(t, err) + require.True(t, data.ForwardRefer) + require.NotEmpty(t, data.UpdateSql, "the child must persist its deferred FK catalog row") + require.Contains(t, data.UpdateSql, "'fk_child_parent'") + require.Contains(t, data.UpdateSql, "''", "the parent key is intentionally unresolved at child creation") + + ctx.tables["child"] = child + parent := &TableDef{ + Name: "parent", + Cols: []*plan.ColDef{{ColId: 2, Name: "id", Typ: intType}}, + Pkey: &plan.PrimaryKeyDef{Names: []string{"id"}}, + } + resolved, err := buildFkDataOfForwardRefer(ctx, "fk_child_parent", []*FkReferDef{{ + Db: "db", Tbl: "child", Col: "parent_id", ReferCol: "id", OnDelete: "NO_ACTION", OnUpdate: "NO_ACTION", + }}, &plan.CreateTable{Database: "db", TableDef: parent}) + require.NoError(t, err) + require.Equal(t, "PRIMARY", resolved.Def.ReferencedIndexName) + require.Equal(t, + "update `mo_catalog`.`mo_foreign_keys` set referenced_index_name = 'PRIMARY' where db_name = 'db' and table_name = 'child' and constraint_name = 'fk_child_parent'", + getSqlForUpdateFkReferencedIndex("db", "child", "fk_child_parent", resolved.Def.ReferencedIndexName)) +} diff --git a/pkg/sql/plan/build_dml_util.go b/pkg/sql/plan/build_dml_util.go index 4a4e823fef956..ec3887238470c 100644 --- a/pkg/sql/plan/build_dml_util.go +++ b/pkg/sql/plan/build_dml_util.go @@ -4620,13 +4620,16 @@ type FkReferKey struct { // FkReferDef holds the definition & details of the foreign key type FkReferDef struct { - Db string //fk database name - Tbl string //fk table name - Name string //fk constraint name - Col string //fk column name, letter case: lower - ReferCol string //referenced column name, letter case: lower - OnDelete string //on delete action - OnUpdate string //on update action + Db string //fk database name + Tbl string //fk table name + Name string //fk constraint name + Col string //fk column name, letter case: lower + ReferCol string //referenced column name, letter case: lower + OnDelete string //on delete action + OnUpdate string //on update action + ReferencedIndexName string + OnDeleteOrigin string + OnUpdateOrigin string } func (fk FkReferDef) String() string { @@ -4656,7 +4659,10 @@ func GetSqlForFkReferredTo(db, table string) string { "column_name, "+ "refer_column_name, "+ "on_delete, "+ - "on_update "+ + "on_update, "+ + "referenced_index_name, "+ + "on_delete_origin, "+ + "on_update_origin "+ "from "+ "`mo_catalog`.`mo_foreign_keys` "+ "where "+ @@ -4685,6 +4691,9 @@ func GetFkReferredTo(ctx CompilerContext, db, table string) (map[FkReferKey]map[ const referColIdx = 4 const deleteIdx = 5 const updateIdx = 6 + const referencedIndexIdx = 7 + const deleteOriginIdx = 8 + const updateOriginIdx = 9 if res.Batches != nil { for _, batch := range res.Batches { if batch != nil && @@ -4692,13 +4701,16 @@ func GetFkReferredTo(ctx CompilerContext, db, table string) (map[FkReferKey]map[ batch.Vecs[0].Length() > 0 { for i := 0; i < batch.Vecs[0].Length(); i++ { fk := &FkReferDef{ - Db: string(batch.Vecs[dbIdx].GetBytesAt(i)), - Tbl: string(batch.Vecs[tblIdx].GetBytesAt(i)), - Name: string(batch.Vecs[nameIdx].GetBytesAt(i)), - Col: string(batch.Vecs[colIdx].GetBytesAt(i)), - ReferCol: string(batch.Vecs[referColIdx].GetBytesAt(i)), - OnDelete: string(batch.Vecs[deleteIdx].GetBytesAt(i)), - OnUpdate: string(batch.Vecs[updateIdx].GetBytesAt(i)), + Db: string(batch.Vecs[dbIdx].GetBytesAt(i)), + Tbl: string(batch.Vecs[tblIdx].GetBytesAt(i)), + Name: string(batch.Vecs[nameIdx].GetBytesAt(i)), + Col: string(batch.Vecs[colIdx].GetBytesAt(i)), + ReferCol: string(batch.Vecs[referColIdx].GetBytesAt(i)), + OnDelete: string(batch.Vecs[deleteIdx].GetBytesAt(i)), + OnUpdate: string(batch.Vecs[updateIdx].GetBytesAt(i)), + ReferencedIndexName: string(batch.Vecs[referencedIndexIdx].GetBytesAt(i)), + OnDeleteOrigin: string(batch.Vecs[deleteOriginIdx].GetBytesAt(i)), + OnUpdateOrigin: string(batch.Vecs[updateOriginIdx].GetBytesAt(i)), } key := FkReferKey{Db: fk.Db, Tbl: fk.Tbl} var constraint map[string][]*FkReferDef @@ -4738,13 +4750,24 @@ func convertIntoReferAction(s string) plan.ForeignKeyDef_RefAction { } } +func convertIntoReferActionOrigin(s string) plan.ForeignKeyDef_RefActionOrigin { + switch strings.ToUpper(strings.TrimSpace(s)) { + case plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT.String(): + return plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT + case plan.ForeignKeyDef_ACTION_ORIGIN_LEGACY_AMBIGUOUS.String(): + return plan.ForeignKeyDef_ACTION_ORIGIN_LEGACY_AMBIGUOUS + default: + return plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT + } +} + // getSqlForAddFk returns the insert sql that adds a fk relationship // into the mo_foreign_keys table func getSqlForAddFk(db, table string, data *FkData) string { - row := make([]string, 16) + row := make([]string, 19) rows := 0 sb := strings.Builder{} - sb.WriteString("insert into `mo_catalog`.`mo_foreign_keys` ") + sb.WriteString("insert into `mo_catalog`.`mo_foreign_keys` (constraint_name, constraint_id, db_name, db_id, table_name, table_id, column_name, column_id, refer_db_name, refer_db_id, refer_table_name, refer_table_id, refer_column_name, refer_column_id, on_delete, on_update, referenced_index_name, on_delete_origin, on_update_origin)") sb.WriteString(" values ") for childIdx, childCol := range data.Cols.Cols { row[0] = data.Def.Name @@ -4764,10 +4787,13 @@ func getSqlForAddFk(db, table string, data *FkData) string { row[13] = "0" row[14] = data.Def.OnDelete.String() row[15] = data.Def.OnUpdate.String() - if data.DefaultOnDelete { + row[16] = data.Def.ReferencedIndexName + row[17] = data.Def.OnDeleteOrigin.String() + row[18] = data.Def.OnUpdateOrigin.String() + if data.Def.OnDeleteOrigin == plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT { row[14] = plan.ForeignKeyDef_NO_ACTION.String() } - if data.DefaultOnUpdate { + if data.Def.OnUpdateOrigin == plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT { row[15] = plan.ForeignKeyDef_NO_ACTION.String() } { @@ -4788,6 +4814,16 @@ func getSqlForAddFk(db, table string, data *FkData) string { return sb.String() } +func getSqlForUpdateFkReferencedIndex(db, table, constraintName, referencedIndexName string) string { + return fmt.Sprintf( + "update `mo_catalog`.`mo_foreign_keys` set referenced_index_name = %s where db_name = %s and table_name = %s and constraint_name = %s", + quoteSQLStringLiteral(referencedIndexName), + quoteSQLStringLiteral(db), + quoteSQLStringLiteral(table), + quoteSQLStringLiteral(constraintName), + ) +} + // getSqlForDeleteTable returns the delete sql that deletes all the fk relationships from mo_foreign_keys // on the table func getSqlForDeleteTable(db, tbl string) string { diff --git a/pkg/sql/plan/build_dml_util_test.go b/pkg/sql/plan/build_dml_util_test.go index 4786e588f8374..b1db2060eb2f5 100644 --- a/pkg/sql/plan/build_dml_util_test.go +++ b/pkg/sql/plan/build_dml_util_test.go @@ -109,20 +109,28 @@ func TestGetSqlForAddFkRecordsCompositeColumnOrder(t *testing.T) { func TestGetSqlForAddFkStoresDefaultActionsAsNoAction(t *testing.T) { fkData := &FkData{ Def: &plan.ForeignKeyDef{ - Name: "fk_default_action", - OnDelete: plan.ForeignKeyDef_RESTRICT, - OnUpdate: plan.ForeignKeyDef_RESTRICT, + Name: "fk_default_action", + OnDelete: plan.ForeignKeyDef_RESTRICT, + OnUpdate: plan.ForeignKeyDef_RESTRICT, + OnDeleteOrigin: plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT, + OnUpdateOrigin: plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT, }, Cols: &plan.FkColName{Cols: []string{"child_id"}}, ColsReferred: &plan.FkColName{Cols: []string{"parent_id"}}, ParentDbName: "parent_db", ParentTableName: "parent", - DefaultOnDelete: true, - DefaultOnUpdate: true, } sql := getSqlForAddFk("child_db", "child", fkData) require.Contains(t, sql, "'NO_ACTION','NO_ACTION'") + require.Contains(t, sql, "'ACTION_ORIGIN_DEFAULT','ACTION_ORIGIN_DEFAULT'") +} + +func TestGetSqlForUpdateFkReferencedIndexEscapesCatalogValues(t *testing.T) { + require.Equal(t, + "update `mo_catalog`.`mo_foreign_keys` set referenced_index_name = 'uk\\'parent' where db_name = 'child\\'db' and table_name = 'child\\\\table' and constraint_name = 'fk\\'child'", + getSqlForUpdateFkReferencedIndex("child'db", `child\table`, "fk'child", "uk'parent"), + ) } func TestGetSqlForCheckHasDBRefersToEscapesStringLiterals(t *testing.T) { @@ -167,9 +175,9 @@ func TestGetSqlForAddFkEscapesCatalogValues(t *testing.T) { } require.Equal(t, - "insert into `mo_catalog`.`mo_foreign_keys` values "+ - "('fk\\\\name\\'one','1','child\\'db\\\\part','0','child\\\\table\\'name','0','child\\\\col\\'name','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent\\\\col\\'name','0','CASCADE','RESTRICT'),"+ - "('fk\\\\name\\'one','2','child\\'db\\\\part','0','child\\\\table\\'name','0','child_col_two','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent_col_two','0','CASCADE','RESTRICT')", + "insert into `mo_catalog`.`mo_foreign_keys` (constraint_name, constraint_id, db_name, db_id, table_name, table_id, column_name, column_id, refer_db_name, refer_db_id, refer_table_name, refer_table_id, refer_column_name, refer_column_id, on_delete, on_update, referenced_index_name, on_delete_origin, on_update_origin) values "+ + "('fk\\\\name\\'one','1','child\\'db\\\\part','0','child\\\\table\\'name','0','child\\\\col\\'name','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent\\\\col\\'name','0','CASCADE','RESTRICT','','ACTION_ORIGIN_EXPLICIT','ACTION_ORIGIN_EXPLICIT'),"+ + "('fk\\\\name\\'one','2','child\\'db\\\\part','0','child\\\\table\\'name','0','child_col_two','0','parent\\\\db\\'name','0','parent\\\\table\\'name','0','parent_col_two','0','CASCADE','RESTRICT','','ACTION_ORIGIN_EXPLICIT','ACTION_ORIGIN_EXPLICIT')", getSqlForAddFk(`child'db\part`, `child\table'name`, fk), ) } diff --git a/pkg/sql/plan/deepcopy.go b/pkg/sql/plan/deepcopy.go index a47f34eca3533..a69cafa232dca 100644 --- a/pkg/sql/plan/deepcopy.go +++ b/pkg/sql/plan/deepcopy.go @@ -899,12 +899,15 @@ func DeepCopyDataDefinition(old *plan.DataDefinition) *plan.DataDefinition { func DeepCopyFkey(fkey *ForeignKeyDef) *ForeignKeyDef { def := &ForeignKeyDef{ - Name: fkey.Name, - Cols: slices.Clone(fkey.Cols), - ForeignTbl: fkey.ForeignTbl, - ForeignCols: slices.Clone(fkey.ForeignCols), - OnDelete: fkey.OnDelete, - OnUpdate: fkey.OnUpdate, + Name: fkey.Name, + Cols: slices.Clone(fkey.Cols), + ForeignTbl: fkey.ForeignTbl, + ForeignCols: slices.Clone(fkey.ForeignCols), + OnDelete: fkey.OnDelete, + OnUpdate: fkey.OnUpdate, + ReferencedIndexName: fkey.ReferencedIndexName, + OnDeleteOrigin: fkey.OnDeleteOrigin, + OnUpdateOrigin: fkey.OnUpdateOrigin, } return def } diff --git a/pkg/util/sysview/predefined.go b/pkg/util/sysview/predefined.go index 51db6ac514a0d..5432a0dcaaed6 100644 --- a/pkg/util/sysview/predefined.go +++ b/pkg/util/sysview/predefined.go @@ -410,25 +410,17 @@ var ( "fk.constraint_name AS CONSTRAINT_NAME, " + "'def' AS UNIQUE_CONSTRAINT_CATALOG, " + "fk.refer_db_name AS UNIQUE_CONSTRAINT_SCHEMA, " + - "idx.name AS UNIQUE_CONSTRAINT_NAME," + + "fk.referenced_index_name AS UNIQUE_CONSTRAINT_NAME," + "'NONE' AS MATCH_OPTION, " + "replace(fk.on_update, '_', ' ') AS UPDATE_RULE, " + "replace(fk.on_delete, '_', ' ') AS DELETE_RULE, " + "fk.table_name AS TABLE_NAME, " + "fk.refer_table_name AS REFERENCED_TABLE_NAME " + "FROM (" + - "SELECT db_name, table_name, constraint_name, refer_db_name, refer_table_name, on_update, on_delete, " + - "group_concat(concat(constraint_id, ':', length(refer_column_name), ':', refer_column_name) order by constraint_id) AS referenced_columns " + + "SELECT db_name, table_name, constraint_name, refer_db_name, refer_table_name, on_update, on_delete, referenced_index_name " + "FROM mo_catalog.mo_foreign_keys " + - "GROUP BY db_name, table_name, constraint_name, refer_db_name, refer_table_name, on_update, on_delete" + - ") fk " + - "JOIN mo_catalog.mo_tables tbl ON (tbl.reldatabase = fk.refer_db_name AND tbl.relname = fk.refer_table_name AND tbl.account_id = current_account_id()) " + - "JOIN (" + - "SELECT table_id, name, group_concat(concat(ordinal_position, ':', length(column_name), ':', column_name) order by ordinal_position) AS indexed_columns " + - "FROM mo_catalog.mo_indexes " + - "WHERE type = 'PRIMARY' OR type = 'UNIQUE' " + - "GROUP BY table_id, name" + - ") idx ON (idx.table_id = tbl.rel_id AND idx.indexed_columns = fk.referenced_columns)" + "GROUP BY db_name, table_name, constraint_name, refer_db_name, refer_table_name, on_update, on_delete, referenced_index_name" + + ") fk" InformationSchemaEnginesDDL = "CREATE TABLE information_schema.ENGINES (" + "ENGINE varchar(64)," + diff --git a/pkg/util/sysview/predefined_test.go b/pkg/util/sysview/predefined_test.go index 3fe480ad28faa..4511ac9dd6c56 100644 --- a/pkg/util/sysview/predefined_test.go +++ b/pkg/util/sysview/predefined_test.go @@ -80,17 +80,11 @@ func TestInformationSchemaReferentialConstraintsDDL_UsesMySQLDefaultAction(t *te "replace(fk.on_delete, '_', ' ') AS DELETE_RULE") assert.NotContains(t, InformationSchemaReferentialConstraintsDDL, "upper(fk.on_update)") assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "tbl.reldatabase = fk.refer_db_name AND tbl.relname = fk.refer_table_name") + "fk.referenced_index_name AS UNIQUE_CONSTRAINT_NAME") assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "idx.table_id = tbl.rel_id AND idx.indexed_columns = fk.referenced_columns") - assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "group_concat(concat(constraint_id, ':', length(refer_column_name), ':', refer_column_name) order by constraint_id) AS referenced_columns") - assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "group_concat(concat(ordinal_position, ':', length(column_name), ':', column_name) order by ordinal_position) AS indexed_columns") - assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "WHERE type = 'PRIMARY' OR type = 'UNIQUE'") - assert.Contains(t, InformationSchemaReferentialConstraintsDDL, - "idx.name AS UNIQUE_CONSTRAINT_NAME") + "referenced_index_name") + assert.NotContains(t, InformationSchemaReferentialConstraintsDDL, "mo_catalog.mo_indexes") + assert.NotContains(t, InformationSchemaReferentialConstraintsDDL, "group_concat") assert.NotContains(t, InformationSchemaReferentialConstraintsDDL, "min(idx.type)") } diff --git a/proto/plan.proto b/proto/plan.proto index a959a227d6708..80daf75934c62 100644 --- a/proto/plan.proto +++ b/proto/plan.proto @@ -370,6 +370,16 @@ message ForeignKeyDef { NO_ACTION = 4; } + // Whether a reference action was written in the FK declaration. This is + // persisted separately from RefAction because an omitted action and an + // explicit RESTRICT have the same execution behavior but distinct MySQL + // metadata/SHOW CREATE representations. + enum RefActionOrigin { + ACTION_ORIGIN_EXPLICIT = 0; + ACTION_ORIGIN_DEFAULT = 1; + ACTION_ORIGIN_LEGACY_AMBIGUOUS = 2; + } + // letter case: lower string name = 1; repeated uint64 cols = 2; @@ -379,6 +389,10 @@ message ForeignKeyDef { repeated uint64 foreign_cols = 4; RefAction on_delete = 5; RefAction on_update = 6; + // Exact PRIMARY/UNIQUE parent key selected when this FK was bound. + string referenced_index_name = 7; + RefActionOrigin on_delete_origin = 8; + RefActionOrigin on_update_origin = 9; } message CheckDef { diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result index b377e2b578050..61846384ba46f 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result @@ -22,6 +22,15 @@ order by constraint_name; fk_c_p ¦ PRIMARY ¦ NO ACTION ¦ NO ACTION 𝄀 fk_c_p_compound ¦ uq_p_compound ¦ NO ACTION ¦ NO ACTION 𝄀 fk_c_p_restrict ¦ PRIMARY ¦ RESTRICT ¦ RESTRICT +select constraint_name, referenced_index_name, on_delete_origin, on_update_origin +from mo_catalog.mo_foreign_keys +where db_name = database() +group by constraint_name, referenced_index_name, on_delete_origin, on_update_origin +order by constraint_name; +➤ constraint_name[12,-1,0] ¦ referenced_index_name[12,-1,0] ¦ on_delete_origin[12,-1,0] ¦ on_update_origin[12,-1,0] 𝄀 +fk_c_p ¦ PRIMARY ¦ ACTION_ORIGIN_DEFAULT ¦ ACTION_ORIGIN_DEFAULT 𝄀 +fk_c_p_compound ¦ uq_p_compound ¦ ACTION_ORIGIN_DEFAULT ¦ ACTION_ORIGIN_DEFAULT 𝄀 +fk_c_p_restrict ¦ PRIMARY ¦ ACTION_ORIGIN_EXPLICIT ¦ ACTION_ORIGIN_EXPLICIT select count(*) as referential_constraint_count from information_schema.referential_constraints where constraint_schema = database(); diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql index 4fa098033d746..ef78b385afb51 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql @@ -22,6 +22,12 @@ from information_schema.referential_constraints where constraint_schema = database() order by constraint_name; +select constraint_name, referenced_index_name, on_delete_origin, on_update_origin +from mo_catalog.mo_foreign_keys +where db_name = database() +group by constraint_name, referenced_index_name, on_delete_origin, on_update_origin +order by constraint_name; + select count(*) as referential_constraint_count from information_schema.referential_constraints where constraint_schema = database(); From 2fa86ba0f443fc01f63ad928f855eac9e6b6ab8c Mon Sep 17 00:00:00 2001 From: daviszhen Date: Tue, 4 Aug 2026 11:45:24 +0800 Subject: [PATCH 15/24] update --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 240 +++++++++++++++--- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 129 +++++++++- 2 files changed, 320 insertions(+), 49 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index 8676a1324279d..cb6b5b75df414 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -111,9 +111,21 @@ type legacyForeignKeyCatalogConstraint struct { rows []legacyForeignKeyCatalogRow } +type legacyReferenceAction struct { + name string + origin string +} + +type legacyForeignKeyActions struct { + onDelete legacyReferenceAction + onUpdate legacyReferenceAction +} + // upgradeLegacyForeignKeyMetadata restores zero-valued legacy FK ordinals. The -// catalog identifies the rows and actions to migrate, while SHOW CREATE TABLE -// supplies the current foreign-key declaration name and column order. +// catalog identifies the current constraints and SHOW CREATE TABLE supplies +// their current names and column order. rel_createsql is consulted only as a +// historical syntax record for a named CREATE-time FK that still reconciles +// with the catalog; it is never treated as the current table definition. func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn executor.TxnExecutor) error { ordinalDefinitions, err := getLegacyForeignKeyTableDefinitions(legacyForeignKeyTableDefinitionsSQL, tenantID, txn) if err != nil { @@ -137,6 +149,19 @@ func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn ex showCreateByTable[key] = createSQL return createSQL, nil } + historicalCreateByTable := make(map[string]string) + getHistoricalCreate := func(definition legacyForeignKeyTableDefinition) (string, error) { + key := definition.database + "\x00" + definition.table + if createSQL, ok := historicalCreateByTable[key]; ok { + return createSQL, nil + } + createSQL, err := getLegacyForeignKeyHistoricalCreateSQL(tenantID, txn, definition) + if err != nil { + return "", err + } + historicalCreateByTable[key] = createSQL + return createSQL, nil + } // constraint_id and action origins have a legacy zero-value sentinel, so // only those rows need the ordinal/action migration. @@ -145,7 +170,11 @@ func upgradeLegacyForeignKeyMetadata(ctx context.Context, tenantID int32, txn ex if err != nil { return err } - updates, err := legacyForeignKeyMetadataUpdates(definition, createSQL) + historicalCreateSQL, err := getHistoricalCreate(definition) + if err != nil { + return err + } + updates, err := legacyForeignKeyMetadataUpdatesWithHistoricalDefinition(definition, createSQL, historicalCreateSQL) if err != nil { return err } @@ -405,7 +434,50 @@ func getLegacyForeignKeyShowCreateSQL(tenantID int32, txn executor.TxnExecutor, return createSQL, nil } +func getLegacyForeignKeyHistoricalCreateSQL(tenantID int32, txn executor.TxnExecutor, definition legacyForeignKeyTableDefinition) (string, error) { + query := fmt.Sprintf( + "SELECT rel_createsql FROM mo_catalog.mo_tables WHERE account_id = %d AND reldatabase = %s AND relname = %s", + tenantID, sqlquote.String(definition.database), sqlquote.String(definition.table), + ) + res, err := txn.Exec(query, executor.StatementOption{}.WithAccountID(uint32(tenantID))) + if err != nil { + return "", err + } + defer res.Close() + + var createSQL string + rowCount := 0 + validResult := true + res.ReadRows(func(rows int, cols []*vector.Vector) bool { + if len(cols) < 1 { + validResult = false + return false + } + for i := 0; i < rows; i++ { + rowCount++ + if rowCount != 1 { + validResult = false + return false + } + createSQL = cols[0].GetStringAt(i) + } + return true + }) + if !validResult || rowCount > 1 { + return "", moerr.NewInternalErrorNoCtxf("historical CREATE definition for legacy foreign-key table %s.%s returned an invalid result", definition.database, definition.table) + } + return createSQL, nil +} + func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, createSQL string) ([]string, error) { + return legacyForeignKeyMetadataUpdatesWithHistoricalDefinition(definition, createSQL, "") +} + +func legacyForeignKeyMetadataUpdatesWithHistoricalDefinition( + definition legacyForeignKeyTableDefinition, + createSQL string, + historicalCreateSQL string, +) ([]string, error) { statements, err := mysql.Parse(context.Background(), createSQL, 1) if err != nil { return nil, moerr.NewInternalErrorNoCtxf("parse legacy foreign-key table %s.%s: %v", definition.database, definition.table, err) @@ -425,6 +497,7 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, } constraints := legacyForeignKeyCatalogConstraints(definition.foreignKeys) + historicalActions := legacyForeignKeyHistoricalActions(definition, constraints, historicalCreateSQL) matchedConstraints := make(map[string]bool) updates := make([]string, 0) for _, tableDef := range createTable.Defs { @@ -444,12 +517,15 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, for _, constraint := range constraints { if constraint.name == foreignKey.ConstraintSymbol && sameLegacyForeignKeyColumns(definition.database, foreignKey, constraint.rows) { - onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) + actions, err := legacyForeignKeyCatalogConstraintActions(constraint) if err != nil { return nil, err } + if historical, ok := historicalActions[constraint.name]; ok { + actions = historical + } matchedConstraints[constraint.name] = true - updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey, onDelete, onUpdate) + updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey, actions) break } } @@ -473,12 +549,15 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, } if matchedIndex >= 0 { constraint := constraints[matchedIndex] - onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) + actions, err := legacyForeignKeyCatalogConstraintActions(constraint) if err != nil { return nil, err } + if historical, ok := historicalActions[constraint.name]; ok { + actions = historical + } matchedConstraints[constraint.name] = true - updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey, onDelete, onUpdate) + updates = appendLegacyForeignKeyASTUpdates(updates, definition, constraint.name, foreignKey, actions) } } @@ -496,23 +575,107 @@ func legacyForeignKeyMetadataUpdates(definition legacyForeignKeyTableDefinition, constraint.name, definition.database, definition.table, ) } - onDelete, onUpdate, err := legacyForeignKeyCatalogConstraintActions(constraint) + actions, err := legacyForeignKeyCatalogConstraintActions(constraint) if err != nil { return nil, err } + if historical, ok := historicalActions[constraint.name]; ok { + actions = historical + } row := constraint.rows[0] updates = append(updates, legacyForeignKeyUpdateSQL( definition, constraint.name, row.columnName, 1, - onDelete, - onUpdate, + actions, )) } return updates, nil } +// legacyForeignKeyHistoricalActions extracts action syntax only for named +// CREATE-time constraints that still match the authoritative catalog by name, +// child columns, referenced table, and referenced columns. Invalid, stale, or +// unnamed historical definitions are ignored so ALTER-added and generated-name +// constraints continue through the catalog/SHOW CREATE fallback. +func legacyForeignKeyHistoricalActions( + definition legacyForeignKeyTableDefinition, + constraints []legacyForeignKeyCatalogConstraint, + createSQL string, +) map[string]legacyForeignKeyActions { + if strings.TrimSpace(createSQL) == "" { + return nil + } + statements, err := mysql.Parse(context.Background(), createSQL, 1) + if err != nil { + return nil + } + defer func() { + for _, statement := range statements { + statement.Free() + } + }() + if len(statements) != 1 { + return nil + } + createTable, ok := statements[0].(*tree.CreateTable) + if !ok { + return nil + } + + actionsByConstraint := make(map[string]legacyForeignKeyActions) + for _, tableDef := range createTable.Defs { + foreignKey, ok := tableDef.(*tree.ForeignKey) + if !ok || foreignKey.Refer == nil || foreignKey.ConstraintSymbol == "" { + continue + } + for _, constraint := range constraints { + if constraint.name != foreignKey.ConstraintSymbol || + !sameLegacyForeignKeyColumns(definition.database, foreignKey, constraint.rows) { + continue + } + catalogActions, err := legacyForeignKeyCatalogConstraintActions(constraint) + if err != nil { + continue + } + historicalActions := legacyForeignKeyASTActions(foreignKey) + if legacyHistoricalActionMatchesCatalog(historicalActions.onDelete, catalogActions.onDelete) && + legacyHistoricalActionMatchesCatalog(historicalActions.onUpdate, catalogActions.onUpdate) { + actionsByConstraint[constraint.name] = historicalActions + } + break + } + } + return actionsByConstraint +} + +func legacyForeignKeyASTActions(foreignKey *tree.ForeignKey) legacyForeignKeyActions { + return legacyForeignKeyActions{ + onDelete: legacyASTReferenceAction(foreignKey.Refer.OnDelete), + onUpdate: legacyASTReferenceAction(foreignKey.Refer.OnUpdate), + } +} + +func legacyASTReferenceAction(action tree.ReferenceOptionType) legacyReferenceAction { + if action == tree.REFERENCE_OPTION_INVALID { + return legacyReferenceAction{name: "NO_ACTION", origin: "ACTION_ORIGIN_DEFAULT"} + } + return legacyReferenceAction{ + name: strings.ToUpper(strings.ReplaceAll(action.ToString(), " ", "_")), + origin: "ACTION_ORIGIN_EXPLICIT", + } +} + +func legacyHistoricalActionMatchesCatalog(historical, catalog legacyReferenceAction) bool { + if historical.origin == "ACTION_ORIGIN_DEFAULT" { + // Legacy execution stored an omitted action as RESTRICT. Some partially + // migrated catalogs may already contain the metadata spelling NO_ACTION. + return catalog.name == "RESTRICT" || catalog.name == "NO_ACTION" + } + return historical.name == catalog.name +} + func legacyForeignKeyCatalogConstraints(rows []legacyForeignKeyCatalogRow) []legacyForeignKeyCatalogConstraint { byName := make(map[string][]legacyForeignKeyCatalogRow) for _, row := range rows { @@ -572,7 +735,7 @@ func appendLegacyForeignKeyASTUpdates( definition legacyForeignKeyTableDefinition, constraintName string, foreignKey *tree.ForeignKey, - onDelete, onUpdate string, + actions legacyForeignKeyActions, ) []string { for ordinal, keyPart := range foreignKey.KeyParts { updates = append(updates, legacyForeignKeyUpdateSQL( @@ -580,41 +743,40 @@ func appendLegacyForeignKeyASTUpdates( constraintName, keyPart.ColName.ColName(), ordinal+1, - onDelete, - onUpdate, + actions, )) } return updates } -func legacyForeignKeyCatalogConstraintActions(constraint legacyForeignKeyCatalogConstraint) (string, string, error) { +func legacyForeignKeyCatalogConstraintActions(constraint legacyForeignKeyCatalogConstraint) (legacyForeignKeyActions, error) { if len(constraint.rows) == 0 { - return "", "", moerr.NewInternalErrorNoCtxf("legacy foreign key %s has no catalog rows", constraint.name) + return legacyForeignKeyActions{}, moerr.NewInternalErrorNoCtxf("legacy foreign key %s has no catalog rows", constraint.name) } - onDelete := legacyCatalogReferenceActionName(constraint.rows[0].onDelete) - onUpdate := legacyCatalogReferenceActionName(constraint.rows[0].onUpdate) + onDelete := legacyCatalogReferenceAction(constraint.rows[0].onDelete) + onUpdate := legacyCatalogReferenceAction(constraint.rows[0].onUpdate) for _, row := range constraint.rows[1:] { - if legacyCatalogReferenceActionName(row.onDelete) != onDelete || legacyCatalogReferenceActionName(row.onUpdate) != onUpdate { - return "", "", moerr.NewInternalErrorNoCtxf("legacy foreign key %s has inconsistent catalog actions", constraint.name) + if legacyCatalogReferenceAction(row.onDelete).name != onDelete.name || legacyCatalogReferenceAction(row.onUpdate).name != onUpdate.name { + return legacyForeignKeyActions{}, moerr.NewInternalErrorNoCtxf("legacy foreign key %s has inconsistent catalog actions", constraint.name) } } - return onDelete, onUpdate, nil + return legacyForeignKeyActions{onDelete: onDelete, onUpdate: onUpdate}, nil } func legacyForeignKeyUpdateSQL( definition legacyForeignKeyTableDefinition, constraintName, columnName string, ordinal int, - onDelete, onUpdate string, + actions legacyForeignKeyActions, ) string { return fmt.Sprintf( "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = %d, on_delete = %s, on_update = %s, on_delete_origin = %s, on_update_origin = %s "+ "WHERE constraint_id = 0 AND db_name = %s AND table_name = %s AND constraint_name = %s AND column_name = %s", ordinal, - sqlquote.String(onDelete), - sqlquote.String(onUpdate), - sqlquote.String(legacyCatalogReferenceActionOrigin(onDelete)), - sqlquote.String(legacyCatalogReferenceActionOrigin(onUpdate)), + sqlquote.String(actions.onDelete.name), + sqlquote.String(actions.onUpdate.name), + sqlquote.String(actions.onDelete.origin), + sqlquote.String(actions.onUpdate.origin), sqlquote.String(definition.database), sqlquote.String(definition.table), sqlquote.String(constraintName), @@ -622,25 +784,21 @@ func legacyForeignKeyUpdateSQL( ) } -func legacyCatalogReferenceActionOrigin(action string) string { - if strings.EqualFold(strings.TrimSpace(action), "NO_ACTION") { - return "ACTION_ORIGIN_DEFAULT" - } - return "ACTION_ORIGIN_LEGACY_AMBIGUOUS" -} - -// The catalog is the authoritative action source. SHOW CREATE TABLE is used -// only to reconcile the current constraint declaration and its column order: -// it can render an omitted action and an explicit RESTRICT identically. Keep a -// catalog RESTRICT unchanged, which preserves explicit legacy actions and is -// the conservative policy when an ALTER-added or unnamed constraint cannot be -// distinguished from an omitted action. -func legacyCatalogReferenceActionName(action string) string { +// The catalog is the authoritative fallback for ALTER-added, unnamed, stale, +// or otherwise unreconciled historical definitions. Preserve its action. Only +// RESTRICT and NO_ACTION can be confused with an omitted action, so mark those +// origins as ambiguous; all other actions necessarily came from explicit SQL. +func legacyCatalogReferenceAction(action string) legacyReferenceAction { action = strings.TrimSpace(action) if action == "" { - return "NO_ACTION" + action = "NO_ACTION" + } + action = strings.ToUpper(strings.ReplaceAll(action, " ", "_")) + origin := "ACTION_ORIGIN_EXPLICIT" + if action == "RESTRICT" || action == "NO_ACTION" { + origin = "ACTION_ORIGIN_LEGACY_AMBIGUOUS" } - return action + return legacyReferenceAction{name: action, origin: origin} } func (v *versionHandle) HandleClusterUpgrade(_ context.Context, txn executor.TxnExecutor) error { diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index b36e84e5e2b88..a7882573c58bb 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -70,7 +70,7 @@ func TestForeignKeyMetadataTenantUpgradeEntries(t *testing.T) { require.Contains(t, strings.ToLower(referentialConstraints.PreSql), "drop view if exists information_schema.referential_constraints") } -func TestLegacyForeignKeyMetadataQueryUsesForeignKeyCatalogOnly(t *testing.T) { +func TestLegacyForeignKeyMetadataCatalogQueriesUseForeignKeyCatalogOnly(t *testing.T) { for _, query := range []string{legacyForeignKeyTableDefinitionsSQL, legacyForeignKeyReferencedIndexDefinitionsSQL} { require.NotContains(t, strings.ToLower(query), "rel_createsql") require.NotContains(t, strings.ToLower(query), "mo_tables") @@ -79,16 +79,18 @@ func TestLegacyForeignKeyMetadataQueryUsesForeignKeyCatalogOnly(t *testing.T) { } func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { - updates, err := legacyForeignKeyMetadataUpdates(legacyForeignKeyTableDefinition{ + updates, err := legacyForeignKeyMetadataUpdatesWithHistoricalDefinition(legacyForeignKeyTableDefinition{ database: "db'one", table: "child", foreignKeys: []legacyForeignKeyCatalogRow{ - {constraintName: "fk_default", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a", onDelete: "NO_ACTION", onUpdate: "NO_ACTION"}, - {constraintName: "fk_default", columnName: "b", referDBName: "db'one", referTableName: "parent", referColumnName: "b", onDelete: "NO_ACTION", onUpdate: "NO_ACTION"}, + {constraintName: "fk_default", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + {constraintName: "fk_default", columnName: "b", referDBName: "db'one", referTableName: "parent", referColumnName: "b", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, {constraintName: "fk_restrict", columnName: "a", referDBName: "db'one", referTableName: "parent", referColumnName: "a", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, }, }, "create table child (a int, b int, constraint fk_default foreign key (b, a) references parent (b, a), "+ - "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)") + "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)", + "create table child (a int, b int, constraint fk_default foreign key (b, a) references parent (b, a), "+ + "constraint fk_restrict foreign key (a) references parent (a) on delete restrict on update restrict)") require.NoError(t, err) require.Len(t, updates, 3) @@ -97,7 +99,7 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { "constraint_name = 'fk_default' AND column_name = 'b'", "constraint_id = 2, on_delete = 'NO_ACTION', on_update = 'NO_ACTION', on_delete_origin = 'ACTION_ORIGIN_DEFAULT', on_update_origin = 'ACTION_ORIGIN_DEFAULT'", "constraint_name = 'fk_default' AND column_name = 'a'", - "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT', on_delete_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS', on_update_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'", + "constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT', on_delete_origin = 'ACTION_ORIGIN_EXPLICIT', on_update_origin = 'ACTION_ORIGIN_EXPLICIT'", "constraint_name = 'fk_restrict' AND column_name = 'a'", "db_name = 'db''one'", } { @@ -105,6 +107,44 @@ func TestLegacyForeignKeyMetadataUpdatesPreserveOrderAndActions(t *testing.T) { } } +func TestLegacyForeignKeyMetadataUpdatesIgnoreStaleHistoricalActions(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdatesWithHistoricalDefinition(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{{ + constraintName: "fk_recreated", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "CASCADE", onUpdate: "SET_NULL", + }}, + }, + "create table child (parent_id int, constraint fk_recreated foreign key (parent_id) references parent (id) on delete cascade on update set null)", + "create table child (parent_id int, constraint fk_recreated foreign key (parent_id) references parent (id) on delete restrict on update restrict)", + ) + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'CASCADE', on_update = 'SET_NULL', " + + "on_delete_origin = 'ACTION_ORIGIN_EXPLICIT', on_update_origin = 'ACTION_ORIGIN_EXPLICIT' " + + "WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_recreated' AND column_name = 'parent_id'", + }, updates) +} + +func TestLegacyForeignKeyMetadataUpdatesKeepAlterRestrictAmbiguous(t *testing.T) { + updates, err := legacyForeignKeyMetadataUpdatesWithHistoricalDefinition(legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{{ + constraintName: "fk_added_by_alter", columnName: "parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT", + }}, + }, + "create table child (parent_id int, constraint fk_added_by_alter foreign key (parent_id) references parent (id) on delete restrict on update restrict)", + "create table child (parent_id int)", + ) + require.NoError(t, err) + require.Equal(t, []string{ + "UPDATE mo_catalog.mo_foreign_keys SET constraint_id = 1, on_delete = 'RESTRICT', on_update = 'RESTRICT', " + + "on_delete_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS', on_update_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS' " + + "WHERE constraint_id = 0 AND db_name = 'db' AND table_name = 'child' AND constraint_name = 'fk_added_by_alter' AND column_name = 'parent_id'", + }, updates) +} + func TestLegacyForeignKeyReferencedIndexNameSelectsExactPrimaryKey(t *testing.T) { var queries []string txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { @@ -263,6 +303,50 @@ func TestLegacyForeignKeyMetadataUpgradeReadsAndUpdatesDefinitions(t *testing.T) } } +func TestLegacyForeignKeyMetadataUpgradeUsesHistoricalCreateActions(t *testing.T) { + definition := legacyForeignKeyTableDefinition{ + database: "db", + table: "child", + foreignKeys: []legacyForeignKeyCatalogRow{ + {constraintName: "fk_default", columnName: "default_parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + {constraintName: "fk_restrict", columnName: "restrict_parent_id", referDBName: "db", referTableName: "parent", referColumnName: "id", onDelete: "RESTRICT", onUpdate: "RESTRICT"}, + }, + } + showCreateSQL := "create table child (default_parent_id int, restrict_parent_id int, " + + "constraint fk_default foreign key (default_parent_id) references parent (id) on delete restrict on update restrict, " + + "constraint fk_restrict foreign key (restrict_parent_id) references parent (id) on delete restrict on update restrict)" + historicalCreateSQL := "create table child (default_parent_id int, restrict_parent_id int, " + + "constraint fk_default foreign key (default_parent_id) references parent (id), " + + "constraint fk_restrict foreign key (restrict_parent_id) references parent (id) on delete restrict on update restrict)" + var updates []string + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + switch { + case sql == legacyForeignKeyTableDefinitionsSQL: + return newLegacyForeignKeyDefinitionResultForDefinitions(t, []legacyForeignKeyTableDefinition{definition}), nil + case sql == legacyForeignKeyReferencedIndexDefinitionsSQL: + return executor.Result{}, nil + case sql == "SHOW CREATE TABLE `db`.`child`": + return newShowCreateTableResult(t, "child", showCreateSQL), nil + case strings.HasPrefix(sql, "SELECT rel_createsql FROM mo_catalog.mo_tables"): + return newHistoricalCreateSQLResult(t, historicalCreateSQL), nil + default: + updates = append(updates, sql) + return executor.Result{}, nil + } + }) + + require.NoError(t, upgradeLegacyForeignKeyMetadata(context.Background(), 9, txnExecutor)) + require.Len(t, updates, 2) + require.Contains(t, strings.Join(updates, "\n"), + "constraint_name = 'fk_default' AND column_name = 'default_parent_id'") + require.Contains(t, strings.Join(updates, "\n"), + "on_delete = 'NO_ACTION', on_update = 'NO_ACTION', on_delete_origin = 'ACTION_ORIGIN_DEFAULT', on_update_origin = 'ACTION_ORIGIN_DEFAULT'") + require.Contains(t, strings.Join(updates, "\n"), + "constraint_name = 'fk_restrict' AND column_name = 'restrict_parent_id'") + require.Contains(t, strings.Join(updates, "\n"), + "on_delete = 'RESTRICT', on_update = 'RESTRICT', on_delete_origin = 'ACTION_ORIGIN_EXPLICIT', on_update_origin = 'ACTION_ORIGIN_EXPLICIT'") +} + func TestLegacyForeignKeyMetadataUpgradeBackfillsReferencedIndexForNumberedLegacyForeignKey(t *testing.T) { definition := legacyForeignKeyTableDefinition{ database: "db", @@ -525,6 +609,20 @@ func TestLegacyForeignKeyShowCreateSQLQuotesIdentifiers(t *testing.T) { require.Equal(t, "create table `child``name` (id int)", createSQL) } +func TestLegacyForeignKeyHistoricalCreateSQLQuotesCatalogValues(t *testing.T) { + definition := legacyForeignKeyTableDefinition{database: "db'name", table: `child\name`} + txnExecutor := newVersionTxnExecutor(t, func(sql string) (executor.Result, error) { + require.Equal(t, + "SELECT rel_createsql FROM mo_catalog.mo_tables WHERE account_id = 9 AND reldatabase = 'db''name' AND relname = 'child\\\\name'", + sql, + ) + return newHistoricalCreateSQLResult(t, "create table `child\\name` (id int)"), nil + }) + createSQL, err := getLegacyForeignKeyHistoricalCreateSQL(9, txnExecutor, definition) + require.NoError(t, err) + require.Equal(t, "create table `child\\name` (id int)", createSQL) +} + func newVersionTxnExecutor(t *testing.T, mocker func(string) (executor.Result, error)) executor.TxnExecutor { t.Helper() txnOperator := mock_frontend.NewMockTxnOperator(gomock.NewController(t)) @@ -609,6 +707,18 @@ func newShowCreateTableResult(t *testing.T, tableName, createSQL string) executo return result.GetResult() } +func newHistoricalCreateSQLResult(t *testing.T, createSQL string) executor.Result { + t.Helper() + mp := mpool.MustNewZeroNoFixed() + t.Cleanup(func() { mpool.DeleteMPool(mp) }) + result := executor.NewMemResult([]types.Type{types.T_varchar.ToType()}, mp) + result.NewBatchWithRowCount(1) + if err := executor.AppendStringRows(result, 0, []string{createSQL}); err != nil { + t.Fatalf("append historical CREATE definition: %v", err) + } + return result.GetResult() +} + func newLegacyForeignKeyIndexResult(t *testing.T, rows [][]string) executor.Result { t.Helper() mp := mpool.MustNewZeroNoFixed() @@ -638,8 +748,11 @@ func legacyForeignKeyMigrationUpdatesForAssertion(updates []string) []string { if strings.HasPrefix(update, "SELECT ") { continue } - update = strings.ReplaceAll(update, - ", on_delete_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS', on_update_origin = 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'", "") + if originStart := strings.Index(update, ", on_delete_origin = '"); originStart >= 0 { + if whereStart := strings.Index(update[originStart:], " WHERE constraint_id"); whereStart >= 0 { + update = update[:originStart] + update[originStart+whereStart:] + } + } ret = append(ret, update) } return ret From f4bc72ba2be3992876d10c034c6a8c2db3310d4d Mon Sep 17 00:00:00 2001 From: daviszhen Date: Tue, 4 Aug 2026 13:02:57 +0800 Subject: [PATCH 16/24] update --- .../cases/foreign_key/fk_base.result | 202 +++--- .../cases/foreign_key/foreign_key.result | 620 +++++++++--------- .../cases/foreign_key/update_modern_fk.result | 11 +- 3 files changed, 415 insertions(+), 418 deletions(-) diff --git a/test/distributed/cases/foreign_key/fk_base.result b/test/distributed/cases/foreign_key/fk_base.result index c7c4b0b2b6b88..0b0f057c34087 100644 --- a/test/distributed/cases/foreign_key/fk_base.result +++ b/test/distributed/cases/foreign_key/fk_base.result @@ -8,9 +8,9 @@ create table c1 (a int, b int, foreign key f_a(a) references f2(aa)); internal error: type of reference column 'aa' is not match for column 'a' create table c1 (a int, b int, foreign key f_a(a) references f1(a)); select * from f1; -a b +➤ b[4,32,0] ¦ a[4,32,0] select * from c1; -a b +➤ a[4,32,0] ¦ b[4,32,0] drop table f1; internal error: can not drop table 'f1' referenced by some foreign key constraint truncate f1; @@ -32,18 +32,18 @@ create table c1 (a int, b int, foreign key f_a(a) references f1(a) on delete set insert into c1 values (1,1), (2,2), (3,3); delete from f1 where a > 1; select * from c1; -a b -1 1 -NULL 2 -NULL 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +1 ¦ 1 𝄀 +null ¦ 2 𝄀 +null ¦ 3 drop table c1; insert into f1 values (2,2), (3,3); create table c1 (a int, b int, foreign key f_a(a) references f1(a) on delete cascade); insert into c1 values (1,1), (2,2), (3,3); delete from f1 where a > 1; select * from c1; -a b -1 1 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +1 ¦ 1 drop table c1; drop table f1; create table f1(a int primary key, b int unique key); @@ -56,25 +56,25 @@ update c1 set a = 11 where b = 1; Cannot add or update a child row: a foreign key constraint fails update c1 set a = null where b = 1; select * from c1 order by b; -a b -NULL 1 -2 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +null ¦ 1 𝄀 +2 ¦ 2 𝄀 +3 ¦ 3 update c1 set a = 3 where b = 2; select * from c1 order by b; -a b -NULL 1 -3 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +null ¦ 1 𝄀 +3 ¦ 2 𝄀 +3 ¦ 3 drop table c1; create table c1 (a int, b int, foreign key f_a(a) references f1(a) on update set null); insert into c1 values (1,1), (2,2), (3,3); update f1 set a=11 where a=1; select * from c1 order by b; -a b -NULL 1 -2 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +null ¦ 1 𝄀 +2 ¦ 2 𝄀 +3 ¦ 3 drop table c1; drop table f1; create table f1(a int primary key, b int unique key); @@ -85,10 +85,10 @@ update f1 set a=0 where b>1; Duplicate entry '0' for key 'a' update f1 set a=0 where b=1; select * from c1 order by b; -a b -0 1 -2 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +0 ¦ 1 𝄀 +2 ¦ 2 𝄀 +3 ¦ 3 drop table c1; drop table f1; drop table if exists t_dept; @@ -127,21 +127,21 @@ update t_emp set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp set deptId = null where salary < 1500; select * from t_emp order by salary; -id name deptid salary -7521 WARD null 1250.0 -1234 MEIXI null 1250.0 -7369 SMITH null 1300.0 -7499 ALLEN 30 1600.0 -7698 BLAKE 30 2850.0 -7782 CLARK 10 2950.0 -7566 JONES 20 3475.0 -7788 SCOTT 20 3500.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7521 ¦ WARD ¦ null ¦ 1250.0 𝄀 +1234 ¦ MEIXI ¦ null ¦ 1250.0 𝄀 +7369 ¦ SMITH ¦ null ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7782 ¦ CLARK ¦ 10 ¦ 2950.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 select * from t_dept; -id name location -10 ACCOUNTING NEW YORK -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +10 ¦ ACCOUNTING ¦ NEW YORK 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON drop table t_emp; drop table t_dept; drop table if exists t_dept1; @@ -174,36 +174,36 @@ INSERT INTO t_emp1 VALUES (7782,'CLARK',10,2950.00); INSERT INTO t_emp1 VALUES (7788,'SCOTT',20,3500.00); update t_dept1 set id = 50 where name = 'ACCOUNTING'; select * from t_dept1; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON -50 ACCOUNTING NEW YORK +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON 𝄀 +50 ¦ ACCOUNTING ¦ NEW YORK select * from t_emp1; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 -7782 CLARK 50 2950.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 +7782 ¦ CLARK ¦ 50 ¦ 2950.0 delete from t_dept1 where name = 'ACCOUNTING'; select * from t_dept1; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON select * from t_emp1; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 update t_emp1 set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp1 set deptId = null where salary < 1500; @@ -239,37 +239,37 @@ INSERT INTO t_emp2 VALUES (7782,'CLARK',10,2950.00); INSERT INTO t_emp2 VALUES (7788,'SCOTT',20,3500.00); update t_dept2 set id = 50 where name = 'ACCOUNTING'; select * from t_dept2; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON -50 ACCOUNTING NEW YORK +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON 𝄀 +50 ¦ ACCOUNTING ¦ NEW YORK select * from t_emp2; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 -7782 CLARK null 2950.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 +7782 ¦ CLARK ¦ null ¦ 2950.0 delete from t_dept2 where name = 'ACCOUNTING'; select * from t_dept2; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON select * from t_emp2; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 -7782 CLARK null 2950.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 +7782 ¦ CLARK ¦ null ¦ 2950.0 update t_emp2 set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp2 set deptId = null where salary < 1500; @@ -287,10 +287,10 @@ update c1 set aaa=4, bbb=22 where bbb=11; Cannot add or update a child row: a foreign key constraint fails update c1 set aaa=2, bbb=33 where bbb=11; select * from c1 order by bbb; -aaa bbbb -2 22 -3 33 -2 33 +➤ aaa[4,32,0] ¦ bbb[4,32,0] 𝄀 +2 ¦ 22 𝄀 +3 ¦ 33 𝄀 +2 ¦ 33 drop table c1; drop table f2; drop table f1; @@ -316,21 +316,27 @@ drop table f1; create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b)); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1,col2) REFERENCES fk_01(a,b) on delete RESTRICT on update RESTRICT); create table fk_03(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1) REFERENCES fk_01(a) on delete RESTRICT on update RESTRICT); +internal error: failed to add the foreign key constraint create table fk_04(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(b) on delete RESTRICT on update RESTRICT); +internal error: failed to add the foreign key constraint drop table fk_04; +no such table fk_base.fk_04 drop table fk_03; +no such table fk_base.fk_03 drop table fk_02; drop table fk_01; create table f1(a int, b int, primary key (a,b)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`) REFERENCES `f1`(`a`)); +internal error: failed to add the foreign key constraint insert into f1 values (1,1); insert into c1 values (1,1,1); +no such table fk_base.c1 update f1 set a=a; update f1 set a=1; update f1 set a=a, b=2; update f1 set a=2; -Cannot delete or update a parent row: a foreign key constraint fails drop table c1; +no such table fk_base.c1 drop table f1; create table f1(a int, b int, primary key (a,b)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`,`bb`) REFERENCES `f1`(`a`,`b`)); @@ -354,7 +360,7 @@ drop database db1; create database db1; use db1; show tables; -Tables_in_db1 +➤ Tables_in_db1[12,-1,0] drop database db1; create account acc1 ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database db2; @@ -367,7 +373,7 @@ drop database db2; create database db2; use db2; show tables; -Tables_in_db2 +➤ Tables_in_db2[12,-1,0] drop database db2; drop account if exists acc1; drop database if exists db1; diff --git a/test/distributed/cases/foreign_key/foreign_key.result b/test/distributed/cases/foreign_key/foreign_key.result index 8de680e2665fd..edcc0dd476521 100644 --- a/test/distributed/cases/foreign_key/foreign_key.result +++ b/test/distributed/cases/foreign_key/foreign_key.result @@ -1,21 +1,26 @@ create table fk_01(col1 varchar(30) not null primary key,col2 int); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(col1)); show create table fk_02; -Table Create Table -fk_02 CREATE TABLE `fk_02` (\n `col1` int DEFAULT NULL,\n `col2` varchar(25) DEFAULT NULL,\n `col3` tinyint DEFAULT NULL,\n CONSTRAINT `ck` FOREIGN KEY (`col2`) REFERENCES `fk_01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +fk_02 ¦ CREATE TABLE `fk_02` ( + `col1` int DEFAULT NULL, + `col2` varchar(25) DEFAULT NULL, + `col3` tinyint DEFAULT NULL, + CONSTRAINT `ck` FOREIGN KEY (`col2`) REFERENCES `fk_01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_01 values ('90',5983),('100',734),('190',50); insert into fk_02(col2,col3) values ('90',5),('90',4),('100',0),(NULL,80); select * from fk_01; -col1 col2 -90 5983 -100 734 -190 50 +➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 734 𝄀 +190 ¦ 50 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null 100 0 -null null 80 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ 100 ¦ 0 𝄀 +null ¦ null ¦ 80 insert into fk_02(col2,col3) values ('200',5); internal error: Cannot add or update a child row: a foreign key constraint fails update fk_02 set col2='80' where col2='90'; @@ -26,26 +31,26 @@ delete from fk_01 where col1='90'; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_01 where col1='190'; select * from fk_01; -col1 col2 -90 5983 -100 734 +➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 734 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null 100 0 -null null 80 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ 100 ¦ 0 𝄀 +null ¦ null ¦ 80 update fk_01 set col2=500 where col2=734; delete from fk_02 where col2='100'; select * from fk_01; -col1 col2 -90 5983 -100 500 +➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 500 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null null 80 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ null ¦ 80 drop table fk_02; drop table fk_01; create table fk_01(col1 char(30) primary key,col2 int); @@ -57,15 +62,15 @@ insert into fk_02(col2,col3) values ('90',5),('90',4),('100',0); truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint select * from fk_01; -col1 col2 -90 5983 -100 734 -190 50 +➤ col1[1,30,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 734 𝄀 +190 ¦ 50 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null 100 0 +➤ col1[4,32,0] ¦ col2[1,25,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ 100 ¦ 0 drop table fk_02; drop table fk_01; create table fk_01(col1 int auto_increment primary key,col2 varchar(25),col3 tinyint); @@ -78,38 +83,38 @@ insert into fk_01 values (2,'yellow',20),(10,'apple',50),(11,'opppo',51); insert into fk_02 values(2,'score',1),(2,'student',4),(10,'goods',2); insert into fk_02 values(NULL,NULL,NULL); select * from fk_01; -col1 col2 col3 -2 yellow 20 -10 apple 50 -11 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +10 ¦ apple ¦ 50 𝄀 +11 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 -2 score 1 -2 student 4 -10 goods 2 -null null null +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ score ¦ 1 𝄀 +2 ¦ student ¦ 4 𝄀 +10 ¦ goods ¦ 2 𝄀 +null ¦ null ¦ null update fk_02 set col1=10 where col3=4; select * from fk_02; -col1 col2 col3 -2 score 1 -10 goods 2 -null null null -10 student 4 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ score ¦ 1 𝄀 +10 ¦ goods ¦ 2 𝄀 +null ¦ null ¦ null 𝄀 +10 ¦ student ¦ 4 update fk_02 set col1=20 where col3=4; Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(15,'ssss',10); internal error: Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=11; select * from fk_01; -col1 col2 col3 -2 yellow 20 -10 apple 50 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +10 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -2 score 1 -10 goods 2 -null null null -10 student 4 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ score ¦ 1 𝄀 +10 ¦ goods ¦ 2 𝄀 +null ¦ null ¦ null 𝄀 +10 ¦ student ¦ 4 update fk_01 set col3=110 where col1=10; delete from fk_01 where col1=2; internal error: Cannot delete or update a parent row: a foreign key constraint fails @@ -117,7 +122,7 @@ truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint truncate table fk_02; select * from fk_02; -col1 col2 col3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -129,15 +134,15 @@ insert into fk_02 values(2,'apple',1),(2,'apple',4),(1,'opppo',2); insert into fk_02 values(20,'score',1),(12,'apple',4),(1,'yellow',2); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 yellow 20 -2 apple 50 -1 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 𝄀 +1 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 -2 apple 1 -2 apple 4 -1 opppo 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ apple ¦ 1 𝄀 +2 ¦ apple ¦ 4 𝄀 +1 ¦ opppo ¦ 2 update fk_02 set col1=3 where col1=2; Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=2 and col2='apple'; @@ -147,25 +152,25 @@ Cannot delete or update a parent row: a foreign key constraint fails update fk_01 set col1=1 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 yellow 20 -2 apple 50 -1 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 𝄀 +1 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 -2 apple 1 -2 apple 4 -1 opppo 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ apple ¦ 1 𝄀 +2 ¦ apple ¦ 4 𝄀 +1 ¦ opppo ¦ 2 delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_02; select * from fk_01; -col1 col2 col3 -2 yellow 20 -2 apple 50 -1 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 𝄀 +1 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] drop table fk_02; drop table fk_01; create table fk_01(col1 bigint primary key,col2 varchar(25),col3 tinyint); @@ -177,35 +182,35 @@ insert into fk_02 values(4,'age',3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(1,'score',1),(2,'student',NULL); select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -1 score 1 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ score ¦ 1 𝄀 +2 ¦ student ¦ null update fk_02 set col3=4 where col3=1; select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 delete from fk_01 where col1=1; select * from fk_02; -col1 col2 col3 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ student ¦ null update fk_01 set col1=5 where col2='apple'; select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -5 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ student ¦ null delete from fk_02 where col1=5; select * from fk_02; -col1 col2 col3 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 drop table fk_02; drop table fk_01; create table fk_01(col1 decimal(38,18),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); @@ -217,35 +222,35 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 col4 -23.100000000000000000 a 20 2022-10-01 -23.100000000000000000 a 21 2022-10-01 -23.100000000000000000 a 20 2022-10-02 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100000000000000000 a 20 2022-10-01 -23.100000000000000000 a 21 2022-10-01 -23.100000000000000000 a 20 2022-10-02 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-02 update fk_02 set col3=19 where col3=20; Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col3=20; select * from fk_01; -col1 col2 col3 col4 -23.100000000000000000 a 21 2022-10-01 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 select * from fk_02; -col1 col2 col3 col4 -23.100000000000000000 a 21 2022-10-01 -null a null null -null a null null +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +null ¦ a ¦ null ¦ null 𝄀 +null ¦ a ¦ null ¦ null update fk_01 set col3=19 where col2='a'; select * from fk_01; -col1 col2 col3 col4 -23.100000000000000000 a 19 2022-10-01 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 19 ¦ 2022-10-01 select * from fk_02; -col1 col2 col3 col4 -null a null null -null a null null -null a null null +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +null ¦ a ¦ null ¦ null 𝄀 +null ¦ a ¦ null ¦ null 𝄀 +null ¦ a ¦ null ¦ null drop table fk_02; drop table fk_01; create table fk_01(col1 int primary key auto_increment,col2 varchar(25),col3 varchar(50)); @@ -259,39 +264,39 @@ Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -2 cc dd 1 -3 ee ff 1 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +2 ¦ cc ¦ dd ¦ 1 𝄀 +3 ¦ ee ¦ ff ¦ 1 delete from fk_02 where col4=1; delete from fk_01 where col1=1; select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 update fk_01 set col1=8 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -302,71 +307,71 @@ insert into fk_01(col2,col3) values ('non-failing','deli'),('safer','prow'),('ul insert into fk_02(col2,col3,col4) values('aa','bb',2),('cc','dd',1),('ee','ff',1); insert into fk_02(col2,col3,col4) values('aa','bb',3); select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong -4 aaa bbb -select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -2 cc dd 1 -3 ee ff 1 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb +select * from fk_02; +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +2 ¦ cc ¦ dd ¦ 1 𝄀 +3 ¦ ee ¦ ff ¦ 1 𝄀 +4 ¦ aa ¦ bb ¦ 3 delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_02 where col4=1; select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong -4 aaa bbb +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb update fk_01 set col1=8 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails update fk_02 set col4=5 where col3='ff'; select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong -4 aaa bbb +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 update fk_01 set col2='window' where col1=1; delete from fk_01 where col1=3; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong -4 aaa bbb -1 window deli +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb 𝄀 +1 ¦ window ¦ deli select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint insert into fk_01(col2,col3) values ('zhi','gao'),('er','li'); select * from fk_01 order by col1; -col1 col2 col3 -1 window deli -2 safer prow -3 ultra strong -4 aaa bbb -9 zhi gao -10 er li -select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ window ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb 𝄀 +9 ¦ zhi ¦ gao 𝄀 +10 ¦ er ¦ li +select * from fk_02; +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -380,35 +385,35 @@ insert into fk_02 values(4,'age',3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(1,'score',1),(2,'student',NULL); select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -1 score 1 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ score ¦ 1 𝄀 +2 ¦ student ¦ null update fk_02 set col3=4 where col3=1; select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 delete from fk_01 where col1=1; select * from fk_02; -col1 col2 col3 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ student ¦ null update fk_01 set col1=5 where col2='apple'; select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -5 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ student ¦ null delete from fk_02 where col1=5; select * from fk_02; -col1 col2 col3 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 drop table fk_02; drop table fk_01; create table fk_01(id int primary key auto_increment,title varchar(25)); @@ -423,34 +428,34 @@ update fk_03 set book_id=6 where book_id=2; Cannot add or update a child row: a foreign key constraint fails update fk_03 set book_id=3 where book_id=2; select * from fk_03; -id book_id author_id -1 1 2 -3 3 1 -2 3 2 +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 +1 ¦ 1 ¦ 2 𝄀 +3 ¦ 3 ¦ 1 𝄀 +2 ¦ 3 ¦ 2 update fk_01 set id=5 where title='self'; select * from fk_03; -id book_id author_id -3 3 1 -2 3 2 -1 5 2 -select * from fk_01; -id title -2 method -3 console -5 self +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 +3 ¦ 3 ¦ 1 𝄀 +2 ¦ 3 ¦ 2 𝄀 +1 ¦ 5 ¦ 2 +select * from fk_01; +➤ id[4,32,0] ¦ title[12,-1,0] 𝄀 +2 ¦ method 𝄀 +3 ¦ console 𝄀 +5 ¦ self delete from fk_02 where id=1; select * from fk_02; -id name -2 wulan +➤ id[4,32,0] ¦ name[12,-1,0] 𝄀 +2 ¦ wulan select * from fk_03; -id book_id author_id -2 3 2 -1 5 2 +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 +2 ¦ 3 ¦ 2 𝄀 +1 ¦ 5 ¦ 2 delete from fk_03; drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint select * from fk_03; -id book_id author_id +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] drop table fk_02; internal error: can not drop table 'fk_02' referenced by some foreign key constraint drop table fk_03; @@ -465,14 +470,14 @@ internal error: Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col3='2001-10-09 01:00:09'; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -9 2001-10-19 00:00:00 2001-10-09 01:00:09 -10 2011-12-09 00:00:00 2001-10-09 01:00:09 -11 2011-12-09 00:00:00 2001-10-09 01:00:09 +➤ col1[4,32,0] ¦ col2[93,64,0] ¦ col3[93,64,0] 𝄀 +9 ¦ 2001-10-19 00:00:00 ¦ 2001-10-09 01:00:09 𝄀 +10 ¦ 2011-12-09 00:00:00 ¦ 2001-10-09 01:00:09 𝄀 +11 ¦ 2011-12-09 00:00:00 ¦ 2001-10-09 01:00:09 select * from fk_02; -col1 col2 col3 col4 -9 2001-10-19 00:00:00 left 2001-10-09 01:00:09 -11 2011-12-09 00:00:00 right 2001-10-09 01:00:09 +➤ col1[4,32,0] ¦ col2[93,64,0] ¦ col3[1,25,0] ¦ col4[93,64,0] 𝄀 +9 ¦ 2001-10-19 00:00:00 ¦ left ¦ 2001-10-09 01:00:09 𝄀 +11 ¦ 2011-12-09 00:00:00 ¦ right ¦ 2001-10-09 01:00:09 drop table fk_02; drop table fk_01; create table fk_an_01(col1 int,col2 varchar(25),col3 tinyint,primary key(col2)); @@ -487,24 +492,30 @@ create table f1 (fa int primary key); CREATE TABLE c1 (ca INT, cb INT); ALTER TABLE c1 ADD CONSTRAINT ffa FOREIGN KEY (ca) REFERENCES f1(fa); desc c1; -Field Type Null Key Default Extra Comment -ca INT(32) YES MUL null -cb INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +ca ¦ INT(32) ¦ YES ¦ MUL ¦ null ¦ ¦ 𝄀 +cb ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ drop table if exists c1; drop table if exists f1; create table f1 (a int, b int, c int, d int, e int, primary key(a,b), unique key(c,d)); insert into f1 values (1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(2,1,2,1,1),(3,1,3,1,1),(4,1,4,1,1),(1,2,1,2,1); create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a)); +internal error: failed to add the foreign key constraint insert into c1 values (1,1,1,1,1); +no such table foreign_key.c1 insert into c1 values (2,5,1,1,1); -internal error: Cannot add or update a child row: a foreign key constraint fails +no such table foreign_key.c1 drop table c1; +no such table foreign_key.c1 create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); +internal error: failed to add the foreign key constraint insert into c1 values (1,1,1,1,1); +no such table foreign_key.c1 delete from f1 where a=1 and b=2; select * from c1; -a f_a f_b f_c f_d +SQL parser error: table "c1" does not exist drop table c1; +no such table foreign_key.c1 create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); drop table c1; create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_c) REFERENCES f1(a,c)); @@ -512,101 +523,91 @@ internal error: failed to add the foreign key constraint create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_c,f_d) REFERENCES f1(c,d)); create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); +internal error: failed to add the foreign key constraint insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); +no such table foreign_key.fk_02 insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); -internal error: Cannot add or update a child row: a foreign key constraint fails +no such table foreign_key.fk_02 insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); -internal error: Cannot add or update a child row: a foreign key constraint fails +no such table foreign_key.fk_02 select * from fk_01; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +SQL parser error: table "fk_02" does not exist update fk_02 set col3=19 where col3=20; +no such table foreign_key.fk_02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 -23.100 a 19 2022-10-01 -23.100 a 19 2022-10-02 +SQL parser error: table "fk_02" does not exist delete from fk_01 where col3=20; select * from fk_01; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 select * from fk_02; -col1 col2 col3 col4 -null a 21 2022-10-01 -null a 19 2022-10-01 -null a 19 2022-10-02 +SQL parser error: table "fk_02" does not exist drop table if exists c1; drop table if exists f1; create table f1(a int, b int, c int, primary key(a,b)); insert into f1 values (2,1,1), (2,2,2),(2,3,3); create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); +internal error: failed to add the foreign key constraint insert into c1 values (1,2,1),(2,2,2),(3,2,3); +no such table foreign_key.c1 update f1 set a=111 where b=1; select * from f1; -a b c -2 2 2 -2 3 3 -111 1 1 +➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 +2 ¦ 2 ¦ 2 𝄀 +2 ¦ 3 ¦ 3 𝄀 +111 ¦ 1 ¦ 1 select * from c1; -a c_a c_b -1 111 1 -2 111 2 -3 111 3 +SQL parser error: table "c1" does not exist delete from c1; +no such table foreign_key.c1 insert into c1 values (1,2,1),(2,2,2),(3,2,3); +no such table foreign_key.c1 delete from f1 where b=2; select * from f1; -a b c -2 3 3 -111 1 1 +➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 +2 ¦ 3 ¦ 3 𝄀 +111 ¦ 1 ¦ 1 select * from c1; -a c_a c_b +SQL parser error: table "c1" does not exist drop table if exists fk_02; drop table if exists fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); +internal error: failed to add the foreign key constraint insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); +no such table foreign_key.fk_02 insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); -internal error: Cannot add or update a child row: a foreign key constraint fails +no such table foreign_key.fk_02 insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); -internal error: Cannot add or update a child row: a foreign key constraint fails +no such table foreign_key.fk_02 select * from fk_01; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +SQL parser error: table "fk_02" does not exist update fk_02 set col3=19 where col3=20; +no such table foreign_key.fk_02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 -23.100 a 19 2022-10-01 -23.100 a 19 2022-10-02 +SQL parser error: table "fk_02" does not exist delete from fk_01 where col3=19; select * from fk_01; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 -23.100 a 19 2022-10-01 -23.100 a 19 2022-10-02 +SQL parser error: table "fk_02" does not exist drop table fk_02; +no such table foreign_key.fk_02 drop table fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key(col3)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3) REFERENCES fk_01(col1,col3) on delete CASCADE on update CASCADE); @@ -614,44 +615,33 @@ internal error: failed to add the foreign key constraint drop table fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete CASCADE on update CASCADE); +internal error: failed to add the foreign key constraint insert into fk_01 values(8.9,'a',20,'2022-10-01'),(6.0,'a',21,'2022-10-01'),(4.3,'c',20,'2022-10-02'); insert into fk_02 values(8.9,'a',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'),(6.0,'a',20,'2022-10-02'); +no such table foreign_key.fk_02 insert into fk_02 values(8.9,'c',20,'2022-10-01'),(null,'a',21,'2022-10-01'); +no such table foreign_key.fk_02 insert into fk_02 values(3.5,'e',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'); -internal error: Cannot add or update a child row: a foreign key constraint fails +no such table foreign_key.fk_02 select * from fk_01; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -6.000 a 21 2022-10-01 -4.300 c 20 2022-10-02 -select * from fk_02; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -8.900 a 21 2022-10-01 -6.000 a 20 2022-10-02 -8.900 c 20 2022-10-01 -null a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +4.300 ¦ c ¦ 20 ¦ 2022-10-02 +select * from fk_02; +SQL parser error: table "fk_02" does not exist update fk_02 set col1=6.0 where col3=21; +no such table foreign_key.fk_02 select * from fk_02; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -6.000 a 20 2022-10-02 -8.900 c 20 2022-10-01 -6.000 a 21 2022-10-01 -6.000 a 21 2022-10-01 +SQL parser error: table "fk_02" does not exist update fk_01 set col2='d' where col1=6.0; select * from fk_01; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -4.300 c 20 2022-10-02 -6.000 d 21 2022-10-01 -select * from fk_02; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -6.000 a 20 2022-10-02 -8.900 c 20 2022-10-01 -6.000 a 21 2022-10-01 -6.000 a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +4.300 ¦ c ¦ 20 ¦ 2022-10-02 𝄀 +6.000 ¦ d ¦ 21 ¦ 2022-10-01 +select * from fk_02; +SQL parser error: table "fk_02" does not exist set autocommit=0; create table t1(a int primary key); insert into t1 values (1); diff --git a/test/distributed/cases/foreign_key/update_modern_fk.result b/test/distributed/cases/foreign_key/update_modern_fk.result index 410bf2f27a654..2356c1477c8bf 100644 --- a/test/distributed/cases/foreign_key/update_modern_fk.result +++ b/test/distributed/cases/foreign_key/update_modern_fk.result @@ -333,18 +333,19 @@ parent_a int, constraint fk_nonunique_prefix foreign key (parent_a) references parent_nonunique_prefix(a) on update cascade ); +internal error: failed to add the foreign key constraint insert into parent_nonunique_prefix values (1, 1), (1, 2); insert into child_nonunique_prefix values (10, 1); +no such table update_modern_fk.child_nonunique_prefix update parent_nonunique_prefix set a = b + 1 where a = 1; -not supported: parent foreign key action has an ambiguous non-unique referenced-key mapping select * from parent_nonunique_prefix order by a, b; ➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -1 ¦ 1 𝄀 -1 ¦ 2 +2 ¦ 1 𝄀 +3 ¦ 2 select * from child_nonunique_prefix order by id; -➤ id[4,32,0] ¦ parent_a[4,32,0] 𝄀 -10 ¦ 1 +SQL parser error: table "child_nonunique_prefix" does not exist drop table child_nonunique_prefix; +no such table update_modern_fk.child_nonunique_prefix drop table parent_nonunique_prefix; drop table child_generated_unique; drop table parent_generated_unique; From a27dce0a92be8026e2c4ec2fb874e697d2f85979 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Tue, 4 Aug 2026 14:55:08 +0800 Subject: [PATCH 17/24] update --- .../cases/foreign_key/fk_base.result | 37 ++++-- .../distributed/cases/foreign_key/fk_base.sql | 28 ++++- .../cases/foreign_key/foreign_key.result | 119 ++++++++++-------- .../cases/foreign_key/foreign_key.sql | 23 ++-- .../cases/foreign_key/update_modern_fk.result | 13 +- .../cases/foreign_key/update_modern_fk.sql | 7 +- 6 files changed, 143 insertions(+), 84 deletions(-) diff --git a/test/distributed/cases/foreign_key/fk_base.result b/test/distributed/cases/foreign_key/fk_base.result index 0b0f057c34087..8c38e8f4a8101 100644 --- a/test/distributed/cases/foreign_key/fk_base.result +++ b/test/distributed/cases/foreign_key/fk_base.result @@ -313,30 +313,24 @@ insert into c1 values(2,2,1,1); Duplicate entry '2' for key 'b' drop table c1; drop table f1; -create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b)); +create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b), unique key(a), unique key(b)); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1,col2) REFERENCES fk_01(a,b) on delete RESTRICT on update RESTRICT); create table fk_03(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1) REFERENCES fk_01(a) on delete RESTRICT on update RESTRICT); -internal error: failed to add the foreign key constraint create table fk_04(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(b) on delete RESTRICT on update RESTRICT); -internal error: failed to add the foreign key constraint drop table fk_04; -no such table fk_base.fk_04 drop table fk_03; -no such table fk_base.fk_03 drop table fk_02; drop table fk_01; -create table f1(a int, b int, primary key (a,b)); +create table f1(a int, b int, primary key (a,b), unique key(a)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`) REFERENCES `f1`(`a`)); -internal error: failed to add the foreign key constraint insert into f1 values (1,1); insert into c1 values (1,1,1); -no such table fk_base.c1 update f1 set a=a; update f1 set a=1; update f1 set a=a, b=2; update f1 set a=2; +Cannot delete or update a parent row: a foreign key constraint fails drop table c1; -no such table fk_base.c1 drop table f1; create table f1(a int, b int, primary key (a,b)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`,`bb`) REFERENCES `f1`(`a`,`b`)); @@ -349,6 +343,31 @@ update f1 set a=a, b=2; Cannot delete or update a parent row: a foreign key constraint fails drop table c1; drop table f1; +create table fk_exact_key_parent ( +a int, +b int, +c int, +primary key (a, b), +unique key uk_b_c (b, c) +); +create table fk_invalid_pk_prefix (a int, constraint fk_invalid_pk_prefix foreign key (a) references fk_exact_key_parent(a)); +-- @regex("failed to add the foreign key constraint", true) +internal error: failed to add the foreign key constraint +create table fk_invalid_unique_prefix (b int, constraint fk_invalid_unique_prefix foreign key (b) references fk_exact_key_parent(b)); +-- @regex("failed to add the foreign key constraint", true) +internal error: failed to add the foreign key constraint +create table fk_invalid_key_order (a int, b int, constraint fk_invalid_key_order foreign key (a,b) references fk_exact_key_parent(b,a)); +-- @regex("failed to add the foreign key constraint", true) +internal error: failed to add the foreign key constraint +create table fk_invalid_mixed_key (a int, c int, constraint fk_invalid_mixed_key foreign key (a,c) references fk_exact_key_parent(a,c)); +-- @regex("failed to add the foreign key constraint", true) +internal error: failed to add the foreign key constraint +create table fk_invalid_alter_child (a int, b int); +alter table fk_invalid_alter_child add constraint fk_invalid_alter_prefix foreign key (a) references fk_exact_key_parent(a); +-- @regex("failed to add the foreign key constraint", true) +internal error: failed to add the foreign key constraint +drop table fk_invalid_alter_child; +drop table fk_exact_key_parent; drop database if exists db1; create database db1; use db1; diff --git a/test/distributed/cases/foreign_key/fk_base.sql b/test/distributed/cases/foreign_key/fk_base.sql index 9869a88659ef0..8f30049e521a6 100644 --- a/test/distributed/cases/foreign_key/fk_base.sql +++ b/test/distributed/cases/foreign_key/fk_base.sql @@ -230,7 +230,7 @@ insert into c1 values(2,2,1,1); drop table c1; drop table f1; -create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b)); +create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b), unique key(a), unique key(b)); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1,col2) REFERENCES fk_01(a,b) on delete RESTRICT on update RESTRICT); create table fk_03(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1) REFERENCES fk_01(a) on delete RESTRICT on update RESTRICT); create table fk_04(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(b) on delete RESTRICT on update RESTRICT); @@ -239,7 +239,7 @@ drop table fk_03; drop table fk_02; drop table fk_01; -create table f1(a int, b int, primary key (a,b)); +create table f1(a int, b int, primary key (a,b), unique key(a)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`) REFERENCES `f1`(`a`)); insert into f1 values (1,1); insert into c1 values (1,1,1); @@ -261,6 +261,28 @@ update f1 set a=a, b=2; drop table c1; drop table f1; +-- The referenced columns must match one complete PRIMARY or UNIQUE key, in order. +create table fk_exact_key_parent ( + a int, + b int, + c int, + primary key (a, b), + unique key uk_b_c (b, c) +); +-- @regex("failed to add the foreign key constraint",true) +create table fk_invalid_pk_prefix (a int, constraint fk_invalid_pk_prefix foreign key (a) references fk_exact_key_parent(a)); +-- @regex("failed to add the foreign key constraint",true) +create table fk_invalid_unique_prefix (b int, constraint fk_invalid_unique_prefix foreign key (b) references fk_exact_key_parent(b)); +-- @regex("failed to add the foreign key constraint",true) +create table fk_invalid_key_order (a int, b int, constraint fk_invalid_key_order foreign key (a,b) references fk_exact_key_parent(b,a)); +-- @regex("failed to add the foreign key constraint",true) +create table fk_invalid_mixed_key (a int, c int, constraint fk_invalid_mixed_key foreign key (a,c) references fk_exact_key_parent(a,c)); +create table fk_invalid_alter_child (a int, b int); +-- @regex("failed to add the foreign key constraint",true) +alter table fk_invalid_alter_child add constraint fk_invalid_alter_prefix foreign key (a) references fk_exact_key_parent(a); +drop table fk_invalid_alter_child; +drop table fk_exact_key_parent; + drop database if exists db1; create database db1; use db1; @@ -299,4 +321,4 @@ create table t2(a int primary key, b int); alter table t2 add constraint fk_t2_t1 foreign key(b) references t1(a), add constraint fk_t2_t1 foreign key(b) references t1(a); alter table t2 add constraint fk_t2_t1 foreign key(b) references t1(a); alter table t2 add constraint fk_t2_t1 foreign key(b) references t1(a); -drop database db1; \ No newline at end of file +drop database db1; diff --git a/test/distributed/cases/foreign_key/foreign_key.result b/test/distributed/cases/foreign_key/foreign_key.result index edcc0dd476521..c9f468a156eec 100644 --- a/test/distributed/cases/foreign_key/foreign_key.result +++ b/test/distributed/cases/foreign_key/foreign_key.result @@ -499,63 +499,61 @@ drop table if exists c1; drop table if exists f1; create table f1 (a int, b int, c int, d int, e int, primary key(a,b), unique key(c,d)); insert into f1 values (1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(2,1,2,1,1),(3,1,3,1,1),(4,1,4,1,1),(1,2,1,2,1); -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a)); -internal error: failed to add the foreign key constraint +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); insert into c1 values (1,1,1,1,1); -no such table foreign_key.c1 insert into c1 values (2,5,1,1,1); -no such table foreign_key.c1 +internal error: Cannot add or update a child row: a foreign key constraint fails drop table c1; -no such table foreign_key.c1 -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); -internal error: failed to add the foreign key constraint -insert into c1 values (1,1,1,1,1); -no such table foreign_key.c1 +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); +insert into c1 values (1,1,2,1,1); delete from f1 where a=1 and b=2; select * from c1; -SQL parser error: table "c1" does not exist +➤ a[4,32,0] ¦ f_a[4,32,0] ¦ f_b[4,32,0] ¦ f_c[4,32,0] ¦ f_d[4,32,0] drop table c1; -no such table foreign_key.c1 create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); drop table c1; create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_c) REFERENCES f1(a,c)); internal error: failed to add the foreign key constraint create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_c,f_d) REFERENCES f1(c,d)); create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); -internal error: failed to add the foreign key constraint +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); -no such table foreign_key.fk_02 insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); -no such table foreign_key.fk_02 +internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); -no such table foreign_key.fk_02 +internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; ➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -SQL parser error: table "fk_02" does not exist -update fk_02 set col3=19 where col3=20; -no such table foreign_key.fk_02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 +update fk_02 set col2='b' where col3=20; select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ b ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ b ¦ 20 ¦ 2022-10-02 delete from fk_01 where col3=20; select * from fk_01; ➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 23.100 ¦ a ¦ 21 ¦ 2022-10-01 select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +null ¦ b ¦ null ¦ null 𝄀 +null ¦ b ¦ null ¦ null drop table if exists c1; drop table if exists f1; create table f1(a int, b int, c int, primary key(a,b)); insert into f1 values (2,1,1), (2,2,2),(2,3,3); -create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); -internal error: failed to add the foreign key constraint +create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a,c_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); insert into c1 values (1,2,1),(2,2,2),(3,2,3); -no such table foreign_key.c1 update f1 set a=111 where b=1; select * from f1; ➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 @@ -563,41 +561,47 @@ select * from f1; 2 ¦ 3 ¦ 3 𝄀 111 ¦ 1 ¦ 1 select * from c1; -SQL parser error: table "c1" does not exist +➤ a[4,32,0] ¦ c_a[4,32,0] ¦ c_b[4,32,0] 𝄀 +2 ¦ 2 ¦ 2 𝄀 +3 ¦ 2 ¦ 3 𝄀 +1 ¦ 111 ¦ 1 delete from c1; -no such table foreign_key.c1 -insert into c1 values (1,2,1),(2,2,2),(3,2,3); -no such table foreign_key.c1 +insert into c1 values (1,111,1),(2,2,2),(3,2,3); delete from f1 where b=2; select * from f1; ➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 2 ¦ 3 ¦ 3 𝄀 111 ¦ 1 ¦ 1 select * from c1; -SQL parser error: table "c1" does not exist +➤ a[4,32,0] ¦ c_a[4,32,0] ¦ c_b[4,32,0] 𝄀 +1 ¦ 111 ¦ 1 𝄀 +3 ¦ 2 ¦ 3 drop table if exists fk_02; drop table if exists fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); -internal error: failed to add the foreign key constraint +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); -no such table foreign_key.fk_02 insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); -no such table foreign_key.fk_02 +internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); -no such table foreign_key.fk_02 +internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; ➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -SQL parser error: table "fk_02" does not exist -update fk_02 set col3=19 where col3=20; -no such table foreign_key.fk_02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 +update fk_02 set col2='b' where col3=20; select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ b ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ b ¦ 20 ¦ 2022-10-02 delete from fk_01 where col3=19; select * from fk_01; ➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 @@ -605,35 +609,43 @@ select * from fk_01; 23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ b ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ b ¦ 20 ¦ 2022-10-02 drop table fk_02; -no such table foreign_key.fk_02 drop table fk_01; -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key(col3)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key uk_col3(col3), unique key uk_col1_col3(col1,col3)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3) REFERENCES fk_01(col1,col3) on delete CASCADE on update CASCADE); -internal error: failed to add the foreign key constraint +drop table fk_02; drop table fk_01; -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2), unique key uk_col1(col1)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete CASCADE on update CASCADE); -internal error: failed to add the foreign key constraint insert into fk_01 values(8.9,'a',20,'2022-10-01'),(6.0,'a',21,'2022-10-01'),(4.3,'c',20,'2022-10-02'); insert into fk_02 values(8.9,'a',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'),(6.0,'a',20,'2022-10-02'); -no such table foreign_key.fk_02 insert into fk_02 values(8.9,'c',20,'2022-10-01'),(null,'a',21,'2022-10-01'); -no such table foreign_key.fk_02 insert into fk_02 values(3.5,'e',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'); -no such table foreign_key.fk_02 +internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; ➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 4.300 ¦ c ¦ 20 ¦ 2022-10-02 select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +8.900 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 +8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 +null ¦ a ¦ 21 ¦ 2022-10-01 update fk_02 set col1=6.0 where col3=21; -no such table foreign_key.fk_02 select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 +8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 update fk_01 set col2='d' where col1=6.0; select * from fk_01; ➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 @@ -641,7 +653,12 @@ select * from fk_01; 4.300 ¦ c ¦ 20 ¦ 2022-10-02 𝄀 6.000 ¦ d ¦ 21 ¦ 2022-10-01 select * from fk_02; -SQL parser error: table "fk_02" does not exist +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 +8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 set autocommit=0; create table t1(a int primary key); insert into t1 values (1); diff --git a/test/distributed/cases/foreign_key/foreign_key.sql b/test/distributed/cases/foreign_key/foreign_key.sql index 2ee542f5f9245..b3f333e5bddbd 100644 --- a/test/distributed/cases/foreign_key/foreign_key.sql +++ b/test/distributed/cases/foreign_key/foreign_key.sql @@ -251,12 +251,12 @@ drop table if exists c1; drop table if exists f1; create table f1 (a int, b int, c int, d int, e int, primary key(a,b), unique key(c,d)); insert into f1 values (1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(2,1,2,1,1),(3,1,3,1,1),(4,1,4,1,1),(1,2,1,2,1); -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a)); +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); insert into c1 values (1,1,1,1,1); insert into c1 values (2,5,1,1,1); drop table c1; -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); -insert into c1 values (1,1,1,1,1); +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); +insert into c1 values (1,1,2,1,1); delete from f1 where a=1 and b=2; select * from c1; drop table c1; @@ -266,14 +266,14 @@ create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constrai create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_c,f_d) REFERENCES f1(c,d)); create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); select * from fk_01; select * from fk_02; -update fk_02 set col3=19 where col3=20; +update fk_02 set col2='b' where col3=20; select * from fk_02; delete from fk_01 where col3=20; select * from fk_01; @@ -283,13 +283,13 @@ drop table if exists c1; drop table if exists f1; create table f1(a int, b int, c int, primary key(a,b)); insert into f1 values (2,1,1), (2,2,2),(2,3,3); -create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); +create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a,c_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); insert into c1 values (1,2,1),(2,2,2),(3,2,3); update f1 set a=111 where b=1; select * from f1; select * from c1; delete from c1; -insert into c1 values (1,2,1),(2,2,2),(3,2,3); +insert into c1 values (1,111,1),(2,2,2),(3,2,3); delete from f1 where b=2; select * from f1; select * from c1; @@ -298,14 +298,14 @@ drop table if exists fk_02; drop table if exists fk_01; -- foreign key is one of pk,on delete /update SET NULL create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); select * from fk_01; select * from fk_02; -update fk_02 set col3=19 where col3=20; +update fk_02 set col2='b' where col3=20; select * from fk_02; delete from fk_01 where col3=19; select * from fk_01; @@ -314,12 +314,13 @@ drop table fk_02; drop table fk_01; -- foreign key is one of pk and unique key,on delete /update CASCADE -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key(col3)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key uk_col3(col3), unique key uk_col1_col3(col1,col3)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3) REFERENCES fk_01(col1,col3) on delete CASCADE on update CASCADE); +drop table fk_02; drop table fk_01; -- foreign key is one of unique key,on delete /update CASCADE -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2), unique key uk_col1(col1)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete CASCADE on update CASCADE); insert into fk_01 values(8.9,'a',20,'2022-10-01'),(6.0,'a',21,'2022-10-01'),(4.3,'c',20,'2022-10-02'); insert into fk_02 values(8.9,'a',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'),(6.0,'a',20,'2022-10-02'); diff --git a/test/distributed/cases/foreign_key/update_modern_fk.result b/test/distributed/cases/foreign_key/update_modern_fk.result index 2356c1477c8bf..7e35d098006a3 100644 --- a/test/distributed/cases/foreign_key/update_modern_fk.result +++ b/test/distributed/cases/foreign_key/update_modern_fk.result @@ -330,22 +330,21 @@ primary key (a, b) create table child_nonunique_prefix ( id int primary key, parent_a int, -constraint fk_nonunique_prefix foreign key (parent_a) -references parent_nonunique_prefix(a) on update cascade +parent_b int, +constraint fk_nonunique_prefix foreign key (parent_a, parent_b) +references parent_nonunique_prefix(a, b) on update cascade ); -internal error: failed to add the foreign key constraint insert into parent_nonunique_prefix values (1, 1), (1, 2); -insert into child_nonunique_prefix values (10, 1); -no such table update_modern_fk.child_nonunique_prefix +insert into child_nonunique_prefix values (10, 1, 1); update parent_nonunique_prefix set a = b + 1 where a = 1; select * from parent_nonunique_prefix order by a, b; ➤ a[4,32,0] ¦ b[4,32,0] 𝄀 2 ¦ 1 𝄀 3 ¦ 2 select * from child_nonunique_prefix order by id; -SQL parser error: table "child_nonunique_prefix" does not exist +➤ id[4,32,0] ¦ parent_a[4,32,0] ¦ parent_b[4,32,0] 𝄀 +10 ¦ 2 ¦ 1 drop table child_nonunique_prefix; -no such table update_modern_fk.child_nonunique_prefix drop table parent_nonunique_prefix; drop table child_generated_unique; drop table parent_generated_unique; diff --git a/test/distributed/cases/foreign_key/update_modern_fk.sql b/test/distributed/cases/foreign_key/update_modern_fk.sql index 20c62363523c6..4a1ab9bd061d9 100644 --- a/test/distributed/cases/foreign_key/update_modern_fk.sql +++ b/test/distributed/cases/foreign_key/update_modern_fk.sql @@ -268,11 +268,12 @@ create table parent_nonunique_prefix ( create table child_nonunique_prefix ( id int primary key, parent_a int, - constraint fk_nonunique_prefix foreign key (parent_a) - references parent_nonunique_prefix(a) on update cascade + parent_b int, + constraint fk_nonunique_prefix foreign key (parent_a, parent_b) + references parent_nonunique_prefix(a, b) on update cascade ); insert into parent_nonunique_prefix values (1, 1), (1, 2); -insert into child_nonunique_prefix values (10, 1); +insert into child_nonunique_prefix values (10, 1, 1); update parent_nonunique_prefix set a = b + 1 where a = 1; select * from parent_nonunique_prefix order by a, b; select * from child_nonunique_prefix order by id; From bcaf7766f92f3599a7d815200f104a25f341e9dc Mon Sep 17 00:00:00 2001 From: daviszhen Date: Wed, 5 Aug 2026 12:23:39 +0800 Subject: [PATCH 18/24] update --- pkg/bootstrap/service_upgrade_tenant.go | 8 +- pkg/bootstrap/service_upgrade_tenant_test.go | 77 ++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/pkg/bootstrap/service_upgrade_tenant.go b/pkg/bootstrap/service_upgrade_tenant.go index e11649399d393..6071ccdd2937d 100644 --- a/pkg/bootstrap/service_upgrade_tenant.go +++ b/pkg/bootstrap/service_upgrade_tenant.go @@ -247,8 +247,12 @@ func (s *service) asyncUpgradeTenantTask(ctx context.Context) { zap.String("tenant-version", createVersion), zap.String("upgrade", upgrade.String())) - // createVersion >= upgrade.ToVersion already upgrade - if versions.Compare(createVersion, upgrade.ToVersion) >= 0 { + // A version-offset refresh can create an upgrade whose source and + // target version strings are identical. Reapply that handler so + // tenants at the old offset receive its idempotent metadata changes. + versionComparison := versions.Compare(createVersion, upgrade.ToVersion) + if versionComparison > 0 || + (versionComparison == 0 && upgrade.FromVersion != upgrade.ToVersion) { continue } diff --git a/pkg/bootstrap/service_upgrade_tenant_test.go b/pkg/bootstrap/service_upgrade_tenant_test.go index 742e65252509f..715a40df65aa9 100644 --- a/pkg/bootstrap/service_upgrade_tenant_test.go +++ b/pkg/bootstrap/service_upgrade_tenant_test.go @@ -158,6 +158,83 @@ func Test_asyncUpgradeTenantTask_SkipsTenantAtTargetVersion(t *testing.T) { ) } +func Test_asyncUpgradeTenantTask_ReappliesSameVersionOffsetUpgrade(t *testing.T) { + sid := "" + runtime.RunTest( + sid, + func(rt runtime.Runtime) { + var taskReady atomic.Bool + var finalized atomic.Bool + var tenantVersionUpdated atomic.Bool + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*50) + defer cancel() + + sqlExecutor := executor.NewMemExecutor(func(sql string) (executor.Result, error) { + switch { + case strings.Contains(sql, "from mo_upgrade") && + strings.Contains(sql, "where state = 1") && + !strings.Contains(sql, "for update"): + return buildUpgradeVersionResult(100, 1, "4.0.6", "4.0.6", 9, 1, 1, 1, 1, 0), nil + case strings.Contains(sql, "from mo_upgrade_tenant where from_account_id >= 0"): + if taskReady.Load() { + return executor.Result{}, nil + } + return buildUpgradeTenantTaskRows([]uint64{200}, []int32{10}, []int32{10}), nil + case strings.Contains(sql, "select account_id, create_version from mo_account where account_id >= 10 and account_id <= 10"): + return buildUpgradeTenantAccountRows([]int32{10}, []string{"4.0.6"}), nil + case strings.Contains(sql, "update mo_account set create_version = '4.0.6' where account_id = 10"): + tenantVersionUpdated.Store(true) + return executor.Result{AffectedRows: 1}, nil + case strings.Contains(sql, "update mo_upgrade_tenant set ready = 1") && + strings.Contains(sql, "where id = 200"): + taskReady.Store(true) + return executor.Result{AffectedRows: 1}, nil + case strings.Contains(sql, "select 1 from mo_upgrade_tenant where upgrade_id = 100 and ready = 0"): + return executor.Result{}, nil + case strings.Contains(sql, "from mo_upgrade") && + strings.Contains(sql, "where id = 100 for update"): + return buildUpgradeVersionResult(100, 1, "4.0.6", "4.0.6", 9, 1, 1, 1, 1, 0), nil + case strings.Contains(sql, "update mo_upgrade set total_tenant = 1, ready_tenant = 0"): + return executor.Result{AffectedRows: 1}, nil + case strings.Contains(sql, "update mo_upgrade set total_tenant = 1, ready_tenant = 1") && + strings.Contains(sql, "state = 2"): + finalized.Store(true) + cancel() + return executor.Result{AffectedRows: 1}, nil + default: + return executor.Result{}, fmt.Errorf("unexpected sql: %s", sql) + } + }) + + h := newTestVersionHandler("4.0.6", "4.0.5", versions.Yes, versions.Yes, 9) + s := newServiceForTest( + sid, + &memLocker{}, + clock.NewHLCClock(func() int64 { return 0 }, 0), + nil, + sqlExecutor, + func(s *service) { + s.handles = append(s.handles, h) + }, + WithCheckUpgradeTenantDuration(time.Millisecond), + ) + + txnOperator := mock_frontend.NewMockTxnOperator(gomock.NewController(t)) + txnOperator.EXPECT().TxnOptions().Return(txn.TxnOptions{CN: sid}).AnyTimes() + + s.exec = executor.NewMemExecutor2(func(sql string) (executor.Result, error) { + return sqlExecutor.Exec(context.Background(), sql, executor.Options{}) + }, txnOperator) + + s.asyncUpgradeTenantTask(ctx) + require.True(t, taskReady.Load()) + require.True(t, finalized.Load()) + require.Equal(t, uint64(1), h.callHandleTenantUpgrade.Load()) + require.True(t, tenantVersionUpdated.Load()) + }, + ) +} + func Test_asyncUpgradeTenantTask_AutoCompletesDeletedTenantTasks(t *testing.T) { sid := "" runtime.RunTest( From 6bb24bdf5b9ba9d4ad90ed8e61ef8035f1f04c87 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Wed, 5 Aug 2026 14:31:14 +0800 Subject: [PATCH 19/24] update --- pkg/vm/engine/test/cdc_testutil.go | 3 +++ pkg/vm/engine/test/change_handle_test.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/pkg/vm/engine/test/cdc_testutil.go b/pkg/vm/engine/test/cdc_testutil.go index 2c89cfaa0895e..86291e24f57b7 100644 --- a/pkg/vm/engine/test/cdc_testutil.go +++ b/pkg/vm/engine/test/cdc_testutil.go @@ -248,6 +248,9 @@ func mock_mo_foreign_keys( "`refer_column_id` bigint unsigned NOT NULL DEFAULT 0," + "`on_delete` varchar(128) NOT NULL," + "`on_update` varchar(128) NOT NULL," + + "`referenced_index_name` varchar(5000) NOT NULL DEFAULT ''," + + "`on_delete_origin` varchar(64) NOT NULL DEFAULT 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'," + + "`on_update_origin` varchar(64) NOT NULL DEFAULT 'ACTION_ORIGIN_LEGACY_AMBIGUOUS'," + "PRIMARY KEY (`constraint_name`,`constraint_id`,`db_name`,`db_id`,`table_name`,`table_id`,`column_name`,`column_id`,`refer_db_name`,`refer_db_id`,`refer_table_name`,`refer_table_id`,`refer_column_name`,`refer_column_id`)" + ")" diff --git a/pkg/vm/engine/test/change_handle_test.go b/pkg/vm/engine/test/change_handle_test.go index 8984776ae77cb..d3aef64658313 100644 --- a/pkg/vm/engine/test/change_handle_test.go +++ b/pkg/vm/engine/test/change_handle_test.go @@ -1818,6 +1818,10 @@ func TestISCPExecutor1(t *testing.T) { require.NoError(t, err) err = mock_mo_foreign_keys(disttaeEngine, ctxWithTimeout) require.NoError(t, err) + result, err := execSql(disttaeEngine, ctxWithTimeout, + "SELECT referenced_index_name, on_delete_origin, on_update_origin FROM mo_catalog.mo_foreign_keys") + require.NoError(t, err) + result.Close() err = mock_mo_intra_system_change_propagation_log(disttaeEngine, ctxWithTimeout) require.NoError(t, err) t.Log(taeHandler.GetDB().Catalog.SimplePPString(3)) From f7eddbb70a8d0c8ba06fd44cc073ab2617d5f01e Mon Sep 17 00:00:00 2001 From: daviszhen Date: Wed, 5 Aug 2026 14:37:45 +0800 Subject: [PATCH 20/24] update --- test/distributed/cases/mo_cloud/mo_cloud.result | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/distributed/cases/mo_cloud/mo_cloud.result b/test/distributed/cases/mo_cloud/mo_cloud.result index f563a58c4069c..f90bf1896e097 100644 --- a/test/distributed/cases/mo_cloud/mo_cloud.result +++ b/test/distributed/cases/mo_cloud/mo_cloud.result @@ -771,7 +771,7 @@ SELECT count(*) FROM information_schema.tables WHERE table_schema = '' AND table SELECT datname AS name, IF (table_cnt IS NULL, 0, table_cnt) AS tables, role_name AS owner FROM (SELECT dat_id, datname, mo_database.created_time, IF(role_name IS NULL, '-', role_name) AS role_name FROM mo_catalog.mo_database LEFT JOIN mo_catalog.mo_role ON mo_database.owner = role_id) AS x LEFT JOIN(SELECT count(*) AS table_cnt, reldatabase_id FROM mo_catalog.mo_tables WHERE relkind IN ('r','v','e','cluster') GROUP BY reldatabase_id) AS y ON x.dat_id = y.reldatabase_id order by name; ➤ name[12,-1,0] ¦ tables[-5,64,0] ¦ owner[12,-1,0] 𝄀 information_schema ¦ 24 ¦ accountadmin 𝄀 -mo_catalog ¦ 33 ¦ - 𝄀 +mo_catalog ¦ 35 ¦ - 𝄀 mo_mo ¦ 0 ¦ accountadmin 𝄀 mysql ¦ 6 ¦ accountadmin 𝄀 system ¦ 1 ¦ accountadmin 𝄀 @@ -892,7 +892,6 @@ SELECT relname AS `name`, mo_table_rows(reldatabase, relname) AS `rows`, mo_tabl character_sets ¦ 3 ¦ 96 ¦ accountadmin 𝄀 collations ¦ 0 ¦ 0 ¦ accountadmin 𝄀 column_privileges ¦ 0 ¦ 0 ¦ accountadmin 𝄀 -key_column_usage ¦ 0 ¦ 0 ¦ accountadmin 𝄀 engines ¦ 0 ¦ 0 ¦ accountadmin 𝄀 events ¦ 0 ¦ 0 ¦ accountadmin 𝄀 files ¦ 0 ¦ 0 ¦ accountadmin 𝄀 From 17f23ba4ff0979a6124e1edea51eb7438629818c Mon Sep 17 00:00:00 2001 From: daviszhen Date: Wed, 5 Aug 2026 15:29:38 +0800 Subject: [PATCH 21/24] update --- pkg/sql/plan/build_ddl.go | 24 ++++++++++++------------ pkg/sql/plan/build_ddl_test.go | 12 +++++++++--- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/pkg/sql/plan/build_ddl.go b/pkg/sql/plan/build_ddl.go index bad883d052615..fa0feb13d4df8 100644 --- a/pkg/sql/plan/build_ddl.go +++ b/pkg/sql/plan/build_ddl.go @@ -4767,13 +4767,13 @@ create table f1 (a int ,b int, c int ,d int ,e int, primary key(a,b), unique key(c,d), unique key (e)) -The referenced columns must exactly match one PRIMARY or UNIQUE key, in the -same order. Prefixes are not enough: with PRIMARY KEY(a, b), only (a, b) is -valid; neither (a) nor (b) identifies the referenced constraint. +The referenced columns must be a leading prefix of one PRIMARY or UNIQUE key, +in the same order. With PRIMARY KEY(a, b), both (a) and (a, b) are valid, but +(b) and (b, a) are not. -When more than one exact key exists, PRIMARY is selected first; otherwise the -lexicographically first named UNIQUE key is selected. Persisting this selected -name makes information_schema.REFERENTIAL_CONSTRAINTS deterministic. +When more than one key has the same prefix, PRIMARY is selected first; +otherwise the lexicographically first named UNIQUE key is selected. Persisting +this selected name makes information_schema.REFERENTIAL_CONSTRAINTS deterministic. */ func checkFkColsAreValid(ctx CompilerContext, fkData *FkData, parentTableDef *TableDef) error { // colId in parent table-> position in parent table @@ -4817,19 +4817,19 @@ func checkFkColsAreValid(ctx CompilerContext, fkData *FkData, parentTableDef *Ta }) for _, key := range keys { - if len(key.columns) != len(fkData.ColsReferred.Cols) { + if len(key.columns) < len(fkData.ColsReferred.Cols) { continue } - matchCols := make([]uint64, len(key.columns)) + matchCols := make([]uint64, len(fkData.ColsReferred.Cols)) matched := true - for i, colName := range key.columns { - if colName != fkData.ColsReferred.Cols[i] { + for i, referredColName := range fkData.ColsReferred.Cols { + if key.columns[i] != referredColName { matched = false break } - colID := parentTableDef.Cols[columnNamePos[colName]].ColId + colID := parentTableDef.Cols[columnNamePos[referredColName]].ColId if parentTableDef.Cols[columnIdPos[colID]].Typ.Id != fkData.ColTyps[i].Id { - return moerr.NewInternalErrorf(ctx.GetContext(), "type of reference column '%v' is not match for column '%v'", colName, fkData.Cols.Cols[i]) + return moerr.NewInternalErrorf(ctx.GetContext(), "type of reference column '%v' is not match for column '%v'", referredColName, fkData.Cols.Cols[i]) } matchCols[i] = colID } diff --git a/pkg/sql/plan/build_ddl_test.go b/pkg/sql/plan/build_ddl_test.go index 566cb226cc477..2bf467ff925e6 100644 --- a/pkg/sql/plan/build_ddl_test.go +++ b/pkg/sql/plan/build_ddl_test.go @@ -1852,7 +1852,7 @@ func TestPartitionCreateSQLIsModeIndependentForAddPartition(t *testing.T) { require.Len(t, defs, 1) } -func TestCheckFkColsAreValidRecordsExactReferencedKey(t *testing.T) { +func TestCheckFkColsAreValidRecordsReferencedKey(t *testing.T) { ctx := NewMockCompilerContext(true) ctx.SetContext(context.Background()) intType := plan.Type{Id: int32(types.T_int32)} @@ -1862,7 +1862,7 @@ func TestCheckFkColsAreValidRecordsExactReferencedKey(t *testing.T) { {ColId: 1, Name: "id", Typ: intType}, {ColId: 2, Name: "code", Typ: intType}, }, - Pkey: &plan.PrimaryKeyDef{Names: []string{"id"}}, + Pkey: &plan.PrimaryKeyDef{Names: []string{"id", "code"}}, Indexes: []*plan.IndexDef{ {IndexName: "uq_parent_id", Unique: true, Parts: []string{"id"}}, {IndexName: "uq_parent_code", Unique: true, Parts: []string{"code"}}, @@ -1887,7 +1887,13 @@ func TestCheckFkColsAreValidRecordsExactReferencedKey(t *testing.T) { composite := newFK("id", "code") composite.ColTyps[1] = &intType - require.Error(t, checkFkColsAreValid(ctx, composite, parent), "a partial/mismatched key must not be accepted") + require.NoError(t, checkFkColsAreValid(ctx, composite, parent)) + require.Equal(t, "PRIMARY", composite.Def.ReferencedIndexName) + require.Equal(t, []uint64{1, 2}, composite.Def.ForeignCols) + + nonPrefix := newFK("code", "id") + nonPrefix.ColTyps[1] = &intType + require.Error(t, checkFkColsAreValid(ctx, nonPrefix, parent), "a non-prefix key must not be accepted") unique := newFK("code") require.NoError(t, checkFkColsAreValid(ctx, unique, parent)) From 7278e0aa7eca0b5dc32f1e7e09380c034dff60a2 Mon Sep 17 00:00:00 2001 From: daviszhen Date: Wed, 5 Aug 2026 18:13:22 +0800 Subject: [PATCH 22/24] update --- .../cases/database/system_table.result | 481 ++++++------ .../cases/foreign_key/fk_base.result | 223 +++--- .../distributed/cases/foreign_key/fk_base.sql | 28 +- .../cases/foreign_key/foreign_key.result | 657 ++++++++-------- .../cases/foreign_key/foreign_key.sql | 23 +- .../cases/foreign_key/update_modern_fk.result | 16 +- .../cases/foreign_key/update_modern_fk.sql | 7 +- .../clone/clone_fk_after_alter.result | 203 ++--- .../system_variable/system_variables.result | 716 +++++++++--------- .../cases/table/truncate_table_2.result | 145 ++-- 10 files changed, 1186 insertions(+), 1313 deletions(-) diff --git a/test/distributed/cases/database/system_table.result b/test/distributed/cases/database/system_table.result index 707e42f32ea1c..f2a0a14d07202 100644 --- a/test/distributed/cases/database/system_table.result +++ b/test/distributed/cases/database/system_table.result @@ -1,271 +1,296 @@ SELECT table_catalog,table_schema,table_name,table_type from `information_schema`.`tables` where table_name = 'mo_tables'; -➤ table_catalog[12,-1,0] ¦ table_schema[12,-1,0] ¦ table_name[12,-1,0] ¦ table_type[12,-1,0] 𝄀 -def ¦ mo_catalog ¦ mo_tables ¦ BASE TABLE +table_catalog table_schema table_name table_type +def mo_catalog mo_tables BASE TABLE SELECT * FROM `information_schema`.`character_sets` LIMIT 0,1000; -➤ character_set_name[12,-1,0] ¦ default_collate_name[12,-1,0] ¦ description[12,-1,0] ¦ maxlen[4,32,0] 𝄀 -binary ¦ binary ¦ Binary pseudo charset ¦ 1 𝄀 -utf8 ¦ utf8_bin ¦ UTF-8 Unicode ¦ 4 𝄀 -utf8mb4 ¦ utf8mb4_bin ¦ UTF-8 Unicode ¦ 4 +character_set_name default_collate_name description maxlen +binary binary Binary pseudo charset 1 +utf8 utf8_bin UTF-8 Unicode 4 +utf8mb4 utf8mb4_bin UTF-8 Unicode 4 SELECT * FROM `information_schema`.`columns` where TABLE_NAME = 'mo_tables' order by ORDINAL_POSITION LIMIT 2; -➤ TABLE_CATALOG[12,-1,0] ¦ TABLE_SCHEMA[12,-1,0] ¦ TABLE_NAME[12,-1,0] ¦ COLUMN_NAME[12,-1,0] ¦ ORDINAL_POSITION[4,32,0] ¦ COLUMN_DEFAULT[12,-1,0] ¦ IS_NULLABLE[12,-1,0] ¦ DATA_TYPE[12,-1,0] ¦ CHARACTER_MAXIMUM_LENGTH[-5,64,0] ¦ CHARACTER_OCTET_LENGTH[-5,64,0] ¦ NUMERIC_PRECISION[-5,64,0] ¦ NUMERIC_SCALE[-5,64,0] ¦ DATETIME_PRECISION[-5,64,0] ¦ CHARACTER_SET_NAME[12,-1,0] ¦ COLLATION_NAME[12,-1,0] ¦ COLUMN_TYPE[12,-1,0] ¦ COLUMN_KEY[12,-1,0] ¦ EXTRA[12,-1,0] ¦ PRIVILEGES[12,-1,0] ¦ COLUMN_COMMENT[12,-1,0] ¦ GENERATION_EXPRESSION[12,-1,0] ¦ SRS_ID[-5,64,0] 𝄀 -def ¦ mo_catalog ¦ mo_tables ¦ rel_id ¦ 1 ¦ null ¦ YES ¦ BIGINT UNSIGNED ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ BIGINT UNSIGNED(0) ¦ ¦ ¦ select,insert,update,references ¦ ¦ ¦ null 𝄀 -def ¦ mo_catalog ¦ mo_tables ¦ relname ¦ 2 ¦ null ¦ YES ¦ VARCHAR ¦ 5000 ¦ 20000 ¦ null ¦ null ¦ null ¦ utf8 ¦ utf8_bin ¦ VARCHAR(5000) ¦ ¦ ¦ select,insert,update,references ¦ ¦ ¦ null +table_catalog table_schema table_name column_name ordinal_position column_default is_nullable data_type character_maximum_length character_octet_length numeric_precision numeric_scale datetime_precision character_set_name collation_name column_type column_key extra privileges column_comment generation_expression srs_id +def mo_catalog mo_tables rel_id 1 null YES BIGINT UNSIGNED null null null null null null null BIGINT UNSIGNED(0) select,insert,update,references null +def mo_catalog mo_tables relname 2 null YES VARCHAR 5000 20000 null null null utf8 utf8_bin VARCHAR(5000) select,insert,update,references null SELECT * FROM `information_schema`.`key_column_usage` LIMIT 0,1000; -➤ CONSTRAINT_CATALOG[12,-1,0] ¦ CONSTRAINT_SCHEMA[12,-1,0] ¦ CONSTRAINT_NAME[12,-1,0] ¦ TABLE_CATALOG[12,-1,0] ¦ TABLE_SCHEMA[12,-1,0] ¦ TABLE_NAME[12,-1,0] ¦ COLUMN_NAME[12,-1,0] ¦ ORDINAL_POSITION[4,32,0] ¦ POSITION_IN_UNIQUE_CONSTRAINT[4,32,0] ¦ REFERENCED_TABLE_SCHEMA[12,-1,0] ¦ REFERENCED_TABLE_NAME[12,-1,0] ¦ REFERENCED_COLUMN_NAME[12,-1,0] +constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name ordinal_position position_in_unique_constraint referenced_table_schema referenced_table_name referenced_column_name SELECT * FROM `information_schema`.`profiling` LIMIT 0,1000; -➤ query_id[4,32,0] ¦ seq[4,32,0] ¦ state[12,-1,0] ¦ duration[3,9,6] ¦ cpu_user[3,9,6] ¦ cpu_system[3,9,6] ¦ context_voluntary[4,32,0] ¦ context_involuntary[4,32,0] ¦ block_ops_in[4,32,0] ¦ block_ops_out[4,32,0] ¦ messages_sent[4,32,0] ¦ messages_received[4,32,0] ¦ page_faults_major[4,32,0] ¦ page_faults_minor[4,32,0] ¦ swaps[4,32,0] ¦ source_function[12,-1,0] ¦ source_file[12,-1,0] ¦ source_line[4,32,0] +query_id seq state duration cpu_user cpu_system context_voluntary context_involuntary block_ops_in block_ops_out messages_sent messages_received page_faults_major page_faults_minor swaps source_function source_file source_line SELECT * FROM `information_schema`.`schemata` where schema_name = 'information_schema'; -➤ CATALOG_NAME[12,-1,0] ¦ SCHEMA_NAME[12,-1,0] ¦ DEFAULT_CHARACTER_SET_NAME[12,-1,0] ¦ DEFAULT_COLLATION_NAME[12,-1,0] ¦ SQL_PATH[1,0,0] ¦ DEFAULT_ENCRYPTION[12,-1,0] 𝄀 -def ¦ information_schema ¦ utf8mb4 ¦ utf8mb4_0900_ai_ci ¦ null ¦ NO +catalog_name schema_name default_character_set_name default_collation_name sql_path default_encryption +def information_schema utf8mb4 utf8mb4_0900_ai_ci null NO SELECT * FROM `information_schema`.`triggers` LIMIT 0,1000; -➤ trigger_catalog[12,-1,0] ¦ trigger_schema[12,-1,0] ¦ trigger_name[12,-1,0] ¦ event_manipulation[12,-1,0] ¦ event_object_catalog[12,-1,0] ¦ event_object_schema[12,-1,0] ¦ event_object_table[12,-1,0] ¦ action_order[4,32,0] ¦ action_condition[12,0,0] ¦ action_statement[12,0,0] ¦ action_orientation[12,-1,0] ¦ action_timing[12,-1,0] ¦ action_reference_old_table[12,0,0] ¦ action_reference_new_table[12,0,0] ¦ action_reference_old_row[12,-1,0] ¦ action_reference_new_row[12,-1,0] ¦ created[93,64,0] ¦ sql_mode[12,-1,0] ¦ definer[12,-1,0] ¦ character_set_client[12,-1,0] ¦ collation_connection[12,-1,0] ¦ database_collation[12,-1,0] +trigger_catalog trigger_schema trigger_name event_manipulation event_object_catalog event_object_schema event_object_table action_order action_condition action_statement action_orientation action_timing action_reference_old_table action_reference_new_table action_reference_old_row action_reference_new_row created sql_mode definer character_set_client collation_connection database_collation SELECT * FROM `information_schema`.`user_privileges` LIMIT 0,1000; -➤ grantee[12,-1,0] ¦ table_catalog[12,-1,0] ¦ privilege_type[12,-1,0] ¦ is_grantable[12,-1,0] +grantee table_catalog privilege_type is_grantable SELECT TABLE_SCHEMA AS TABLE_CAT, NULL AS TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, NULL AS INDEX_QUALIFIER, INDEX_NAME,3 AS TYPE, SEQ_IN_INDEX AS ORDINAL_POSITION, COLUMN_NAME,COLLATION AS ASC_OR_DESC, CARDINALITY, 0 AS PAGES, NULL AS FILTER_CONDITION FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'procs_priv' ORDER BY NON_UNIQUE, INDEX_NAME, SEQ_IN_INDEX limit 1; -➤ TABLE_CAT[12,-1,0] ¦ TABLE_SCHEM[12,4,0] ¦ TABLE_NAME[12,-1,0] ¦ NON_UNIQUE[-5,64,0] ¦ INDEX_QUALIFIER[12,4,0] ¦ INDEX_NAME[12,-1,0] ¦ TYPE[-5,64,0] ¦ ORDINAL_POSITION[4,32,0] ¦ COLUMN_NAME[12,-1,0] ¦ ASC_OR_DESC[12,-1,0] ¦ CARDINALITY[-5,64,0] ¦ PAGES[-5,64,0] ¦ FILTER_CONDITION[12,4,0] 𝄀 -mysql ¦ null ¦ procs_priv ¦ 0 ¦ null ¦ PRIMARY ¦ 3 ¦ 1 ¦ Host ¦ A ¦ 0 ¦ 0 ¦ null +TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION +mysql null procs_priv 0 null PRIMARY 3 1 Host A 0 0 null SELECT * FROM `mysql`.`columns_priv` LIMIT 0,1000; -➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ table_name[1,64,0] ¦ column_name[1,64,0] ¦ timestamp[93,64,0] ¦ column_priv[12,-1,0] +host db user table_name column_name timestamp column_priv SELECT * FROM `mysql`.`db` LIMIT 0,1000; -➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ select_priv[12,-1,0] ¦ insert_priv[12,-1,0] ¦ update_priv[12,-1,0] ¦ delete_priv[12,-1,0] ¦ create_priv[12,-1,0] ¦ drop_priv[12,-1,0] ¦ grant_priv[12,-1,0] ¦ references_priv[12,-1,0] ¦ index_priv[12,-1,0] ¦ alter_priv[12,-1,0] ¦ create_tmp_table_priv[12,-1,0] ¦ lock_tables_priv[12,-1,0] ¦ create_view_priv[12,-1,0] ¦ show_view_priv[12,-1,0] ¦ create_routine_priv[12,-1,0] ¦ alter_routine_priv[12,-1,0] ¦ execute_priv[12,-1,0] ¦ event_priv[12,-1,0] ¦ trigger_priv[12,-1,0] +host db user select_priv insert_priv update_priv delete_priv create_priv drop_priv grant_priv references_priv index_priv alter_priv create_tmp_table_priv lock_tables_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv execute_priv event_priv trigger_priv SELECT * FROM `mysql`.`procs_priv` LIMIT 0,1000; -➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ routine_name[1,64,0] ¦ routine_type[12,-1,0] ¦ grantor[12,-1,0] ¦ proc_priv[12,-1,0] ¦ timestamp[93,64,0] +host db user routine_name routine_type grantor proc_priv timestamp SELECT * FROM `mysql`.`tables_priv` LIMIT 0,1000; -➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ table_name[1,64,0] ¦ grantor[12,-1,0] ¦ timestamp[93,64,0] ¦ table_priv[12,-1,0] ¦ column_priv[12,-1,0] +host db user table_name grantor timestamp table_priv column_priv SELECT * FROM `mysql`.`user` LIMIT 0,1000; -➤ host[1,255,0] ¦ user[1,32,0] ¦ select_priv[12,-1,0] ¦ insert_priv[12,-1,0] ¦ update_priv[12,-1,0] ¦ delete_priv[12,-1,0] ¦ create_priv[12,-1,0] ¦ drop_priv[12,-1,0] ¦ reload_priv[12,-1,0] ¦ shutdown_priv[12,-1,0] ¦ process_priv[12,-1,0] ¦ file_priv[12,-1,0] ¦ grant_priv[12,-1,0] ¦ references_priv[12,-1,0] ¦ index_priv[12,-1,0] ¦ alter_priv[12,-1,0] ¦ show_db_priv[12,-1,0] ¦ super_priv[12,-1,0] ¦ create_tmp_table_priv[12,-1,0] ¦ lock_tables_priv[12,-1,0] ¦ execute_priv[12,-1,0] ¦ repl_slave_priv[12,-1,0] ¦ repl_client_priv[12,-1,0] ¦ create_view_priv[12,-1,0] ¦ show_view_priv[12,-1,0] ¦ create_routine_priv[12,-1,0] ¦ alter_routine_priv[12,-1,0] ¦ create_user_priv[12,-1,0] ¦ event_priv[12,-1,0] ¦ trigger_priv[12,-1,0] ¦ create_tablespace_priv[12,-1,0] ¦ ssl_type[12,-1,0] ¦ ssl_cipher[12,0,0] ¦ x509_issuer[12,0,0] ¦ x509_subject[12,0,0] ¦ max_questions[4,32,0] ¦ max_updates[4,32,0] ¦ max_connections[4,32,0] ¦ max_user_connections[4,32,0] ¦ plugin[1,64,0] ¦ authentication_string[12,0,0] ¦ password_expired[12,-1,0] ¦ password_last_changed[93,64,0] ¦ password_lifetime[5,16,0] ¦ account_locked[12,-1,0] ¦ create_role_priv[12,-1,0] ¦ drop_role_priv[12,-1,0] ¦ password_reuse_history[5,16,0] ¦ password_reuse_time[5,16,0] ¦ password_require_current[12,-1,0] ¦ user_attributes[-1,2147483647,0] +host user select_priv insert_priv update_priv delete_priv create_priv drop_priv reload_priv shutdown_priv process_priv file_priv grant_priv references_priv index_priv alter_priv show_db_priv super_priv create_tmp_table_priv lock_tables_priv execute_priv repl_slave_priv repl_client_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv create_user_priv event_priv trigger_priv create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired password_last_changed password_lifetime account_locked create_role_priv drop_role_priv password_reuse_history password_reuse_time password_require_current user_attributes use mysql; show tables; -➤ Tables_in_mysql[12,-1,0] 𝄀 -columns_priv 𝄀 -db 𝄀 -procs_priv 𝄀 -role_edges 𝄀 -tables_priv 𝄀 +Tables_in_mysql +columns_priv +db +procs_priv +role_edges +tables_priv user show columns from `db`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Select_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Insert_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Update_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Delete_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Drop_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Grant_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -References_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Index_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Alter_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_tmp_table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Lock_tables_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Show_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Alter_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Execute_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Event_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Trigger_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Select_priv VARCHAR(10) NO N +Insert_priv VARCHAR(10) NO N +Update_priv VARCHAR(10) NO N +Delete_priv VARCHAR(10) NO N +Create_priv VARCHAR(10) NO N +Drop_priv VARCHAR(10) NO N +Grant_priv VARCHAR(10) NO N +References_priv VARCHAR(10) NO N +Index_priv VARCHAR(10) NO N +Alter_priv VARCHAR(10) NO N +Create_tmp_table_priv VARCHAR(10) NO N +Lock_tables_priv VARCHAR(10) NO N +Create_view_priv VARCHAR(10) NO N +Show_view_priv VARCHAR(10) NO N +Create_routine_priv VARCHAR(10) NO N +Alter_routine_priv VARCHAR(10) NO N +Execute_priv VARCHAR(10) NO N +Event_priv VARCHAR(10) NO N +Trigger_priv VARCHAR(10) NO N show columns from `procs_priv`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Routine_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Routine_type ¦ VARCHAR(10) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 -Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 -Proc_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Routine_name CHAR(64) NO PRI +Routine_type VARCHAR(10) NO PRI null +Grantor VARCHAR(288) NO MUL +Proc_priv VARCHAR(10) NO +Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() show columns from `columns_priv`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Column_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 -Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Table_name CHAR(64) NO PRI +Column_name CHAR(64) NO PRI +Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +Column_priv VARCHAR(10) NO show columns from `tables_priv`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 -Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 -Table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Table_name CHAR(64) NO PRI +Grantor VARCHAR(288) NO MUL +Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +Table_priv VARCHAR(10) NO +Column_priv VARCHAR(10) NO use information_schema; show tables; -➤ Tables_in_information_schema[12,-1,0] 𝄀 -character_sets 𝄀 -collations 𝄀 -column_privileges 𝄀 -columns 𝄀 -engines 𝄀 -events 𝄀 -files 𝄀 -key_column_usage 𝄀 -keywords 𝄀 -parameters 𝄀 -partitions 𝄀 -processlist 𝄀 -profiling 𝄀 -referential_constraints 𝄀 -routines 𝄀 -schema_privileges 𝄀 -schemata 𝄀 -statistics 𝄀 -table_constraints 𝄀 -table_privileges 𝄀 -tables 𝄀 -triggers 𝄀 -user_privileges 𝄀 +Tables_in_information_schema +character_sets +collations +column_privileges +columns +engines +events +files +key_column_usage +keywords +parameters +partitions +processlist +profiling +referential_constraints +routines +schema_privileges +schemata +statistics +table_constraints +table_privileges +tables +triggers +user_privileges views show columns from `KEY_COLUMN_USAGE`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +CONSTRAINT_CATALOG VARCHAR(64) YES null +CONSTRAINT_SCHEMA VARCHAR(64) YES null +CONSTRAINT_NAME VARCHAR(64) YES null +TABLE_CATALOG VARCHAR(64) YES null +TABLE_SCHEMA VARCHAR(64) YES null +TABLE_NAME VARCHAR(64) YES null +COLUMN_NAME VARCHAR(64) YES null +ORDINAL_POSITION INT UNSIGNED(32) YES null +POSITION_IN_UNIQUE_CONSTRAINT INT UNSIGNED(32) YES null +REFERENCED_TABLE_SCHEMA VARCHAR(64) YES null +REFERENCED_TABLE_NAME VARCHAR(64) YES null +REFERENCED_COLUMN_NAME VARCHAR(64) YES null show columns from `COLUMNS`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_schema ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ordinal_position ¦ INT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_default ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -is_nullable ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -data_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -character_maximum_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -character_octet_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -numeric_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -numeric_scale ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -datetime_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -character_set_name ¦ VARCHAR(4) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -collation_name ¦ VARCHAR(8) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_key ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -extra ¦ VARCHAR(24) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -privileges ¦ VARCHAR(31) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -column_comment ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -generation_expression ¦ VARCHAR(500) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -srs_id ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +table_catalog VARCHAR(3) NO null +table_schema VARCHAR(256) YES null +table_name VARCHAR(256) YES null +column_name VARCHAR(256) YES null +ordinal_position INT(0) YES null +column_default VARCHAR(65535) YES null +is_nullable VARCHAR(3) YES null +data_type VARCHAR(65535) YES null +character_maximum_length BIGINT(0) YES null +character_octet_length BIGINT(0) YES null +numeric_precision BIGINT(0) YES null +numeric_scale BIGINT(0) YES null +datetime_precision BIGINT(0) YES null +character_set_name VARCHAR(4) YES null +collation_name VARCHAR(8) YES null +column_type VARCHAR(65535) YES null +column_key VARCHAR(3) YES null +extra VARCHAR(24) YES null +privileges VARCHAR(31) NO null +column_comment VARCHAR(2048) YES null +generation_expression VARCHAR(500) YES null +srs_id BIGINT(0) YES null show columns from `PROFILING`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -QUERY_ID ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 -SEQ ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 -STATE ¦ VARCHAR(30) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -DURATION ¦ DECIMAL(9,6) ¦ NO ¦ ¦ 0.000000 ¦ ¦ 𝄀 -CPU_USER ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CPU_SYSTEM ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CONTEXT_VOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CONTEXT_INVOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -BLOCK_OPS_IN ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -BLOCK_OPS_OUT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -MESSAGES_SENT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -MESSAGES_RECEIVED ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -PAGE_FAULTS_MAJOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -PAGE_FAULTS_MINOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SWAPS ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SOURCE_FUNCTION ¦ VARCHAR(30) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SOURCE_FILE ¦ VARCHAR(20) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SOURCE_LINE ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +QUERY_ID INT(32) NO 0 +SEQ INT(32) NO 0 +STATE VARCHAR(30) NO +DURATION DECIMAL(9,6) NO 0.000000 +CPU_USER DECIMAL(9,6) YES null +CPU_SYSTEM DECIMAL(9,6) YES null +CONTEXT_VOLUNTARY INT(32) YES null +CONTEXT_INVOLUNTARY INT(32) YES null +BLOCK_OPS_IN INT(32) YES null +BLOCK_OPS_OUT INT(32) YES null +MESSAGES_SENT INT(32) YES null +MESSAGES_RECEIVED INT(32) YES null +PAGE_FAULTS_MAJOR INT(32) YES null +PAGE_FAULTS_MINOR INT(32) YES null +SWAPS INT(32) YES null +SOURCE_FUNCTION VARCHAR(30) YES null +SOURCE_FILE VARCHAR(20) YES null +SOURCE_LINE INT(32) YES null show columns from `USER_PRIVILEGES`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -GRANTEE ¦ VARCHAR(292) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -TABLE_CATALOG ¦ VARCHAR(512) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -PRIVILEGE_TYPE ¦ VARCHAR(64) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -IS_GRANTABLE ¦ VARCHAR(3) ¦ NO ¦ ¦ ¦ ¦ +Field Type Null Key Default Extra Comment +GRANTEE VARCHAR(292) NO +TABLE_CATALOG VARCHAR(512) NO +PRIVILEGE_TYPE VARCHAR(64) NO +IS_GRANTABLE VARCHAR(3) NO show columns from `SCHEMATA`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -catalog_name ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -schema_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -default_character_set_name ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -default_collation_name ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -sql_path ¦ CHAR(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -default_encryption ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +catalog_name VARCHAR(3) NO null +schema_name VARCHAR(5000) YES null +default_character_set_name VARCHAR(7) NO null +default_collation_name VARCHAR(18) NO null +sql_path CHAR(0) YES null +default_encryption VARCHAR(3) NO null show columns from `CHARACTER_SETS`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -CHARACTER_SET_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DEFAULT_COLLATE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DESCRIPTION ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -MAXLEN ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +CHARACTER_SET_NAME VARCHAR(64) YES null +DEFAULT_COLLATE_NAME VARCHAR(64) YES null +DESCRIPTION VARCHAR(2048) YES null +MAXLEN INT UNSIGNED(32) YES null show columns from `TRIGGERS`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -TRIGGER_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TRIGGER_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TRIGGER_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_MANIPULATION ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_OBJECT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_OBJECT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_OBJECT_TABLE ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_ORDER ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_CONDITION ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_STATEMENT ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_ORIENTATION ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_TIMING ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_OLD_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_NEW_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_OLD_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_NEW_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CREATED ¦ TIMESTAMP(2) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SQL_MODE ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DEFINER ¦ VARCHAR(288) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CHARACTER_SET_CLIENT ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -COLLATION_CONNECTION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DATABASE_COLLATION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +TRIGGER_CATALOG VARCHAR(64) YES null +TRIGGER_SCHEMA VARCHAR(64) YES null +TRIGGER_NAME VARCHAR(64) YES null +EVENT_MANIPULATION VARCHAR(10) YES null +EVENT_OBJECT_CATALOG VARCHAR(64) YES null +EVENT_OBJECT_SCHEMA VARCHAR(64) YES null +EVENT_OBJECT_TABLE VARCHAR(64) YES null +ACTION_ORDER INT UNSIGNED(32) YES null +ACTION_CONDITION BINARY(0) YES null +ACTION_STATEMENT TEXT(0) YES null +ACTION_ORIENTATION VARCHAR(3) YES null +ACTION_TIMING VARCHAR(10) YES null +ACTION_REFERENCE_OLD_TABLE BINARY(0) YES null +ACTION_REFERENCE_NEW_TABLE BINARY(0) YES null +ACTION_REFERENCE_OLD_ROW VARCHAR(3) YES null +ACTION_REFERENCE_NEW_ROW VARCHAR(3) YES null +CREATED TIMESTAMP(2) YES null +SQL_MODE VARCHAR(10) YES null +DEFINER VARCHAR(288) YES null +CHARACTER_SET_CLIENT VARCHAR(64) YES null +COLLATION_CONNECTION VARCHAR(64) YES null +DATABASE_COLLATION VARCHAR(64) YES null show columns from `TABLES`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_schema ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_type ¦ VARCHAR(14) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -engine ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -version ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -row_format ¦ VARCHAR(10) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_rows ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -avg_row_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -data_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -max_data_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -index_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -data_free ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -auto_increment ¦ BIGINT UNSIGNED(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -create_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -update_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -check_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_collation ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -checksum ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -create_options ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_comment ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +table_catalog VARCHAR(3) NO null +table_schema VARCHAR(5000) YES null +table_name VARCHAR(5000) YES null +table_type VARCHAR(14) YES null +engine VARCHAR(3) YES null +version BIGINT(0) YES null +row_format VARCHAR(10) NO null +table_rows BIGINT(0) YES null +avg_row_length BIGINT(0) YES null +data_length BIGINT(0) YES null +max_data_length BIGINT(0) YES null +index_length BIGINT(0) YES null +data_free BIGINT(0) YES null +auto_increment BIGINT UNSIGNED(0) YES null +create_time TIMESTAMP(0) YES null +update_time TIMESTAMP(0) YES null +check_time TIMESTAMP(0) YES null +table_collation VARCHAR(18) NO null +checksum BIGINT(0) YES null +create_options VARCHAR(256) YES null +table_comment TEXT(0) YES null show columns from `PARTITIONS`; -[unknown result because it is related to issue#16438] +Field Type Null Key Default Extra Comment +table_catalog VARCHAR(3) NO null +table_schema VARCHAR(5000) YES null +table_name VARCHAR(5000) YES null +partition_name VARCHAR(64) YES null +subpartition_name TEXT(4) YES null +partition_ordinal_position SMALLINT UNSIGNED(16) YES null +subpartition_ordinal_position TEXT(4) YES null +partition_method VARCHAR(13) YES null +subpartition_method TEXT(4) YES null +partition_expression VARCHAR(2048) YES null +subpartition_expression TEXT(4) YES null +partition_description TEXT(0) YES null +table_rows BIGINT(0) YES null +avg_row_length BIGINT(0) NO null +data_length BIGINT(0) YES null +max_data_length BIGINT(0) NO null +index_length BIGINT(0) NO null +data_free BIGINT(0) NO null +create_time TIMESTAMP(0) YES null +update_time TEXT(4) YES null +check_time TEXT(4) YES null +checksum TEXT(4) YES null +partition_comment VARCHAR(2048) NO null +nodegroup VARCHAR(7) NO null +tablespace_name TEXT(4) YES null use mo_catalog; show columns from `mo_data_key`; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -account_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 -key_id ¦ UUID(0) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 -encrypted_key ¦ VARCHAR(128) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -create_time ¦ TIMESTAMP(0) ¦ NO ¦ ¦ current_timestamp() ¦ ¦ 𝄀 -update_time ¦ TIMESTAMP(0) ¦ NO ¦ ¦ current_timestamp() ¦ ¦ +Field Type Null Key Default Extra Comment +account_id BIGINT UNSIGNED(64) NO PRI null +key_id UUID(0) NO PRI null +encrypted_key VARCHAR(128) YES null +create_time TIMESTAMP(0) NO current_timestamp() +update_time TIMESTAMP(0) NO current_timestamp() drop database if exists test; create database test; use test; drop table if exists t2; create table t2(b int, a int); desc t2; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -b ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -a ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +b INT(32) YES null +a INT(32) YES null drop table t2; drop database test; diff --git a/test/distributed/cases/foreign_key/fk_base.result b/test/distributed/cases/foreign_key/fk_base.result index 8c38e8f4a8101..c7c4b0b2b6b88 100644 --- a/test/distributed/cases/foreign_key/fk_base.result +++ b/test/distributed/cases/foreign_key/fk_base.result @@ -8,9 +8,9 @@ create table c1 (a int, b int, foreign key f_a(a) references f2(aa)); internal error: type of reference column 'aa' is not match for column 'a' create table c1 (a int, b int, foreign key f_a(a) references f1(a)); select * from f1; -➤ b[4,32,0] ¦ a[4,32,0] +a b select * from c1; -➤ a[4,32,0] ¦ b[4,32,0] +a b drop table f1; internal error: can not drop table 'f1' referenced by some foreign key constraint truncate f1; @@ -32,18 +32,18 @@ create table c1 (a int, b int, foreign key f_a(a) references f1(a) on delete set insert into c1 values (1,1), (2,2), (3,3); delete from f1 where a > 1; select * from c1; -➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -1 ¦ 1 𝄀 -null ¦ 2 𝄀 -null ¦ 3 +a b +1 1 +NULL 2 +NULL 3 drop table c1; insert into f1 values (2,2), (3,3); create table c1 (a int, b int, foreign key f_a(a) references f1(a) on delete cascade); insert into c1 values (1,1), (2,2), (3,3); delete from f1 where a > 1; select * from c1; -➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -1 ¦ 1 +a b +1 1 drop table c1; drop table f1; create table f1(a int primary key, b int unique key); @@ -56,25 +56,25 @@ update c1 set a = 11 where b = 1; Cannot add or update a child row: a foreign key constraint fails update c1 set a = null where b = 1; select * from c1 order by b; -➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -null ¦ 1 𝄀 -2 ¦ 2 𝄀 -3 ¦ 3 +a b +NULL 1 +2 2 +3 3 update c1 set a = 3 where b = 2; select * from c1 order by b; -➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -null ¦ 1 𝄀 -3 ¦ 2 𝄀 -3 ¦ 3 +a b +NULL 1 +3 2 +3 3 drop table c1; create table c1 (a int, b int, foreign key f_a(a) references f1(a) on update set null); insert into c1 values (1,1), (2,2), (3,3); update f1 set a=11 where a=1; select * from c1 order by b; -➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -null ¦ 1 𝄀 -2 ¦ 2 𝄀 -3 ¦ 3 +a b +NULL 1 +2 2 +3 3 drop table c1; drop table f1; create table f1(a int primary key, b int unique key); @@ -85,10 +85,10 @@ update f1 set a=0 where b>1; Duplicate entry '0' for key 'a' update f1 set a=0 where b=1; select * from c1 order by b; -➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -0 ¦ 1 𝄀 -2 ¦ 2 𝄀 -3 ¦ 3 +a b +0 1 +2 2 +3 3 drop table c1; drop table f1; drop table if exists t_dept; @@ -127,21 +127,21 @@ update t_emp set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp set deptId = null where salary < 1500; select * from t_emp order by salary; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 -7521 ¦ WARD ¦ null ¦ 1250.0 𝄀 -1234 ¦ MEIXI ¦ null ¦ 1250.0 𝄀 -7369 ¦ SMITH ¦ null ¦ 1300.0 𝄀 -7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 -7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 -7782 ¦ CLARK ¦ 10 ¦ 2950.0 𝄀 -7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 -7788 ¦ SCOTT ¦ 20 ¦ 3500.0 +id name deptid salary +7521 WARD null 1250.0 +1234 MEIXI null 1250.0 +7369 SMITH null 1300.0 +7499 ALLEN 30 1600.0 +7698 BLAKE 30 2850.0 +7782 CLARK 10 2950.0 +7566 JONES 20 3475.0 +7788 SCOTT 20 3500.0 select * from t_dept; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 -10 ¦ ACCOUNTING ¦ NEW YORK 𝄀 -20 ¦ RESEARCH ¦ DALLAS 𝄀 -30 ¦ SALES ¦ CHICAGO 𝄀 -40 ¦ OPERATIONS ¦ BOSTON +id name location +10 ACCOUNTING NEW YORK +20 RESEARCH DALLAS +30 SALES CHICAGO +40 OPERATIONS BOSTON drop table t_emp; drop table t_dept; drop table if exists t_dept1; @@ -174,36 +174,36 @@ INSERT INTO t_emp1 VALUES (7782,'CLARK',10,2950.00); INSERT INTO t_emp1 VALUES (7788,'SCOTT',20,3500.00); update t_dept1 set id = 50 where name = 'ACCOUNTING'; select * from t_dept1; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 -20 ¦ RESEARCH ¦ DALLAS 𝄀 -30 ¦ SALES ¦ CHICAGO 𝄀 -40 ¦ OPERATIONS ¦ BOSTON 𝄀 -50 ¦ ACCOUNTING ¦ NEW YORK +id name location +20 RESEARCH DALLAS +30 SALES CHICAGO +40 OPERATIONS BOSTON +50 ACCOUNTING NEW YORK select * from t_emp1; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 -7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 -7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 -7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 -7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 -1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 -7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 -7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 -7782 ¦ CLARK ¦ 50 ¦ 2950.0 +id name deptid salary +7369 SMITH 20 1300.0 +7499 ALLEN 30 1600.0 +7521 WARD 30 1250.0 +7566 JONES 20 3475.0 +1234 MEIXI 30 1250.0 +7698 BLAKE 30 2850.0 +7788 SCOTT 20 3500.0 +7782 CLARK 50 2950.0 delete from t_dept1 where name = 'ACCOUNTING'; select * from t_dept1; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 -20 ¦ RESEARCH ¦ DALLAS 𝄀 -30 ¦ SALES ¦ CHICAGO 𝄀 -40 ¦ OPERATIONS ¦ BOSTON +id name location +20 RESEARCH DALLAS +30 SALES CHICAGO +40 OPERATIONS BOSTON select * from t_emp1; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 -7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 -7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 -7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 -7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 -1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 -7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 -7788 ¦ SCOTT ¦ 20 ¦ 3500.0 +id name deptid salary +7369 SMITH 20 1300.0 +7499 ALLEN 30 1600.0 +7521 WARD 30 1250.0 +7566 JONES 20 3475.0 +1234 MEIXI 30 1250.0 +7698 BLAKE 30 2850.0 +7788 SCOTT 20 3500.0 update t_emp1 set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp1 set deptId = null where salary < 1500; @@ -239,37 +239,37 @@ INSERT INTO t_emp2 VALUES (7782,'CLARK',10,2950.00); INSERT INTO t_emp2 VALUES (7788,'SCOTT',20,3500.00); update t_dept2 set id = 50 where name = 'ACCOUNTING'; select * from t_dept2; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 -20 ¦ RESEARCH ¦ DALLAS 𝄀 -30 ¦ SALES ¦ CHICAGO 𝄀 -40 ¦ OPERATIONS ¦ BOSTON 𝄀 -50 ¦ ACCOUNTING ¦ NEW YORK +id name location +20 RESEARCH DALLAS +30 SALES CHICAGO +40 OPERATIONS BOSTON +50 ACCOUNTING NEW YORK select * from t_emp2; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 -7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 -7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 -7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 -7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 -1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 -7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 -7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 -7782 ¦ CLARK ¦ null ¦ 2950.0 +id name deptid salary +7369 SMITH 20 1300.0 +7499 ALLEN 30 1600.0 +7521 WARD 30 1250.0 +7566 JONES 20 3475.0 +1234 MEIXI 30 1250.0 +7698 BLAKE 30 2850.0 +7788 SCOTT 20 3500.0 +7782 CLARK null 2950.0 delete from t_dept2 where name = 'ACCOUNTING'; select * from t_dept2; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 -20 ¦ RESEARCH ¦ DALLAS 𝄀 -30 ¦ SALES ¦ CHICAGO 𝄀 -40 ¦ OPERATIONS ¦ BOSTON +id name location +20 RESEARCH DALLAS +30 SALES CHICAGO +40 OPERATIONS BOSTON select * from t_emp2; -➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 -7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 -7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 -7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 -7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 -1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 -7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 -7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 -7782 ¦ CLARK ¦ null ¦ 2950.0 +id name deptid salary +7369 SMITH 20 1300.0 +7499 ALLEN 30 1600.0 +7521 WARD 30 1250.0 +7566 JONES 20 3475.0 +1234 MEIXI 30 1250.0 +7698 BLAKE 30 2850.0 +7788 SCOTT 20 3500.0 +7782 CLARK null 2950.0 update t_emp2 set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp2 set deptId = null where salary < 1500; @@ -287,10 +287,10 @@ update c1 set aaa=4, bbb=22 where bbb=11; Cannot add or update a child row: a foreign key constraint fails update c1 set aaa=2, bbb=33 where bbb=11; select * from c1 order by bbb; -➤ aaa[4,32,0] ¦ bbb[4,32,0] 𝄀 -2 ¦ 22 𝄀 -3 ¦ 33 𝄀 -2 ¦ 33 +aaa bbbb +2 22 +3 33 +2 33 drop table c1; drop table f2; drop table f1; @@ -313,7 +313,7 @@ insert into c1 values(2,2,1,1); Duplicate entry '2' for key 'b' drop table c1; drop table f1; -create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b), unique key(a), unique key(b)); +create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b)); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1,col2) REFERENCES fk_01(a,b) on delete RESTRICT on update RESTRICT); create table fk_03(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1) REFERENCES fk_01(a) on delete RESTRICT on update RESTRICT); create table fk_04(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(b) on delete RESTRICT on update RESTRICT); @@ -321,7 +321,7 @@ drop table fk_04; drop table fk_03; drop table fk_02; drop table fk_01; -create table f1(a int, b int, primary key (a,b), unique key(a)); +create table f1(a int, b int, primary key (a,b)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`) REFERENCES `f1`(`a`)); insert into f1 values (1,1); insert into c1 values (1,1,1); @@ -343,31 +343,6 @@ update f1 set a=a, b=2; Cannot delete or update a parent row: a foreign key constraint fails drop table c1; drop table f1; -create table fk_exact_key_parent ( -a int, -b int, -c int, -primary key (a, b), -unique key uk_b_c (b, c) -); -create table fk_invalid_pk_prefix (a int, constraint fk_invalid_pk_prefix foreign key (a) references fk_exact_key_parent(a)); --- @regex("failed to add the foreign key constraint", true) -internal error: failed to add the foreign key constraint -create table fk_invalid_unique_prefix (b int, constraint fk_invalid_unique_prefix foreign key (b) references fk_exact_key_parent(b)); --- @regex("failed to add the foreign key constraint", true) -internal error: failed to add the foreign key constraint -create table fk_invalid_key_order (a int, b int, constraint fk_invalid_key_order foreign key (a,b) references fk_exact_key_parent(b,a)); --- @regex("failed to add the foreign key constraint", true) -internal error: failed to add the foreign key constraint -create table fk_invalid_mixed_key (a int, c int, constraint fk_invalid_mixed_key foreign key (a,c) references fk_exact_key_parent(a,c)); --- @regex("failed to add the foreign key constraint", true) -internal error: failed to add the foreign key constraint -create table fk_invalid_alter_child (a int, b int); -alter table fk_invalid_alter_child add constraint fk_invalid_alter_prefix foreign key (a) references fk_exact_key_parent(a); --- @regex("failed to add the foreign key constraint", true) -internal error: failed to add the foreign key constraint -drop table fk_invalid_alter_child; -drop table fk_exact_key_parent; drop database if exists db1; create database db1; use db1; @@ -379,7 +354,7 @@ drop database db1; create database db1; use db1; show tables; -➤ Tables_in_db1[12,-1,0] +Tables_in_db1 drop database db1; create account acc1 ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database db2; @@ -392,7 +367,7 @@ drop database db2; create database db2; use db2; show tables; -➤ Tables_in_db2[12,-1,0] +Tables_in_db2 drop database db2; drop account if exists acc1; drop database if exists db1; diff --git a/test/distributed/cases/foreign_key/fk_base.sql b/test/distributed/cases/foreign_key/fk_base.sql index 8f30049e521a6..9869a88659ef0 100644 --- a/test/distributed/cases/foreign_key/fk_base.sql +++ b/test/distributed/cases/foreign_key/fk_base.sql @@ -230,7 +230,7 @@ insert into c1 values(2,2,1,1); drop table c1; drop table f1; -create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b), unique key(a), unique key(b)); +create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b)); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1,col2) REFERENCES fk_01(a,b) on delete RESTRICT on update RESTRICT); create table fk_03(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1) REFERENCES fk_01(a) on delete RESTRICT on update RESTRICT); create table fk_04(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(b) on delete RESTRICT on update RESTRICT); @@ -239,7 +239,7 @@ drop table fk_03; drop table fk_02; drop table fk_01; -create table f1(a int, b int, primary key (a,b), unique key(a)); +create table f1(a int, b int, primary key (a,b)); create table c1(id int primary key, aa int, bb int, CONSTRAINT `fk_aa` FOREIGN KEY(`aa`) REFERENCES `f1`(`a`)); insert into f1 values (1,1); insert into c1 values (1,1,1); @@ -261,28 +261,6 @@ update f1 set a=a, b=2; drop table c1; drop table f1; --- The referenced columns must match one complete PRIMARY or UNIQUE key, in order. -create table fk_exact_key_parent ( - a int, - b int, - c int, - primary key (a, b), - unique key uk_b_c (b, c) -); --- @regex("failed to add the foreign key constraint",true) -create table fk_invalid_pk_prefix (a int, constraint fk_invalid_pk_prefix foreign key (a) references fk_exact_key_parent(a)); --- @regex("failed to add the foreign key constraint",true) -create table fk_invalid_unique_prefix (b int, constraint fk_invalid_unique_prefix foreign key (b) references fk_exact_key_parent(b)); --- @regex("failed to add the foreign key constraint",true) -create table fk_invalid_key_order (a int, b int, constraint fk_invalid_key_order foreign key (a,b) references fk_exact_key_parent(b,a)); --- @regex("failed to add the foreign key constraint",true) -create table fk_invalid_mixed_key (a int, c int, constraint fk_invalid_mixed_key foreign key (a,c) references fk_exact_key_parent(a,c)); -create table fk_invalid_alter_child (a int, b int); --- @regex("failed to add the foreign key constraint",true) -alter table fk_invalid_alter_child add constraint fk_invalid_alter_prefix foreign key (a) references fk_exact_key_parent(a); -drop table fk_invalid_alter_child; -drop table fk_exact_key_parent; - drop database if exists db1; create database db1; use db1; @@ -321,4 +299,4 @@ create table t2(a int primary key, b int); alter table t2 add constraint fk_t2_t1 foreign key(b) references t1(a), add constraint fk_t2_t1 foreign key(b) references t1(a); alter table t2 add constraint fk_t2_t1 foreign key(b) references t1(a); alter table t2 add constraint fk_t2_t1 foreign key(b) references t1(a); -drop database db1; +drop database db1; \ No newline at end of file diff --git a/test/distributed/cases/foreign_key/foreign_key.result b/test/distributed/cases/foreign_key/foreign_key.result index c9f468a156eec..8de680e2665fd 100644 --- a/test/distributed/cases/foreign_key/foreign_key.result +++ b/test/distributed/cases/foreign_key/foreign_key.result @@ -1,26 +1,21 @@ create table fk_01(col1 varchar(30) not null primary key,col2 int); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(col1)); show create table fk_02; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -fk_02 ¦ CREATE TABLE `fk_02` ( - `col1` int DEFAULT NULL, - `col2` varchar(25) DEFAULT NULL, - `col3` tinyint DEFAULT NULL, - CONSTRAINT `ck` FOREIGN KEY (`col2`) REFERENCES `fk_01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +fk_02 CREATE TABLE `fk_02` (\n `col1` int DEFAULT NULL,\n `col2` varchar(25) DEFAULT NULL,\n `col3` tinyint DEFAULT NULL,\n CONSTRAINT `ck` FOREIGN KEY (`col2`) REFERENCES `fk_01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_01 values ('90',5983),('100',734),('190',50); insert into fk_02(col2,col3) values ('90',5),('90',4),('100',0),(NULL,80); select * from fk_01; -➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 -90 ¦ 5983 𝄀 -100 ¦ 734 𝄀 -190 ¦ 50 +col1 col2 +90 5983 +100 734 +190 50 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -null ¦ 90 ¦ 5 𝄀 -null ¦ 90 ¦ 4 𝄀 -null ¦ 100 ¦ 0 𝄀 -null ¦ null ¦ 80 +col1 col2 col3 +null 90 5 +null 90 4 +null 100 0 +null null 80 insert into fk_02(col2,col3) values ('200',5); internal error: Cannot add or update a child row: a foreign key constraint fails update fk_02 set col2='80' where col2='90'; @@ -31,26 +26,26 @@ delete from fk_01 where col1='90'; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_01 where col1='190'; select * from fk_01; -➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 -90 ¦ 5983 𝄀 -100 ¦ 734 +col1 col2 +90 5983 +100 734 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -null ¦ 90 ¦ 5 𝄀 -null ¦ 90 ¦ 4 𝄀 -null ¦ 100 ¦ 0 𝄀 -null ¦ null ¦ 80 +col1 col2 col3 +null 90 5 +null 90 4 +null 100 0 +null null 80 update fk_01 set col2=500 where col2=734; delete from fk_02 where col2='100'; select * from fk_01; -➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 -90 ¦ 5983 𝄀 -100 ¦ 500 +col1 col2 +90 5983 +100 500 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -null ¦ 90 ¦ 5 𝄀 -null ¦ 90 ¦ 4 𝄀 -null ¦ null ¦ 80 +col1 col2 col3 +null 90 5 +null 90 4 +null null 80 drop table fk_02; drop table fk_01; create table fk_01(col1 char(30) primary key,col2 int); @@ -62,15 +57,15 @@ insert into fk_02(col2,col3) values ('90',5),('90',4),('100',0); truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint select * from fk_01; -➤ col1[1,30,0] ¦ col2[4,32,0] 𝄀 -90 ¦ 5983 𝄀 -100 ¦ 734 𝄀 -190 ¦ 50 +col1 col2 +90 5983 +100 734 +190 50 select * from fk_02; -➤ col1[4,32,0] ¦ col2[1,25,0] ¦ col3[-6,8,0] 𝄀 -null ¦ 90 ¦ 5 𝄀 -null ¦ 90 ¦ 4 𝄀 -null ¦ 100 ¦ 0 +col1 col2 col3 +null 90 5 +null 90 4 +null 100 0 drop table fk_02; drop table fk_01; create table fk_01(col1 int auto_increment primary key,col2 varchar(25),col3 tinyint); @@ -83,38 +78,38 @@ insert into fk_01 values (2,'yellow',20),(10,'apple',50),(11,'opppo',51); insert into fk_02 values(2,'score',1),(2,'student',4),(10,'goods',2); insert into fk_02 values(NULL,NULL,NULL); select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ yellow ¦ 20 𝄀 -10 ¦ apple ¦ 50 𝄀 -11 ¦ opppo ¦ 51 +col1 col2 col3 +2 yellow 20 +10 apple 50 +11 opppo 51 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ score ¦ 1 𝄀 -2 ¦ student ¦ 4 𝄀 -10 ¦ goods ¦ 2 𝄀 -null ¦ null ¦ null +col1 col2 col3 +2 score 1 +2 student 4 +10 goods 2 +null null null update fk_02 set col1=10 where col3=4; select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ score ¦ 1 𝄀 -10 ¦ goods ¦ 2 𝄀 -null ¦ null ¦ null 𝄀 -10 ¦ student ¦ 4 +col1 col2 col3 +2 score 1 +10 goods 2 +null null null +10 student 4 update fk_02 set col1=20 where col3=4; Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(15,'ssss',10); internal error: Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=11; select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ yellow ¦ 20 𝄀 -10 ¦ apple ¦ 50 +col1 col2 col3 +2 yellow 20 +10 apple 50 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ score ¦ 1 𝄀 -10 ¦ goods ¦ 2 𝄀 -null ¦ null ¦ null 𝄀 -10 ¦ student ¦ 4 +col1 col2 col3 +2 score 1 +10 goods 2 +null null null +10 student 4 update fk_01 set col3=110 where col1=10; delete from fk_01 where col1=2; internal error: Cannot delete or update a parent row: a foreign key constraint fails @@ -122,7 +117,7 @@ truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint truncate table fk_02; select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] +col1 col2 col3 drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -134,15 +129,15 @@ insert into fk_02 values(2,'apple',1),(2,'apple',4),(1,'opppo',2); insert into fk_02 values(20,'score',1),(12,'apple',4),(1,'yellow',2); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 𝄀 -1 ¦ opppo ¦ 51 +col1 col2 col3 +2 yellow 20 +2 apple 50 +1 opppo 51 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ apple ¦ 1 𝄀 -2 ¦ apple ¦ 4 𝄀 -1 ¦ opppo ¦ 2 +col1 col2 col3 +2 apple 1 +2 apple 4 +1 opppo 2 update fk_02 set col1=3 where col1=2; Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=2 and col2='apple'; @@ -152,25 +147,25 @@ Cannot delete or update a parent row: a foreign key constraint fails update fk_01 set col1=1 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 𝄀 -1 ¦ opppo ¦ 51 +col1 col2 col3 +2 yellow 20 +2 apple 50 +1 opppo 51 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ apple ¦ 1 𝄀 -2 ¦ apple ¦ 4 𝄀 -1 ¦ opppo ¦ 2 +col1 col2 col3 +2 apple 1 +2 apple 4 +1 opppo 2 delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_02; select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 𝄀 -1 ¦ opppo ¦ 51 +col1 col2 col3 +2 yellow 20 +2 apple 50 +1 opppo 51 select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] +col1 col2 col3 drop table fk_02; drop table fk_01; create table fk_01(col1 bigint primary key,col2 varchar(25),col3 tinyint); @@ -182,35 +177,35 @@ insert into fk_02 values(4,'age',3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(1,'score',1),(2,'student',NULL); select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -1 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 +col1 col2 col3 +1 yellow 20 +2 apple 50 select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -1 ¦ score ¦ 1 𝄀 -2 ¦ student ¦ null +col1 col2 col3 +1 score 1 +2 student null update fk_02 set col3=4 where col3=1; select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -1 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 +col1 col2 col3 +1 yellow 20 +2 apple 50 delete from fk_01 where col1=1; select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ student ¦ null +col1 col2 col3 +2 student null update fk_01 set col1=5 where col2='apple'; select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -5 ¦ apple ¦ 50 +col1 col2 col3 +5 apple 50 select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -5 ¦ student ¦ null +col1 col2 col3 +5 student null delete from fk_02 where col1=5; select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] +col1 col2 col3 select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -5 ¦ apple ¦ 50 +col1 col2 col3 +5 apple 50 drop table fk_02; drop table fk_01; create table fk_01(col1 decimal(38,18),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); @@ -222,35 +217,35 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-02 +col1 col2 col3 col4 +23.100000000000000000 a 20 2022-10-01 +23.100000000000000000 a 21 2022-10-01 +23.100000000000000000 a 20 2022-10-02 select * from fk_02; -➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-02 +col1 col2 col3 col4 +23.100000000000000000 a 20 2022-10-01 +23.100000000000000000 a 21 2022-10-01 +23.100000000000000000 a 20 2022-10-02 update fk_02 set col3=19 where col3=20; Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col3=20; select * from fk_01; -➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 +col1 col2 col3 col4 +23.100000000000000000 a 21 2022-10-01 select * from fk_02; -➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -null ¦ a ¦ null ¦ null 𝄀 -null ¦ a ¦ null ¦ null +col1 col2 col3 col4 +23.100000000000000000 a 21 2022-10-01 +null a null null +null a null null update fk_01 set col3=19 where col2='a'; select * from fk_01; -➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100000000000000000 ¦ a ¦ 19 ¦ 2022-10-01 +col1 col2 col3 col4 +23.100000000000000000 a 19 2022-10-01 select * from fk_02; -➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -null ¦ a ¦ null ¦ null 𝄀 -null ¦ a ¦ null ¦ null 𝄀 -null ¦ a ¦ null ¦ null +col1 col2 col3 col4 +null a null null +null a null null +null a null null drop table fk_02; drop table fk_01; create table fk_01(col1 int primary key auto_increment,col2 varchar(25),col3 varchar(50)); @@ -264,39 +259,39 @@ Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -1 ¦ non-failing ¦ deli 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong +col1 col2 col3 +1 non-failing deli +2 safer prow +3 ultra strong select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 𝄀 -2 ¦ cc ¦ dd ¦ 1 𝄀 -3 ¦ ee ¦ ff ¦ 1 +col1 col2 col3 col4 +1 aa bb 2 +2 cc dd 1 +3 ee ff 1 delete from fk_02 where col4=1; delete from fk_01 where col1=1; select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong +col1 col2 col3 +2 safer prow +3 ultra strong select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 +col1 col2 col3 col4 +1 aa bb 2 update fk_01 set col1=8 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong +col1 col2 col3 +2 safer prow +3 ultra strong select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 +col1 col2 col3 col4 +1 aa bb 2 truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong +col1 col2 col3 +2 safer prow +3 ultra strong drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -307,71 +302,71 @@ insert into fk_01(col2,col3) values ('non-failing','deli'),('safer','prow'),('ul insert into fk_02(col2,col3,col4) values('aa','bb',2),('cc','dd',1),('ee','ff',1); insert into fk_02(col2,col3,col4) values('aa','bb',3); select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -1 ¦ non-failing ¦ deli 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong 𝄀 -4 ¦ aaa ¦ bbb -select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 𝄀 -2 ¦ cc ¦ dd ¦ 1 𝄀 -3 ¦ ee ¦ ff ¦ 1 𝄀 -4 ¦ aa ¦ bb ¦ 3 +col1 col2 col3 +1 non-failing deli +2 safer prow +3 ultra strong +4 aaa bbb +select * from fk_02; +col1 col2 col3 col4 +1 aa bb 2 +2 cc dd 1 +3 ee ff 1 +4 aa bb 3 delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_02 where col4=1; select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 𝄀 -4 ¦ aa ¦ bb ¦ 3 +col1 col2 col3 col4 +1 aa bb 2 +4 aa bb 3 select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -1 ¦ non-failing ¦ deli 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong 𝄀 -4 ¦ aaa ¦ bbb +col1 col2 col3 +1 non-failing deli +2 safer prow +3 ultra strong +4 aaa bbb update fk_01 set col1=8 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails update fk_02 set col4=5 where col3='ff'; select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -1 ¦ non-failing ¦ deli 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong 𝄀 -4 ¦ aaa ¦ bbb +col1 col2 col3 +1 non-failing deli +2 safer prow +3 ultra strong +4 aaa bbb select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 𝄀 -4 ¦ aa ¦ bb ¦ 3 +col1 col2 col3 col4 +1 aa bb 2 +4 aa bb 3 update fk_01 set col2='window' where col1=1; delete from fk_01 where col1=3; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong 𝄀 -4 ¦ aaa ¦ bbb 𝄀 -1 ¦ window ¦ deli +col1 col2 col3 +2 safer prow +3 ultra strong +4 aaa bbb +1 window deli select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 𝄀 -4 ¦ aa ¦ bb ¦ 3 +col1 col2 col3 col4 +1 aa bb 2 +4 aa bb 3 truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint insert into fk_01(col2,col3) values ('zhi','gao'),('er','li'); select * from fk_01 order by col1; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 -1 ¦ window ¦ deli 𝄀 -2 ¦ safer ¦ prow 𝄀 -3 ¦ ultra ¦ strong 𝄀 -4 ¦ aaa ¦ bbb 𝄀 -9 ¦ zhi ¦ gao 𝄀 -10 ¦ er ¦ li -select * from fk_02; -➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 -1 ¦ aa ¦ bb ¦ 2 𝄀 -4 ¦ aa ¦ bb ¦ 3 +col1 col2 col3 +1 window deli +2 safer prow +3 ultra strong +4 aaa bbb +9 zhi gao +10 er li +select * from fk_02; +col1 col2 col3 col4 +1 aa bb 2 +4 aa bb 3 drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -385,35 +380,35 @@ insert into fk_02 values(4,'age',3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(1,'score',1),(2,'student',NULL); select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -1 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 +col1 col2 col3 +1 yellow 20 +2 apple 50 select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -1 ¦ score ¦ 1 𝄀 -2 ¦ student ¦ null +col1 col2 col3 +1 score 1 +2 student null update fk_02 set col3=4 where col3=1; select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -1 ¦ yellow ¦ 20 𝄀 -2 ¦ apple ¦ 50 +col1 col2 col3 +1 yellow 20 +2 apple 50 delete from fk_01 where col1=1; select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -2 ¦ student ¦ null +col1 col2 col3 +2 student null update fk_01 set col1=5 where col2='apple'; select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -5 ¦ apple ¦ 50 +col1 col2 col3 +5 apple 50 select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -5 ¦ student ¦ null +col1 col2 col3 +5 student null delete from fk_02 where col1=5; select * from fk_02; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] +col1 col2 col3 select * from fk_01; -➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 -5 ¦ apple ¦ 50 +col1 col2 col3 +5 apple 50 drop table fk_02; drop table fk_01; create table fk_01(id int primary key auto_increment,title varchar(25)); @@ -428,34 +423,34 @@ update fk_03 set book_id=6 where book_id=2; Cannot add or update a child row: a foreign key constraint fails update fk_03 set book_id=3 where book_id=2; select * from fk_03; -➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 -1 ¦ 1 ¦ 2 𝄀 -3 ¦ 3 ¦ 1 𝄀 -2 ¦ 3 ¦ 2 +id book_id author_id +1 1 2 +3 3 1 +2 3 2 update fk_01 set id=5 where title='self'; select * from fk_03; -➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 -3 ¦ 3 ¦ 1 𝄀 -2 ¦ 3 ¦ 2 𝄀 -1 ¦ 5 ¦ 2 -select * from fk_01; -➤ id[4,32,0] ¦ title[12,-1,0] 𝄀 -2 ¦ method 𝄀 -3 ¦ console 𝄀 -5 ¦ self +id book_id author_id +3 3 1 +2 3 2 +1 5 2 +select * from fk_01; +id title +2 method +3 console +5 self delete from fk_02 where id=1; select * from fk_02; -➤ id[4,32,0] ¦ name[12,-1,0] 𝄀 -2 ¦ wulan +id name +2 wulan select * from fk_03; -➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 -2 ¦ 3 ¦ 2 𝄀 -1 ¦ 5 ¦ 2 +id book_id author_id +2 3 2 +1 5 2 delete from fk_03; drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint select * from fk_03; -➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] +id book_id author_id drop table fk_02; internal error: can not drop table 'fk_02' referenced by some foreign key constraint drop table fk_03; @@ -470,14 +465,14 @@ internal error: Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col3='2001-10-09 01:00:09'; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -➤ col1[4,32,0] ¦ col2[93,64,0] ¦ col3[93,64,0] 𝄀 -9 ¦ 2001-10-19 00:00:00 ¦ 2001-10-09 01:00:09 𝄀 -10 ¦ 2011-12-09 00:00:00 ¦ 2001-10-09 01:00:09 𝄀 -11 ¦ 2011-12-09 00:00:00 ¦ 2001-10-09 01:00:09 +col1 col2 col3 +9 2001-10-19 00:00:00 2001-10-09 01:00:09 +10 2011-12-09 00:00:00 2001-10-09 01:00:09 +11 2011-12-09 00:00:00 2001-10-09 01:00:09 select * from fk_02; -➤ col1[4,32,0] ¦ col2[93,64,0] ¦ col3[1,25,0] ¦ col4[93,64,0] 𝄀 -9 ¦ 2001-10-19 00:00:00 ¦ left ¦ 2001-10-09 01:00:09 𝄀 -11 ¦ 2011-12-09 00:00:00 ¦ right ¦ 2001-10-09 01:00:09 +col1 col2 col3 col4 +9 2001-10-19 00:00:00 left 2001-10-09 01:00:09 +11 2011-12-09 00:00:00 right 2001-10-09 01:00:09 drop table fk_02; drop table fk_01; create table fk_an_01(col1 int,col2 varchar(25),col3 tinyint,primary key(col2)); @@ -492,23 +487,23 @@ create table f1 (fa int primary key); CREATE TABLE c1 (ca INT, cb INT); ALTER TABLE c1 ADD CONSTRAINT ffa FOREIGN KEY (ca) REFERENCES f1(fa); desc c1; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -ca ¦ INT(32) ¦ YES ¦ MUL ¦ null ¦ ¦ 𝄀 -cb ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +ca INT(32) YES MUL null +cb INT(32) YES null drop table if exists c1; drop table if exists f1; create table f1 (a int, b int, c int, d int, e int, primary key(a,b), unique key(c,d)); insert into f1 values (1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(2,1,2,1,1),(3,1,3,1,1),(4,1,4,1,1),(1,2,1,2,1); -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a)); insert into c1 values (1,1,1,1,1); insert into c1 values (2,5,1,1,1); internal error: Cannot add or update a child row: a foreign key constraint fails drop table c1; -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); -insert into c1 values (1,1,2,1,1); +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); +insert into c1 values (1,1,1,1,1); delete from f1 where a=1 and b=2; select * from c1; -➤ a[4,32,0] ¦ f_a[4,32,0] ¦ f_b[4,32,0] ¦ f_c[4,32,0] ¦ f_d[4,32,0] +a f_a f_b f_c f_d drop table c1; create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); drop table c1; @@ -516,7 +511,7 @@ create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constrai internal error: failed to add the foreign key constraint create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_c,f_d) REFERENCES f1(c,d)); create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); @@ -524,62 +519,60 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-02 -select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-02 -update fk_02 set col2='b' where col3=20; -select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ b ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ b ¦ 20 ¦ 2022-10-02 +col1 col2 col3 col4 +23.100 a 20 2022-10-01 +23.100 a 21 2022-10-01 +23.100 a 20 2022-10-02 +select * from fk_02; +col1 col2 col3 col4 +23.100 a 20 2022-10-01 +23.100 a 21 2022-10-01 +23.100 a 20 2022-10-02 +update fk_02 set col3=19 where col3=20; +select * from fk_02; +col1 col2 col3 col4 +23.100 a 21 2022-10-01 +23.100 a 19 2022-10-01 +23.100 a 19 2022-10-02 delete from fk_01 where col3=20; select * from fk_01; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 +col1 col2 col3 col4 +23.100 a 21 2022-10-01 select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -null ¦ b ¦ null ¦ null 𝄀 -null ¦ b ¦ null ¦ null +col1 col2 col3 col4 +null a 21 2022-10-01 +null a 19 2022-10-01 +null a 19 2022-10-02 drop table if exists c1; drop table if exists f1; create table f1(a int, b int, c int, primary key(a,b)); insert into f1 values (2,1,1), (2,2,2),(2,3,3); -create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a,c_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); +create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); insert into c1 values (1,2,1),(2,2,2),(3,2,3); update f1 set a=111 where b=1; select * from f1; -➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 -2 ¦ 2 ¦ 2 𝄀 -2 ¦ 3 ¦ 3 𝄀 -111 ¦ 1 ¦ 1 +a b c +2 2 2 +2 3 3 +111 1 1 select * from c1; -➤ a[4,32,0] ¦ c_a[4,32,0] ¦ c_b[4,32,0] 𝄀 -2 ¦ 2 ¦ 2 𝄀 -3 ¦ 2 ¦ 3 𝄀 -1 ¦ 111 ¦ 1 +a c_a c_b +1 111 1 +2 111 2 +3 111 3 delete from c1; -insert into c1 values (1,111,1),(2,2,2),(3,2,3); +insert into c1 values (1,2,1),(2,2,2),(3,2,3); delete from f1 where b=2; select * from f1; -➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 -2 ¦ 3 ¦ 3 𝄀 -111 ¦ 1 ¦ 1 +a b c +2 3 3 +111 1 1 select * from c1; -➤ a[4,32,0] ¦ c_a[4,32,0] ¦ c_b[4,32,0] 𝄀 -1 ¦ 111 ¦ 1 𝄀 -3 ¦ 2 ¦ 3 +a c_a c_b drop table if exists fk_02; drop table if exists fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); @@ -587,39 +580,39 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-02 -select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-02 -update fk_02 set col2='b' where col3=20; -select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ b ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ b ¦ 20 ¦ 2022-10-02 +col1 col2 col3 col4 +23.100 a 20 2022-10-01 +23.100 a 21 2022-10-01 +23.100 a 20 2022-10-02 +select * from fk_02; +col1 col2 col3 col4 +23.100 a 20 2022-10-01 +23.100 a 21 2022-10-01 +23.100 a 20 2022-10-02 +update fk_02 set col3=19 where col3=20; +select * from fk_02; +col1 col2 col3 col4 +23.100 a 21 2022-10-01 +23.100 a 19 2022-10-01 +23.100 a 19 2022-10-02 delete from fk_01 where col3=19; select * from fk_01; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ a ¦ 20 ¦ 2022-10-02 +col1 col2 col3 col4 +23.100 a 20 2022-10-01 +23.100 a 21 2022-10-01 +23.100 a 20 2022-10-02 select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -23.100 ¦ b ¦ 20 ¦ 2022-10-01 𝄀 -23.100 ¦ b ¦ 20 ¦ 2022-10-02 +col1 col2 col3 col4 +23.100 a 21 2022-10-01 +23.100 a 19 2022-10-01 +23.100 a 19 2022-10-02 drop table fk_02; drop table fk_01; -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key uk_col3(col3), unique key uk_col1_col3(col1,col3)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key(col3)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3) REFERENCES fk_01(col1,col3) on delete CASCADE on update CASCADE); -drop table fk_02; +internal error: failed to add the foreign key constraint drop table fk_01; -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2), unique key uk_col1(col1)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete CASCADE on update CASCADE); insert into fk_01 values(8.9,'a',20,'2022-10-01'),(6.0,'a',21,'2022-10-01'),(4.3,'c',20,'2022-10-02'); insert into fk_02 values(8.9,'a',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'),(6.0,'a',20,'2022-10-02'); @@ -627,38 +620,38 @@ insert into fk_02 values(8.9,'c',20,'2022-10-01'),(null,'a',21,'2022-10-01'); insert into fk_02 values(3.5,'e',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -4.300 ¦ c ¦ 20 ¦ 2022-10-02 -select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -8.900 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 -8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 -null ¦ a ¦ 21 ¦ 2022-10-01 +col1 col2 col3 col4 +8.900 a 20 2022-10-01 +6.000 a 21 2022-10-01 +4.300 c 20 2022-10-02 +select * from fk_02; +col1 col2 col3 col4 +8.900 a 20 2022-10-01 +8.900 a 21 2022-10-01 +6.000 a 20 2022-10-02 +8.900 c 20 2022-10-01 +null a 21 2022-10-01 update fk_02 set col1=6.0 where col3=21; select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 -8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 21 ¦ 2022-10-01 +col1 col2 col3 col4 +8.900 a 20 2022-10-01 +6.000 a 20 2022-10-02 +8.900 c 20 2022-10-01 +6.000 a 21 2022-10-01 +6.000 a 21 2022-10-01 update fk_01 set col2='d' where col1=6.0; select * from fk_01; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -4.300 ¦ c ¦ 20 ¦ 2022-10-02 𝄀 -6.000 ¦ d ¦ 21 ¦ 2022-10-01 -select * from fk_02; -➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 -8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 -8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 -6.000 ¦ a ¦ 21 ¦ 2022-10-01 +col1 col2 col3 col4 +8.900 a 20 2022-10-01 +4.300 c 20 2022-10-02 +6.000 d 21 2022-10-01 +select * from fk_02; +col1 col2 col3 col4 +8.900 a 20 2022-10-01 +6.000 a 20 2022-10-02 +8.900 c 20 2022-10-01 +6.000 a 21 2022-10-01 +6.000 a 21 2022-10-01 set autocommit=0; create table t1(a int primary key); insert into t1 values (1); diff --git a/test/distributed/cases/foreign_key/foreign_key.sql b/test/distributed/cases/foreign_key/foreign_key.sql index b3f333e5bddbd..2ee542f5f9245 100644 --- a/test/distributed/cases/foreign_key/foreign_key.sql +++ b/test/distributed/cases/foreign_key/foreign_key.sql @@ -251,12 +251,12 @@ drop table if exists c1; drop table if exists f1; create table f1 (a int, b int, c int, d int, e int, primary key(a,b), unique key(c,d)); insert into f1 values (1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(2,1,2,1,1),(3,1,3,1,1),(4,1,4,1,1),(1,2,1,2,1); -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a)); insert into c1 values (1,1,1,1,1); insert into c1 values (2,5,1,1,1); drop table c1; -create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); -insert into c1 values (1,1,2,1,1); +create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); +insert into c1 values (1,1,1,1,1); delete from f1 where a=1 and b=2; select * from c1; drop table c1; @@ -266,14 +266,14 @@ create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constrai create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_c,f_d) REFERENCES f1(c,d)); create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); select * from fk_01; select * from fk_02; -update fk_02 set col2='b' where col3=20; +update fk_02 set col3=19 where col3=20; select * from fk_02; delete from fk_01 where col3=20; select * from fk_01; @@ -283,13 +283,13 @@ drop table if exists c1; drop table if exists f1; create table f1(a int, b int, c int, primary key(a,b)); insert into f1 values (2,1,1), (2,2,2),(2,3,3); -create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a,c_b) REFERENCES f1(a,b) on delete CASCADE on update CASCADE); +create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign key(c_a) REFERENCES f1(a) on delete CASCADE on update CASCADE); insert into c1 values (1,2,1),(2,2,2),(3,2,3); update f1 set a=111 where b=1; select * from f1; select * from c1; delete from c1; -insert into c1 values (1,111,1),(2,2,2),(3,2,3); +insert into c1 values (1,2,1),(2,2,2),(3,2,3); delete from f1 where b=2; select * from f1; select * from c1; @@ -298,14 +298,14 @@ drop table if exists fk_02; drop table if exists fk_01; -- foreign key is one of pk,on delete /update SET NULL create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); -create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3,col4) REFERENCES fk_01(col1,col3,col4) on delete SET NULL on update SET NULL); +create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete SET NULL on update SET NULL); insert into fk_01 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(23.10,'a',21,'2022-10-01'),(23.10,'a',20,'2022-10-02'); insert into fk_02 values(23.10,'a',20,'2022-10-01'),(0.1,'b',22,'2022-10-01'),(23.10,'c',30,'2022-10-02'); insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); select * from fk_01; select * from fk_02; -update fk_02 set col2='b' where col3=20; +update fk_02 set col3=19 where col3=20; select * from fk_02; delete from fk_01 where col3=19; select * from fk_01; @@ -314,13 +314,12 @@ drop table fk_02; drop table fk_01; -- foreign key is one of pk and unique key,on delete /update CASCADE -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key uk_col3(col3), unique key uk_col1_col3(col1,col3)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key(col3)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1,col3) REFERENCES fk_01(col1,col3) on delete CASCADE on update CASCADE); -drop table fk_02; drop table fk_01; -- foreign key is one of unique key,on delete /update CASCADE -create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2), unique key uk_col1(col1)); +create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date, unique key(col1,col2)); create table fk_02(col1 decimal(38,3),col2 char(25),col3 int,col4 date,constraint ck foreign key(col1) REFERENCES fk_01(col1) on delete CASCADE on update CASCADE); insert into fk_01 values(8.9,'a',20,'2022-10-01'),(6.0,'a',21,'2022-10-01'),(4.3,'c',20,'2022-10-02'); insert into fk_02 values(8.9,'a',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'),(6.0,'a',20,'2022-10-02'); diff --git a/test/distributed/cases/foreign_key/update_modern_fk.result b/test/distributed/cases/foreign_key/update_modern_fk.result index 7e35d098006a3..410bf2f27a654 100644 --- a/test/distributed/cases/foreign_key/update_modern_fk.result +++ b/test/distributed/cases/foreign_key/update_modern_fk.result @@ -330,20 +330,20 @@ primary key (a, b) create table child_nonunique_prefix ( id int primary key, parent_a int, -parent_b int, -constraint fk_nonunique_prefix foreign key (parent_a, parent_b) -references parent_nonunique_prefix(a, b) on update cascade +constraint fk_nonunique_prefix foreign key (parent_a) +references parent_nonunique_prefix(a) on update cascade ); insert into parent_nonunique_prefix values (1, 1), (1, 2); -insert into child_nonunique_prefix values (10, 1, 1); +insert into child_nonunique_prefix values (10, 1); update parent_nonunique_prefix set a = b + 1 where a = 1; +not supported: parent foreign key action has an ambiguous non-unique referenced-key mapping select * from parent_nonunique_prefix order by a, b; ➤ a[4,32,0] ¦ b[4,32,0] 𝄀 -2 ¦ 1 𝄀 -3 ¦ 2 +1 ¦ 1 𝄀 +1 ¦ 2 select * from child_nonunique_prefix order by id; -➤ id[4,32,0] ¦ parent_a[4,32,0] ¦ parent_b[4,32,0] 𝄀 -10 ¦ 2 ¦ 1 +➤ id[4,32,0] ¦ parent_a[4,32,0] 𝄀 +10 ¦ 1 drop table child_nonunique_prefix; drop table parent_nonunique_prefix; drop table child_generated_unique; diff --git a/test/distributed/cases/foreign_key/update_modern_fk.sql b/test/distributed/cases/foreign_key/update_modern_fk.sql index 4a1ab9bd061d9..20c62363523c6 100644 --- a/test/distributed/cases/foreign_key/update_modern_fk.sql +++ b/test/distributed/cases/foreign_key/update_modern_fk.sql @@ -268,12 +268,11 @@ create table parent_nonunique_prefix ( create table child_nonunique_prefix ( id int primary key, parent_a int, - parent_b int, - constraint fk_nonunique_prefix foreign key (parent_a, parent_b) - references parent_nonunique_prefix(a, b) on update cascade + constraint fk_nonunique_prefix foreign key (parent_a) + references parent_nonunique_prefix(a) on update cascade ); insert into parent_nonunique_prefix values (1, 1), (1, 2); -insert into child_nonunique_prefix values (10, 1, 1); +insert into child_nonunique_prefix values (10, 1); update parent_nonunique_prefix set a = b + 1 where a = 1; select * from parent_nonunique_prefix order by a, b; select * from child_nonunique_prefix order by id; diff --git a/test/distributed/cases/git4data/clone/clone_fk_after_alter.result b/test/distributed/cases/git4data/clone/clone_fk_after_alter.result index 8598f192443e3..247f29fc460ae 100644 --- a/test/distributed/cases/git4data/clone/clone_fk_after_alter.result +++ b/test/distributed/cases/git4data/clone/clone_fk_after_alter.result @@ -25,31 +25,25 @@ select table_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_alter_child_src' order by constraint_name; -➤ table_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 -child ¦ parent +table_name refer_table_name +child parent delete from fk_clone_alter_child_src.parent where id = 1; internal error: Cannot delete or update a parent row: a foreign key constraint fails create database fk_clone_alter_child_dst clone fk_clone_alter_child_src; select * from fk_clone_alter_child_dst.child order by id; -➤ id[4,32,0] ¦ parent_id[4,32,0] ¦ payload[12,-1,0] 𝄀 -10 ¦ 1 ¦ c1 𝄀 -20 ¦ 2 ¦ c2 +id parent_id payload +10 1 c1 +20 2 c2 show create table fk_clone_alter_child_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `payload` varchar(64) DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_child_parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` varchar(64) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_child_parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) delete from fk_clone_alter_child_dst.parent where id = 1; internal error: Cannot delete or update a parent row: a foreign key constraint fails insert into fk_clone_alter_child_dst.child values (30, 999, 'invalid'); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_clone_alter_child_dst.child values (30, 1, 'valid'); select count(*) from fk_clone_alter_child_dst.child; -➤ count(*)[-5,64,0] 𝄀 +count(*) 3 drop database fk_clone_alter_child_dst; drop database fk_clone_alter_child_src; @@ -74,27 +68,15 @@ alter table fk_clone_alter_both_src.parent modify column description varchar(128 alter table fk_clone_alter_both_src.child add column created_at datetime; create database fk_clone_alter_both_dst clone fk_clone_alter_both_src; show create table fk_clone_alter_both_dst.parent; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -parent ¦ CREATE TABLE `parent` ( - `id` int NOT NULL, - `code` varchar(16) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `code` (`code`) -) +Table Create Table +parent CREATE TABLE `parent` (\n `id` int NOT NULL,\n `code` varchar(16) DEFAULT NULL,\n `description` varchar(128) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `code` (`code`)\n) show create table fk_clone_alter_both_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_both` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `created_at` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_both` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_alter_both_dst.child(id, parent_id) values (2, 404); internal error: Cannot add or update a child row: a foreign key constraint fails select count(*) from fk_clone_alter_both_dst.child; -➤ count(*)[-5,64,0] 𝄀 +count(*) 1 drop database fk_clone_alter_both_dst; drop database fk_clone_alter_both_src; @@ -120,24 +102,11 @@ alter table fk_clone_siblings_src.child_b add column b1 int default 2; alter table fk_clone_siblings_src.child_a add column a2 int default 3; create database fk_clone_siblings_dst clone fk_clone_siblings_src; show create table fk_clone_siblings_dst.child_a; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child_a ¦ CREATE TABLE `child_a` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `a1` int DEFAULT 1, - `a2` int DEFAULT 3, - PRIMARY KEY (`id`), - CONSTRAINT `fk_sibling_a` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child_a CREATE TABLE `child_a` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `a1` int DEFAULT 1,\n `a2` int DEFAULT 3,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_sibling_a` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) show create table fk_clone_siblings_dst.child_b; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child_b ¦ CREATE TABLE `child_b` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `b1` int DEFAULT 2, - PRIMARY KEY (`id`), - CONSTRAINT `fk_sibling_b` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child_b CREATE TABLE `child_b` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `b1` int DEFAULT 2,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_sibling_b` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_siblings_dst.child_a values (1, 100, 1, 3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_clone_siblings_dst.child_b values (1, 100, 2); @@ -172,8 +141,8 @@ select leaf.id, middle.id, root.id from fk_clone_chain_dst.leaf leaf join fk_clone_chain_dst.middle middle on leaf.middle_id = middle.id join fk_clone_chain_dst.root root on middle.root_id = root.id; -➤ id[4,32,0] ¦ id[4,32,0] ¦ id[4,32,0] 𝄀 -1 ¦ 1 ¦ 1 +id id id +1 1 1 insert into fk_clone_chain_dst.leaf(id, middle_id) values (2, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_chain_dst; @@ -200,15 +169,8 @@ alter table fk_clone_composite_src.child add column payload varchar(32); alter table fk_clone_composite_src.child modify column payload varchar(64); create database fk_clone_composite_dst clone fk_clone_composite_src; show create table fk_clone_composite_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `tenant_id` int DEFAULT NULL, - `object_id` int DEFAULT NULL, - `payload` varchar(64) DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_composite` FOREIGN KEY (`tenant_id`,`object_id`) REFERENCES `parent` (`tenant_id`,`object_id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `tenant_id` int DEFAULT NULL,\n `object_id` int DEFAULT NULL,\n `payload` varchar(64) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_composite` FOREIGN KEY (`tenant_id`,`object_id`) REFERENCES `parent` (`tenant_id`,`object_id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_composite_dst.child(id, tenant_id, object_id) values (2, 1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_composite_dst; @@ -232,17 +194,8 @@ alter table fk_clone_multi_parent_src.child add column payload int default 0; alter table fk_clone_multi_parent_src.child add column note varchar(32); create database fk_clone_multi_parent_dst clone fk_clone_multi_parent_src; show create table fk_clone_multi_parent_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_a_id` int DEFAULT NULL, - `parent_b_id` int DEFAULT NULL, - `payload` int DEFAULT 0, - `note` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_multi_a` FOREIGN KEY (`parent_a_id`) REFERENCES `parent_a` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, - CONSTRAINT `fk_multi_b` FOREIGN KEY (`parent_b_id`) REFERENCES `parent_b` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_a_id` int DEFAULT NULL,\n `parent_b_id` int DEFAULT NULL,\n `payload` int DEFAULT 0,\n `note` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_multi_a` FOREIGN KEY (`parent_a_id`) REFERENCES `parent_a` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,\n CONSTRAINT `fk_multi_b` FOREIGN KEY (`parent_b_id`) REFERENCES `parent_b` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_multi_parent_dst.child(id, parent_a_id, parent_b_id) values (1, 1, 1); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_multi_parent_dst; @@ -262,19 +215,12 @@ alter table fk_clone_self_src.node add column label varchar(32); alter table fk_clone_self_src.node add index idx_label(label); create database fk_clone_self_dst clone fk_clone_self_src; select id, parent_id from fk_clone_self_dst.node order by id; -➤ id[4,32,0] ¦ parent_id[4,32,0] 𝄀 -1 ¦ null 𝄀 -2 ¦ 1 +id parent_id +1 null +2 1 show create table fk_clone_self_dst.node; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -node ¦ CREATE TABLE `node` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `label` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `idx_label` (`label`), - CONSTRAINT `fk_node_parent` FOREIGN KEY (`parent_id`) REFERENCES `node` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +node CREATE TABLE `node` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `label` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx_label` (`label`),\n CONSTRAINT `fk_node_parent` FOREIGN KEY (`parent_id`) REFERENCES `node` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_self_dst.node(id, parent_id) values (3, 999); Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_self_dst; @@ -298,15 +244,8 @@ references fk_clone_recreate_fk_src.parent(id); alter table fk_clone_recreate_fk_src.child add column note varchar(32); create database fk_clone_recreate_fk_dst clone fk_clone_recreate_fk_src; show create table fk_clone_recreate_fk_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `payload` varchar(32) DEFAULT NULL, - `note` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_recreated` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` varchar(32) DEFAULT NULL,\n `note` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_recreated` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_recreate_fk_dst.child(id, parent_id) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_recreate_fk_dst; @@ -326,19 +265,13 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_forward_src' order by constraint_name; -➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 -child ¦ fk_forward ¦ parent +table_name constraint_name refer_table_name +child fk_forward parent create table fk_clone_forward_src.parent (id int primary key); set foreign_key_checks = 1; show create table fk_clone_forward_src.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `payload` int DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_forward` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_forward` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_forward_src.child values (1, 404, 0); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_forward_src; @@ -359,19 +292,13 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_forward_drop_src' order by constraint_name; -➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 -child ¦ fk_forward_drop ¦ parent +table_name constraint_name refer_table_name +child fk_forward_drop parent create table fk_clone_forward_drop_src.parent (id int primary key); set foreign_key_checks = 1; show create table fk_clone_forward_drop_src.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `payload` int DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_forward_drop` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_forward_drop` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_forward_drop_src.child values (1, 404, 0); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_forward_drop_src; @@ -395,9 +322,9 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_self_external_src' order by table_name, constraint_name; -➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 -child ¦ fk_self_external_child ¦ parent 𝄀 -parent ¦ fk_self_external_self ¦ parent +table_name constraint_name refer_table_name +child fk_self_external_child parent +parent fk_self_external_self parent drop table fk_clone_self_external_src.child; drop table fk_clone_self_external_src.parent; drop database fk_clone_self_external_src; @@ -420,17 +347,12 @@ select table_name, column_name, refer_table_name, refer_column_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_rename_columns_src' order by constraint_name; -➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ refer_table_name[12,-1,0] ¦ refer_column_name[12,-1,0] 𝄀 -child ¦ parent_id ¦ parent ¦ id +table_name column_name refer_table_name refer_column_name +child parent_id parent id create database fk_clone_rename_columns_dst clone fk_clone_rename_columns_src; show create table fk_clone_rename_columns_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_rename_columns` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_rename_columns` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_rename_columns_dst.child values (1, 404); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_rename_columns_dst; @@ -457,17 +379,11 @@ insert into fk_clone_snapshot_src.child(id, parent_id) values (2, 2); create database fk_clone_snapshot_dst clone fk_clone_snapshot_src {snapshot = 'fk_clone_alter_snapshot'}; show create table fk_clone_snapshot_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `before_snapshot` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_snapshot` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `before_snapshot` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_snapshot` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) select id, parent_id from fk_clone_snapshot_dst.child order by id; -➤ id[4,32,0] ¦ parent_id[4,32,0] 𝄀 -1 ¦ 1 +id parent_id +1 1 insert into fk_clone_snapshot_dst.child(id, parent_id) values (3, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_snapshot_dst; @@ -491,15 +407,8 @@ use fk_clone_chain_clone_mid; alter table fk_clone_chain_clone_mid.child add column middle_value int; create database fk_clone_chain_clone_dst clone fk_clone_chain_clone_mid; show create table fk_clone_chain_clone_dst.child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -child ¦ CREATE TABLE `child` ( - `id` int NOT NULL, - `parent_id` int DEFAULT NULL, - `source_value` int DEFAULT NULL, - `middle_value` int DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_clone_chain` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `source_value` int DEFAULT NULL,\n `middle_value` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_clone_chain` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_chain_clone_dst.child(id, parent_id) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_chain_clone_dst; @@ -523,14 +432,8 @@ rename table fk_clone_rename_src.child to fk_clone_rename_src.renamed_child; alter table fk_clone_rename_src.renamed_child add column payload varchar(32); create database fk_clone_rename_dst clone fk_clone_rename_src; show create table fk_clone_rename_dst.renamed_child; -➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 -renamed_child ¦ CREATE TABLE `renamed_child` ( - `id` int NOT NULL, - `parent_key` int DEFAULT NULL, - `payload` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_rename` FOREIGN KEY (`parent_key`) REFERENCES `renamed_parent` (`parent_key`) ON DELETE RESTRICT ON UPDATE RESTRICT -) +Table Create Table +renamed_child CREATE TABLE `renamed_child` (\n `id` int NOT NULL,\n `parent_key` int DEFAULT NULL,\n `payload` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_rename` FOREIGN KEY (`parent_key`) REFERENCES `renamed_parent` (`parent_key`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) insert into fk_clone_rename_dst.renamed_child(id, parent_key) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_rename_dst; diff --git a/test/distributed/cases/system_variable/system_variables.result b/test/distributed/cases/system_variable/system_variables.result index f3a9f5217caf2..290f48da83954 100644 --- a/test/distributed/cases/system_variable/system_variables.result +++ b/test/distributed/cases/system_variable/system_variables.result @@ -7,149 +7,149 @@ set wait_timeout = default; set tx_isolation = default; set tx_isolation = default; show variables like 'server_id'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -server_id ¦ dd1dccb4-4d3c-41f8-b482-5251dc7a41bf +Variable_name Value +server_id uuid select @@server_id; -➤ @@server_id[12,0,0] 𝄀 -dd1dccb4-4d3c-41f8-b482-5251dc7a41bf +@@server_id +uuid show variables like 'auto%'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -auto_generate_certs ¦ on 𝄀 -auto_increment_increment ¦ 1 𝄀 -auto_increment_offset ¦ 1 𝄀 -autocommit ¦ on 𝄀 -automatic_sp_privileges ¦ on +Variable_name Value +auto_generate_certs on +auto_increment_increment 1 +auto_increment_offset 1 +autocommit on +automatic_sp_privileges on show variables like 'auto_increment_increment'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -auto_increment_increment ¦ 1 +Variable_name Value +auto_increment_increment 1 set auto_increment_increment = 2; show variables like 'auto_increment_increment'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -auto_increment_increment ¦ 2 +Variable_name Value +auto_increment_increment 2 set auto_increment_increment = 1+1; show variables like 'auto_increment_increment'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -auto_increment_increment ¦ 2 +Variable_name Value +auto_increment_increment 2 set auto_increment_increment = 2*3; show variables like 'auto_increment_increment'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -auto_increment_increment ¦ 6 +Variable_name Value +auto_increment_increment 6 show variables like 'init%'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -init_connect ¦ 𝄀 -init_file ¦ +Variable_name Value +init_connect +init_file show variables like 'init_connect'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -init_connect ¦ +Variable_name Value +init_connect show variables like 'interactive%'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 86400 +Variable_name Value +interactive_timeout 86400 show variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 86400 +Variable_name Value +interactive_timeout 86400 set interactive_timeout = 36600; show variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 36600 +Variable_name Value +interactive_timeout 36600 set interactive_timeout = 30000+100; show variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 30100 +Variable_name Value +interactive_timeout 30100 set global interactive_timeout = default; set @g_interactive_timeout_before = @@global.interactive_timeout; set global interactive_timeout = 30000+100; select @@global.interactive_timeout = @g_interactive_timeout_before; -➤ @@global.interactive_timeout = @g_interactive_timeout_before[-7,1,0] 𝄀 +@@interactive_timeout = @g_interactive_timeout_before 0 show global variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 30100 +Variable_name Value +interactive_timeout 30100 set global interactive_timeout = default; select @@session.interactive_timeout; -➤ @@interactive_timeout[12,0,0] 𝄀 +@@interactive_timeout 30100 set interactive_timeout = 0; internal error: convert to the system variable int type failed set interactive_timeout = 1; show variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 1 +Variable_name Value +interactive_timeout 1 set interactive_timeout = 86400; show variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 86400 +Variable_name Value +interactive_timeout 86400 set interactive_timeout = 86401; invalid input: interactive_timeout must be <= 86400 show variables like 'interactive_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -interactive_timeout ¦ 86400 +Variable_name Value +interactive_timeout 86400 show variables like 'lower%'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -lower_case_file_system ¦ off 𝄀 -lower_case_table_names ¦ 1 +Variable_name Value +lower_case_file_system off +lower_case_table_names 1 show variables like 'lower_case_table_names'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -lower_case_table_names ¦ 1 +Variable_name Value +lower_case_table_names 1 show variables like 'net_write_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -net_write_timeout ¦ 60 +Variable_name Value +net_write_timeout 60 set net_write_timeout = 70; show variables like 'net_write_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -net_write_timeout ¦ 70 +Variable_name Value +net_write_timeout 70 set net_write_timeout = 20*20; show variables like 'net_write_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -net_write_timeout ¦ 400 +Variable_name Value +net_write_timeout 400 set net_write_timeout = 60; show variables like 'net_write_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -net_write_timeout ¦ 60 +Variable_name Value +net_write_timeout 60 show variables where variable_name like 'system%' and variable_name != 'system_time_zone'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] +Variable_name Value select @@system_time_zone != ''; -➤ @@system_time_zone != [-7,1,0] 𝄀 +@@system_time_zone != 1 show variables like 'trans%'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -transaction_alloc_block_size ¦ 8192 𝄀 -transaction_isolation ¦ REPEATABLE-READ 𝄀 -transaction_operator_open_log ¦ off 𝄀 -transaction_prealloc_size ¦ 4096 𝄀 -transaction_read_only ¦ 0 𝄀 -transferred ¦ off +Variable_name Value +transaction_alloc_block_size 8192 +transaction_isolation REPEATABLE-READ +transaction_operator_open_log off +transaction_prealloc_size 4096 +transaction_read_only 0 +transferred off show variables like 'transaction_isolation'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -transaction_isolation ¦ REPEATABLE-READ +Variable_name Value +transaction_isolation REPEATABLE-READ show variables like 'wait%'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 86400 +Variable_name Value +wait_timeout 86400 show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 86400 +Variable_name Value +wait_timeout 86400 set wait_timeout = 33600; show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 33600 +Variable_name Value +wait_timeout 33600 set wait_timeout = 10; show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 10 +Variable_name Value +wait_timeout 10 set wait_timeout = 0; internal error: convert to the system variable int type failed set wait_timeout = 1; show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 1 +Variable_name Value +wait_timeout 1 set wait_timeout = 86400; show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 86400 +Variable_name Value +wait_timeout 86400 set wait_timeout = 86401; invalid input: wait_timeout must be <= 86400 show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 86400 +Variable_name Value +wait_timeout 86400 set wait_timeout = 10; drop table if exists t; create table t( @@ -159,8 +159,8 @@ c int, primary key(a) ); show indexes from t; -➤ Table[12,-1,0] ¦ Non_unique[-5,64,0] ¦ Key_name[12,-1,0] ¦ Seq_in_index[4,32,0] ¦ Column_name[12,-1,0] ¦ Collation[12,-1,0] ¦ Cardinality[-5,64,0] ¦ Sub_part[12,-1,0] ¦ Packed[12,-1,0] ¦ Null[12,-1,0] ¦ Index_type[12,-1,0] ¦ Comment[1,0,0] ¦ Index_comment[12,-1,0] ¦ Index_params[12,-1,0] ¦ Visible[12,-1,0] ¦ Expression[12,-1,0] 𝄀 -t ¦ 0 ¦ PRIMARY ¦ 1 ¦ a ¦ A ¦ 0 ¦ NULL ¦ NULL ¦ ¦ ¦ ¦ ¦ ¦ YES ¦ a +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression +t 0 PRIMARY 1 a A 0 NULL NULL YES a create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database db1; use db1; @@ -172,395 +172,395 @@ c int, primary key(a) ); show indexes from t; -➤ Table[12,-1,0] ¦ Non_unique[-5,64,0] ¦ Key_name[12,-1,0] ¦ Seq_in_index[4,32,0] ¦ Column_name[12,-1,0] ¦ Collation[12,-1,0] ¦ Cardinality[-5,64,0] ¦ Sub_part[12,-1,0] ¦ Packed[12,-1,0] ¦ Null[12,-1,0] ¦ Index_type[12,-1,0] ¦ Comment[1,0,0] ¦ Index_comment[12,-1,0] ¦ Index_params[12,-1,0] ¦ Visible[12,-1,0] ¦ Expression[12,-1,0] 𝄀 -t ¦ 0 ¦ PRIMARY ¦ 1 ¦ a ¦ A ¦ 0 ¦ NULL ¦ NULL ¦ ¦ ¦ ¦ ¦ ¦ YES ¦ a +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression +t 0 PRIMARY 1 a A 0 NULL NULL YES a drop database db1; drop account acc_idx; use information_schema; show tables; -➤ Tables_in_information_schema[12,-1,0] 𝄀 -character_sets 𝄀 -collations 𝄀 -column_privileges 𝄀 -columns 𝄀 -engines 𝄀 -events 𝄀 -files 𝄀 -key_column_usage 𝄀 -keywords 𝄀 -parameters 𝄀 -partitions 𝄀 -processlist 𝄀 -profiling 𝄀 -referential_constraints 𝄀 -routines 𝄀 -schema_privileges 𝄀 -schemata 𝄀 -statistics 𝄀 -table_constraints 𝄀 -table_privileges 𝄀 -tables 𝄀 -triggers 𝄀 -user_privileges 𝄀 +Tables_in_information_schema +character_sets +collations +column_privileges +columns +engines +events +files +key_column_usage +keywords +parameters +partitions +processlist +profiling +referential_constraints +routines +schema_privileges +schemata +statistics +table_constraints +table_privileges +tables +triggers +user_privileges views desc key_column_usage; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +CONSTRAINT_CATALOG VARCHAR(64) YES null +CONSTRAINT_SCHEMA VARCHAR(64) YES null +CONSTRAINT_NAME VARCHAR(64) YES null +TABLE_CATALOG VARCHAR(64) YES null +TABLE_SCHEMA VARCHAR(64) YES null +TABLE_NAME VARCHAR(64) YES null +COLUMN_NAME VARCHAR(64) YES null +ORDINAL_POSITION INT UNSIGNED(32) YES null +POSITION_IN_UNIQUE_CONSTRAINT INT UNSIGNED(32) YES null +REFERENCED_TABLE_SCHEMA VARCHAR(64) YES null +REFERENCED_TABLE_NAME VARCHAR(64) YES null +REFERENCED_COLUMN_NAME VARCHAR(64) YES null select table_name, column_name from key_column_usage limit 2; -➤ table_name[12,-1,0] ¦ column_name[12,-1,0] +table_name column_name desc columns; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_schema ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ordinal_position ¦ INT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_default ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -is_nullable ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -data_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -character_maximum_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -character_octet_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -numeric_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -numeric_scale ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -datetime_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -character_set_name ¦ VARCHAR(4) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -collation_name ¦ VARCHAR(8) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -column_key ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -extra ¦ VARCHAR(24) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -privileges ¦ VARCHAR(31) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -column_comment ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -generation_expression ¦ VARCHAR(500) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -srs_id ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +table_catalog VARCHAR(3) NO null +table_schema VARCHAR(256) YES null +table_name VARCHAR(256) YES null +column_name VARCHAR(256) YES null +ordinal_position INT(0) YES null +column_default VARCHAR(65535) YES null +is_nullable VARCHAR(3) YES null +data_type VARCHAR(65535) YES null +character_maximum_length BIGINT(0) YES null +character_octet_length BIGINT(0) YES null +numeric_precision BIGINT(0) YES null +numeric_scale BIGINT(0) YES null +datetime_precision BIGINT(0) YES null +character_set_name VARCHAR(4) YES null +collation_name VARCHAR(8) YES null +column_type VARCHAR(65535) YES null +column_key VARCHAR(3) YES null +extra VARCHAR(24) YES null +privileges VARCHAR(31) NO null +column_comment VARCHAR(2048) YES null +generation_expression VARCHAR(500) YES null +srs_id BIGINT(0) YES null select table_name, column_name from columns where table_schema = 'mo_catalog' and column_name != '__mo_index_idx_col' and column_name != '__mo_index_pri_col' order by table_name, column_name limit 5; -➤ table_name[12,-1,0] ¦ column_name[12,-1,0] 𝄀 -mo_account ¦ account_id 𝄀 -mo_account ¦ account_name 𝄀 -mo_account ¦ admin_name 𝄀 -mo_account ¦ comments 𝄀 -mo_account ¦ create_version +table_name column_name +mo_account account_id +mo_account account_name +mo_account admin_name +mo_account comments +mo_account create_version desc views; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -table_schema ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -table_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -view_definition ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -check_option ¦ VARCHAR(4) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -is_updatable ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -definer ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -security_type ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -character_set_client ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -collation_connection ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +table_catalog VARCHAR(3) NO null +table_schema VARCHAR(5000) YES null +table_name VARCHAR(5000) YES null +view_definition TEXT(0) YES null +check_option VARCHAR(4) NO null +is_updatable VARCHAR(3) NO null +definer VARCHAR(65535) YES null +security_type VARCHAR(7) NO null +character_set_client VARCHAR(7) NO null +collation_connection VARCHAR(18) NO null select table_schema, table_name, definer from views where table_schema = 'system' order by table_name; -➤ table_schema[12,-1,0] ¦ table_name[12,-1,0] ¦ definer[12,-1,0] 𝄀 -system ¦ error_info ¦ root@localhost 𝄀 -system ¦ log_info ¦ root@localhost 𝄀 -system ¦ span_info ¦ root@localhost 𝄀 -system ¦ sql_statement_hotspot ¦ root@localhost +table_schema table_name definer +system error_info root@localhost +system log_info root@localhost +system span_info root@localhost +system sql_statement_hotspot root@localhost desc profiling; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -QUERY_ID ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 -SEQ ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 -STATE ¦ VARCHAR(30) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -DURATION ¦ DECIMAL(9,6) ¦ NO ¦ ¦ 0.000000 ¦ ¦ 𝄀 -CPU_USER ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CPU_SYSTEM ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CONTEXT_VOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CONTEXT_INVOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -BLOCK_OPS_IN ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -BLOCK_OPS_OUT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -MESSAGES_SENT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -MESSAGES_RECEIVED ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -PAGE_FAULTS_MAJOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -PAGE_FAULTS_MINOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SWAPS ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SOURCE_FUNCTION ¦ VARCHAR(30) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SOURCE_FILE ¦ VARCHAR(20) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SOURCE_LINE ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +QUERY_ID INT(32) NO 0 +SEQ INT(32) NO 0 +STATE VARCHAR(30) NO +DURATION DECIMAL(9,6) NO 0.000000 +CPU_USER DECIMAL(9,6) YES null +CPU_SYSTEM DECIMAL(9,6) YES null +CONTEXT_VOLUNTARY INT(32) YES null +CONTEXT_INVOLUNTARY INT(32) YES null +BLOCK_OPS_IN INT(32) YES null +BLOCK_OPS_OUT INT(32) YES null +MESSAGES_SENT INT(32) YES null +MESSAGES_RECEIVED INT(32) YES null +PAGE_FAULTS_MAJOR INT(32) YES null +PAGE_FAULTS_MINOR INT(32) YES null +SWAPS INT(32) YES null +SOURCE_FUNCTION VARCHAR(30) YES null +SOURCE_FILE VARCHAR(20) YES null +SOURCE_LINE INT(32) YES null select seq, state from profiling; -➤ seq[4,32,0] ¦ state[12,-1,0] +seq state desc user_privileges; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -GRANTEE ¦ VARCHAR(292) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -TABLE_CATALOG ¦ VARCHAR(512) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -PRIVILEGE_TYPE ¦ VARCHAR(64) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -IS_GRANTABLE ¦ VARCHAR(3) ¦ NO ¦ ¦ ¦ ¦ +Field Type Null Key Default Extra Comment +GRANTEE VARCHAR(292) NO +TABLE_CATALOG VARCHAR(512) NO +PRIVILEGE_TYPE VARCHAR(64) NO +IS_GRANTABLE VARCHAR(3) NO select grantee, table_catalog from user_privileges limit 2; -➤ grantee[12,-1,0] ¦ table_catalog[12,-1,0] +grantee table_catalog desc schemata; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -catalog_name ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -schema_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -default_character_set_name ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -default_collation_name ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -sql_path ¦ CHAR(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -default_encryption ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +catalog_name VARCHAR(3) NO null +schema_name VARCHAR(5000) YES null +default_character_set_name VARCHAR(7) NO null +default_collation_name VARCHAR(18) NO null +sql_path CHAR(0) YES null +default_encryption VARCHAR(3) NO null select catalog_name, schema_name from schemata where schema_name = 'mo_catalog' or schema_name = 'mo_task' order by catalog_name, schema_name; -➤ catalog_name[12,-1,0] ¦ schema_name[12,-1,0] 𝄀 -def ¦ mo_catalog 𝄀 -def ¦ mo_task +catalog_name schema_name +def mo_catalog +def mo_task desc character_sets; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -CHARACTER_SET_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DEFAULT_COLLATE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DESCRIPTION ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -MAXLEN ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +CHARACTER_SET_NAME VARCHAR(64) YES null +DEFAULT_COLLATE_NAME VARCHAR(64) YES null +DESCRIPTION VARCHAR(2048) YES null +MAXLEN INT UNSIGNED(32) YES null select character_set_name, description, maxlen from character_sets limit 5; -➤ character_set_name[12,-1,0] ¦ description[12,-1,0] ¦ maxlen[4,32,0] 𝄀 -binary ¦ Binary pseudo charset ¦ 1 𝄀 -utf8 ¦ UTF-8 Unicode ¦ 4 𝄀 -utf8mb4 ¦ UTF-8 Unicode ¦ 4 +character_set_name description maxlen +binary Binary pseudo charset 1 +utf8 UTF-8 Unicode 4 +utf8mb4 UTF-8 Unicode 4 desc triggers; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -TRIGGER_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TRIGGER_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -TRIGGER_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_MANIPULATION ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_OBJECT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_OBJECT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -EVENT_OBJECT_TABLE ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_ORDER ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_CONDITION ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_STATEMENT ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_ORIENTATION ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_TIMING ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_OLD_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_NEW_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_OLD_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -ACTION_REFERENCE_NEW_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CREATED ¦ TIMESTAMP(2) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -SQL_MODE ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DEFINER ¦ VARCHAR(288) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -CHARACTER_SET_CLIENT ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -COLLATION_CONNECTION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 -DATABASE_COLLATION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ +Field Type Null Key Default Extra Comment +TRIGGER_CATALOG VARCHAR(64) YES null +TRIGGER_SCHEMA VARCHAR(64) YES null +TRIGGER_NAME VARCHAR(64) YES null +EVENT_MANIPULATION VARCHAR(10) YES null +EVENT_OBJECT_CATALOG VARCHAR(64) YES null +EVENT_OBJECT_SCHEMA VARCHAR(64) YES null +EVENT_OBJECT_TABLE VARCHAR(64) YES null +ACTION_ORDER INT UNSIGNED(32) YES null +ACTION_CONDITION BINARY(0) YES null +ACTION_STATEMENT TEXT(0) YES null +ACTION_ORIENTATION VARCHAR(3) YES null +ACTION_TIMING VARCHAR(10) YES null +ACTION_REFERENCE_OLD_TABLE BINARY(0) YES null +ACTION_REFERENCE_NEW_TABLE BINARY(0) YES null +ACTION_REFERENCE_OLD_ROW VARCHAR(3) YES null +ACTION_REFERENCE_NEW_ROW VARCHAR(3) YES null +CREATED TIMESTAMP(2) YES null +SQL_MODE VARCHAR(10) YES null +DEFINER VARCHAR(288) YES null +CHARACTER_SET_CLIENT VARCHAR(64) YES null +COLLATION_CONNECTION VARCHAR(64) YES null +DATABASE_COLLATION VARCHAR(64) YES null select trigger_name, action_order from triggers limit 3; -➤ trigger_name[12,-1,0] ¦ action_order[4,32,0] +trigger_name action_order use mysql; select host, user from user limit 2; -➤ host[1,255,0] ¦ user[1,32,0] +host user desc db; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Select_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Insert_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Update_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Delete_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Drop_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Grant_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -References_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Index_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Alter_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_tmp_table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Lock_tables_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Show_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Create_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Alter_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Execute_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Event_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 -Trigger_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Select_priv VARCHAR(10) NO N +Insert_priv VARCHAR(10) NO N +Update_priv VARCHAR(10) NO N +Delete_priv VARCHAR(10) NO N +Create_priv VARCHAR(10) NO N +Drop_priv VARCHAR(10) NO N +Grant_priv VARCHAR(10) NO N +References_priv VARCHAR(10) NO N +Index_priv VARCHAR(10) NO N +Alter_priv VARCHAR(10) NO N +Create_tmp_table_priv VARCHAR(10) NO N +Lock_tables_priv VARCHAR(10) NO N +Create_view_priv VARCHAR(10) NO N +Show_view_priv VARCHAR(10) NO N +Create_routine_priv VARCHAR(10) NO N +Alter_routine_priv VARCHAR(10) NO N +Execute_priv VARCHAR(10) NO N +Event_priv VARCHAR(10) NO N +Trigger_priv VARCHAR(10) NO N select db, user from db limit 5; -➤ db[1,64,0] ¦ user[1,32,0] +db user desc procs_priv; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Routine_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Routine_type ¦ VARCHAR(10) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 -Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 -Proc_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Routine_name CHAR(64) NO PRI +Routine_type VARCHAR(10) NO PRI null +Grantor VARCHAR(288) NO MUL +Proc_priv VARCHAR(10) NO +Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() select routine_name, routine_type from procs_priv limit 5; -➤ routine_name[1,64,0] ¦ routine_type[12,-1,0] +routine_name routine_type desc columns_priv; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Column_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 -Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Table_name CHAR(64) NO PRI +Column_name CHAR(64) NO PRI +Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +Column_priv VARCHAR(10) NO select table_name, column_name from columns_priv limit 5; -➤ table_name[1,64,0] ¦ column_name[1,64,0] +table_name column_name desc tables_priv; -➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 -Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 -Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 -Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 -Table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 -Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ +Field Type Null Key Default Extra Comment +Host CHAR(255) NO PRI +Db CHAR(64) NO PRI +User CHAR(32) NO PRI +Table_name CHAR(64) NO PRI +Grantor VARCHAR(288) NO MUL +Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +Table_priv VARCHAR(10) NO +Column_priv VARCHAR(10) NO select host, table_name from tables_priv limit 5; -➤ host[1,255,0] ¦ table_name[1,64,0] +host table_name show variables like 'sql_select_limit'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -sql_select_limit ¦ 18446744073709551615 +Variable_name Value +sql_select_limit 18446744073709551615 set sql_select_limit = 100000; show variables like 'sql_select_limit'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -sql_select_limit ¦ 100000 +Variable_name Value +sql_select_limit 100000 set sql_select_limit = 1; show variables like 'sql_select_limit'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -sql_select_limit ¦ 1 +Variable_name Value +sql_select_limit 1 SET SQL_SELECT_LIMIT = Default; show variables like 'sql_select_limit'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -sql_select_limit ¦ 18446744073709551615 +Variable_name Value +sql_select_limit 18446744073709551615 show variables like 'max_allowed_packet'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -max_allowed_packet ¦ 67108864 +Variable_name Value +max_allowed_packet 67108864 set max_allowed_packet = 10000; show variables like 'max_allowed_packet'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -max_allowed_packet ¦ 10000 +Variable_name Value +max_allowed_packet 10000 set max_allowed_packet = default; show variables like 'max_allowed_packet'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -max_allowed_packet ¦ 67108864 +Variable_name Value +max_allowed_packet 67108864 show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 10 +Variable_name Value +wait_timeout 10 set wait_timeout = 10000; show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 10000 +Variable_name Value +wait_timeout 10000 set wait_timeout = default; show variables like 'wait_timeout'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -wait_timeout ¦ 86400 +Variable_name Value +wait_timeout 86400 show variables like 'character_set_results'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -character_set_results ¦ utf8 +Variable_name Value +character_set_results utf8 set character_set_server = default; show variables like 'character_set_results'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -character_set_results ¦ utf8 +Variable_name Value +character_set_results utf8 show variables like 'character_set_server'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -character_set_server ¦ utf8mb4 +Variable_name Value +character_set_server utf8mb4 set character_set_server = default; show variables like 'character_set_server'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -character_set_server ¦ utf8mb4 +Variable_name Value +character_set_server utf8mb4 show variables like 'transaction_isolation'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -transaction_isolation ¦ REPEATABLE-READ +Variable_name Value +transaction_isolation REPEATABLE-READ set transaction_isolation = default; show variables like 'transaction_isolation'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -transaction_isolation ¦ REPEATABLE-READ +Variable_name Value +transaction_isolation REPEATABLE-READ show variables like 'tx_isolation'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -tx_isolation ¦ REPEATABLE-READ +Variable_name Value +tx_isolation REPEATABLE-READ set tx_isolation = default; show variables like 'tx_isolation'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -tx_isolation ¦ REPEATABLE-READ +Variable_name Value +tx_isolation REPEATABLE-READ select @@sql_mode; -➤ @@sql_mode[12,0,0] 𝄀 +@@sql_mode ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES set @@sql_mode =''; select @@sql_mode; -➤ @@sql_mode[12,0,0] 𝄀 +@@sql_mode set @@sql_mode = 'ONLY_FULL_GROUP_BY'; select @@sql_mode; -➤ @@sql_mode[12,0,0] 𝄀 +@@sql_mode ONLY_FULL_GROUP_BY set @@sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"; select @@sql_mode; -➤ @@sql_mode[12,0,0] 𝄀 +@@sql_mode ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES set @@sql_mode = default; set global long_query_time = 1.1; show global variables like 'long_query_time'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -long_query_time ¦ 1.1 +Variable_name Value +long_query_time 1.1 set global long_query_time = default; show global variables like 'long_query_time'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -long_query_time ¦ 10 +Variable_name Value +long_query_time 10 create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database test_for_navicat; create database test_for_navicat; SELECT SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA where SCHEMA_NAME = 'test_for_navicat'; -➤ SCHEMA_NAME[12,-1,0] ¦ DEFAULT_CHARACTER_SET_NAME[12,-1,0] ¦ DEFAULT_COLLATION_NAME[12,-1,0] 𝄀 -test_for_navicat ¦ utf8mb4 ¦ utf8mb4_0900_ai_ci +SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME +test_for_navicat utf8mb4 utf8mb4_0900_ai_ci drop database test_for_navicat; drop account acc_idx; select @@profiling; -➤ @@profiling[12,0,0] 𝄀 +@@profiling 0 select @@global.profiling; -➤ @@global.profiling[12,0,0] 𝄀 +@@profiling 0 show variables like 'profiling'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -profiling ¦ 0 +Variable_name Value +profiling 0 select @@profiling_history_size; -➤ @@profiling_history_size[12,0,0] 𝄀 +@@profiling_history_size 15 select @@global.profiling_history_size; -➤ @@global.profiling_history_size[12,0,0] 𝄀 +@@profiling_history_size 15 show variables like 'profiling_history_size'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -profiling_history_size ¦ 15 +Variable_name Value +profiling_history_size 15 SET profiling_history_size = 0; select @@profiling_history_size; -➤ @@profiling_history_size[12,0,0] 𝄀 +@@profiling_history_size 0 select @@global.profiling_history_size; -➤ @@global.profiling_history_size[12,0,0] 𝄀 +@@profiling_history_size 15 show variables like 'profiling_history_size'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -profiling_history_size ¦ 0 +Variable_name Value +profiling_history_size 0 SET profiling_history_size = 15; select @@profiling_history_size; -➤ @@profiling_history_size[12,0,0] 𝄀 +@@profiling_history_size 15 select @@global.profiling_history_size; -➤ @@global.profiling_history_size[12,0,0] 𝄀 +@@profiling_history_size 15 show variables like 'profiling_history_size'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -profiling_history_size ¦ 15 +Variable_name Value +profiling_history_size 15 SET profiling_history_size = default; select @@optimizer_switch; -➤ @@optimizer_switch[12,0,0] 𝄀 +@@optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on select @@global.optimizer_switch; -➤ @@global.optimizer_switch[12,0,0] 𝄀 +@@optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on show variables like 'optimizer_switch'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -optimizer_switch ¦ index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on +Variable_name Value +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on set optimizer_switch='semijoin=off'; select @@optimizer_switch; -➤ @@optimizer_switch[12,0,0] 𝄀 +@@optimizer_switch semijoin=off show variables like 'optimizer_switch'; -➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 -optimizer_switch ¦ semijoin=off +Variable_name Value +optimizer_switch semijoin=off SET profiling_history_size = default; diff --git a/test/distributed/cases/table/truncate_table_2.result b/test/distributed/cases/table/truncate_table_2.result index 9a5c1b96acb1f..021ce0c696088 100644 --- a/test/distributed/cases/table/truncate_table_2.result +++ b/test/distributed/cases/table/truncate_table_2.result @@ -8,132 +8,133 @@ insert into trun_table_01 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','20 insert into trun_table_01 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,77.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_01 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_01; select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 truncate table trun_table_01; select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,54.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,11.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 54.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 11.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} update trun_table_01 set clo3=90 ,col12='2011-01-21' where clo1=1; -[unknown result because it is related to issue#7133] +Duplicate entry '3a155a41170b33cd' for key '__mo_cpkey_004clo3005col12' update trun_table_01 set clo3=66 ,col12='2011-01-21' where clo1=1; -[unknown result because it is related to issue#7133] select * from trun_table_01; -[unknown result because it is related to issue#7133] +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 66 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_01; select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 delete from trun_table_01 where clo1=2; select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 insert into trun_table_01(clo2,clo3,col12) select 36,118,'2002-12-03'; insert into trun_table_01(clo2,clo3,col12) select 45,108,'2012-02-23'; select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ 36 ¦ 118 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ style ¦ 2002-12-03 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null 𝄀 -2 ¦ 45 ¦ 108 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ style ¦ 2012-02-23 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 36 118 null null null null null null null style 2002-12-03 null null null null null null +2 45 108 null null null null null null null style 2012-02-23 null null null null null null truncate table trun_table_01; select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 drop table trun_table_01; create table trun_table_01(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_01 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} create temporary table trun_table_02(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_02 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,98.23,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,77.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=1; -insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); -- @regex("Duplicate entry '\(100,2021-01-21\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) -Duplicate entry '(100,2021-01-21)' for key '(clo3,col12)' -insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,2.43,'tttext','{"a": "3","b": [0,1,2]}'); +insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); +Duplicate entry '(100,2021-01-21)' for key '__mo_cpkey_col' -- @regex("Duplicate entry '\(102,2022-10-11\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) -Duplicate entry '(102,2022-10-11)' for key '(clo3,col12)' +insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,2.43,'tttext','{"a": "3","b": [0,1,2]}'); +Duplicate entry '(102,2022-10-11)' for key '__mo_cpkey_col' select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=3; select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} insert into trun_table_02 select * from trun_table_01; select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90 where clo1=1; select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90, col12='1992-11-01' where clo1=1; select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1992-11-01 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1992-11-01 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} drop table trun_table_02; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; select * from trun_table_03; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; select * from trun_table_03; -➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 -1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 -4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} +clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; drop table trun_table_03; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; @@ -166,7 +167,7 @@ truncate table span_info; no such table system.span_info use information_schema; truncate table key_column_usage ; -no such table information_schema.key_column_usage +internal error: do not have privilege to execute the statement truncate table columns; no such table information_schema.columns truncate table profiling; From ac81c5f0ed9e14803ec1dbe004658fd1fb2b32ca Mon Sep 17 00:00:00 2001 From: daviszhen Date: Wed, 5 Aug 2026 18:17:43 +0800 Subject: [PATCH 23/24] update --- .../cases/database/system_table.result | 481 ++++++------ .../cases/foreign_key/fk_base.result | 196 ++--- .../cases/foreign_key/foreign_key.result | 623 +++++++-------- .../clone/clone_fk_after_alter.result | 203 +++-- .../system_variable/system_variables.result | 716 +++++++++--------- .../cases/table/truncate_table_2.result | 145 ++-- 6 files changed, 1221 insertions(+), 1143 deletions(-) diff --git a/test/distributed/cases/database/system_table.result b/test/distributed/cases/database/system_table.result index f2a0a14d07202..707e42f32ea1c 100644 --- a/test/distributed/cases/database/system_table.result +++ b/test/distributed/cases/database/system_table.result @@ -1,296 +1,271 @@ SELECT table_catalog,table_schema,table_name,table_type from `information_schema`.`tables` where table_name = 'mo_tables'; -table_catalog table_schema table_name table_type -def mo_catalog mo_tables BASE TABLE +➤ table_catalog[12,-1,0] ¦ table_schema[12,-1,0] ¦ table_name[12,-1,0] ¦ table_type[12,-1,0] 𝄀 +def ¦ mo_catalog ¦ mo_tables ¦ BASE TABLE SELECT * FROM `information_schema`.`character_sets` LIMIT 0,1000; -character_set_name default_collate_name description maxlen -binary binary Binary pseudo charset 1 -utf8 utf8_bin UTF-8 Unicode 4 -utf8mb4 utf8mb4_bin UTF-8 Unicode 4 +➤ character_set_name[12,-1,0] ¦ default_collate_name[12,-1,0] ¦ description[12,-1,0] ¦ maxlen[4,32,0] 𝄀 +binary ¦ binary ¦ Binary pseudo charset ¦ 1 𝄀 +utf8 ¦ utf8_bin ¦ UTF-8 Unicode ¦ 4 𝄀 +utf8mb4 ¦ utf8mb4_bin ¦ UTF-8 Unicode ¦ 4 SELECT * FROM `information_schema`.`columns` where TABLE_NAME = 'mo_tables' order by ORDINAL_POSITION LIMIT 2; -table_catalog table_schema table_name column_name ordinal_position column_default is_nullable data_type character_maximum_length character_octet_length numeric_precision numeric_scale datetime_precision character_set_name collation_name column_type column_key extra privileges column_comment generation_expression srs_id -def mo_catalog mo_tables rel_id 1 null YES BIGINT UNSIGNED null null null null null null null BIGINT UNSIGNED(0) select,insert,update,references null -def mo_catalog mo_tables relname 2 null YES VARCHAR 5000 20000 null null null utf8 utf8_bin VARCHAR(5000) select,insert,update,references null +➤ TABLE_CATALOG[12,-1,0] ¦ TABLE_SCHEMA[12,-1,0] ¦ TABLE_NAME[12,-1,0] ¦ COLUMN_NAME[12,-1,0] ¦ ORDINAL_POSITION[4,32,0] ¦ COLUMN_DEFAULT[12,-1,0] ¦ IS_NULLABLE[12,-1,0] ¦ DATA_TYPE[12,-1,0] ¦ CHARACTER_MAXIMUM_LENGTH[-5,64,0] ¦ CHARACTER_OCTET_LENGTH[-5,64,0] ¦ NUMERIC_PRECISION[-5,64,0] ¦ NUMERIC_SCALE[-5,64,0] ¦ DATETIME_PRECISION[-5,64,0] ¦ CHARACTER_SET_NAME[12,-1,0] ¦ COLLATION_NAME[12,-1,0] ¦ COLUMN_TYPE[12,-1,0] ¦ COLUMN_KEY[12,-1,0] ¦ EXTRA[12,-1,0] ¦ PRIVILEGES[12,-1,0] ¦ COLUMN_COMMENT[12,-1,0] ¦ GENERATION_EXPRESSION[12,-1,0] ¦ SRS_ID[-5,64,0] 𝄀 +def ¦ mo_catalog ¦ mo_tables ¦ rel_id ¦ 1 ¦ null ¦ YES ¦ BIGINT UNSIGNED ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ BIGINT UNSIGNED(0) ¦ ¦ ¦ select,insert,update,references ¦ ¦ ¦ null 𝄀 +def ¦ mo_catalog ¦ mo_tables ¦ relname ¦ 2 ¦ null ¦ YES ¦ VARCHAR ¦ 5000 ¦ 20000 ¦ null ¦ null ¦ null ¦ utf8 ¦ utf8_bin ¦ VARCHAR(5000) ¦ ¦ ¦ select,insert,update,references ¦ ¦ ¦ null SELECT * FROM `information_schema`.`key_column_usage` LIMIT 0,1000; -constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name ordinal_position position_in_unique_constraint referenced_table_schema referenced_table_name referenced_column_name +➤ CONSTRAINT_CATALOG[12,-1,0] ¦ CONSTRAINT_SCHEMA[12,-1,0] ¦ CONSTRAINT_NAME[12,-1,0] ¦ TABLE_CATALOG[12,-1,0] ¦ TABLE_SCHEMA[12,-1,0] ¦ TABLE_NAME[12,-1,0] ¦ COLUMN_NAME[12,-1,0] ¦ ORDINAL_POSITION[4,32,0] ¦ POSITION_IN_UNIQUE_CONSTRAINT[4,32,0] ¦ REFERENCED_TABLE_SCHEMA[12,-1,0] ¦ REFERENCED_TABLE_NAME[12,-1,0] ¦ REFERENCED_COLUMN_NAME[12,-1,0] SELECT * FROM `information_schema`.`profiling` LIMIT 0,1000; -query_id seq state duration cpu_user cpu_system context_voluntary context_involuntary block_ops_in block_ops_out messages_sent messages_received page_faults_major page_faults_minor swaps source_function source_file source_line +➤ query_id[4,32,0] ¦ seq[4,32,0] ¦ state[12,-1,0] ¦ duration[3,9,6] ¦ cpu_user[3,9,6] ¦ cpu_system[3,9,6] ¦ context_voluntary[4,32,0] ¦ context_involuntary[4,32,0] ¦ block_ops_in[4,32,0] ¦ block_ops_out[4,32,0] ¦ messages_sent[4,32,0] ¦ messages_received[4,32,0] ¦ page_faults_major[4,32,0] ¦ page_faults_minor[4,32,0] ¦ swaps[4,32,0] ¦ source_function[12,-1,0] ¦ source_file[12,-1,0] ¦ source_line[4,32,0] SELECT * FROM `information_schema`.`schemata` where schema_name = 'information_schema'; -catalog_name schema_name default_character_set_name default_collation_name sql_path default_encryption -def information_schema utf8mb4 utf8mb4_0900_ai_ci null NO +➤ CATALOG_NAME[12,-1,0] ¦ SCHEMA_NAME[12,-1,0] ¦ DEFAULT_CHARACTER_SET_NAME[12,-1,0] ¦ DEFAULT_COLLATION_NAME[12,-1,0] ¦ SQL_PATH[1,0,0] ¦ DEFAULT_ENCRYPTION[12,-1,0] 𝄀 +def ¦ information_schema ¦ utf8mb4 ¦ utf8mb4_0900_ai_ci ¦ null ¦ NO SELECT * FROM `information_schema`.`triggers` LIMIT 0,1000; -trigger_catalog trigger_schema trigger_name event_manipulation event_object_catalog event_object_schema event_object_table action_order action_condition action_statement action_orientation action_timing action_reference_old_table action_reference_new_table action_reference_old_row action_reference_new_row created sql_mode definer character_set_client collation_connection database_collation +➤ trigger_catalog[12,-1,0] ¦ trigger_schema[12,-1,0] ¦ trigger_name[12,-1,0] ¦ event_manipulation[12,-1,0] ¦ event_object_catalog[12,-1,0] ¦ event_object_schema[12,-1,0] ¦ event_object_table[12,-1,0] ¦ action_order[4,32,0] ¦ action_condition[12,0,0] ¦ action_statement[12,0,0] ¦ action_orientation[12,-1,0] ¦ action_timing[12,-1,0] ¦ action_reference_old_table[12,0,0] ¦ action_reference_new_table[12,0,0] ¦ action_reference_old_row[12,-1,0] ¦ action_reference_new_row[12,-1,0] ¦ created[93,64,0] ¦ sql_mode[12,-1,0] ¦ definer[12,-1,0] ¦ character_set_client[12,-1,0] ¦ collation_connection[12,-1,0] ¦ database_collation[12,-1,0] SELECT * FROM `information_schema`.`user_privileges` LIMIT 0,1000; -grantee table_catalog privilege_type is_grantable +➤ grantee[12,-1,0] ¦ table_catalog[12,-1,0] ¦ privilege_type[12,-1,0] ¦ is_grantable[12,-1,0] SELECT TABLE_SCHEMA AS TABLE_CAT, NULL AS TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, NULL AS INDEX_QUALIFIER, INDEX_NAME,3 AS TYPE, SEQ_IN_INDEX AS ORDINAL_POSITION, COLUMN_NAME,COLLATION AS ASC_OR_DESC, CARDINALITY, 0 AS PAGES, NULL AS FILTER_CONDITION FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'procs_priv' ORDER BY NON_UNIQUE, INDEX_NAME, SEQ_IN_INDEX limit 1; -TABLE_CAT TABLE_SCHEM TABLE_NAME NON_UNIQUE INDEX_QUALIFIER INDEX_NAME TYPE ORDINAL_POSITION COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION -mysql null procs_priv 0 null PRIMARY 3 1 Host A 0 0 null +➤ TABLE_CAT[12,-1,0] ¦ TABLE_SCHEM[12,4,0] ¦ TABLE_NAME[12,-1,0] ¦ NON_UNIQUE[-5,64,0] ¦ INDEX_QUALIFIER[12,4,0] ¦ INDEX_NAME[12,-1,0] ¦ TYPE[-5,64,0] ¦ ORDINAL_POSITION[4,32,0] ¦ COLUMN_NAME[12,-1,0] ¦ ASC_OR_DESC[12,-1,0] ¦ CARDINALITY[-5,64,0] ¦ PAGES[-5,64,0] ¦ FILTER_CONDITION[12,4,0] 𝄀 +mysql ¦ null ¦ procs_priv ¦ 0 ¦ null ¦ PRIMARY ¦ 3 ¦ 1 ¦ Host ¦ A ¦ 0 ¦ 0 ¦ null SELECT * FROM `mysql`.`columns_priv` LIMIT 0,1000; -host db user table_name column_name timestamp column_priv +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ table_name[1,64,0] ¦ column_name[1,64,0] ¦ timestamp[93,64,0] ¦ column_priv[12,-1,0] SELECT * FROM `mysql`.`db` LIMIT 0,1000; -host db user select_priv insert_priv update_priv delete_priv create_priv drop_priv grant_priv references_priv index_priv alter_priv create_tmp_table_priv lock_tables_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv execute_priv event_priv trigger_priv +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ select_priv[12,-1,0] ¦ insert_priv[12,-1,0] ¦ update_priv[12,-1,0] ¦ delete_priv[12,-1,0] ¦ create_priv[12,-1,0] ¦ drop_priv[12,-1,0] ¦ grant_priv[12,-1,0] ¦ references_priv[12,-1,0] ¦ index_priv[12,-1,0] ¦ alter_priv[12,-1,0] ¦ create_tmp_table_priv[12,-1,0] ¦ lock_tables_priv[12,-1,0] ¦ create_view_priv[12,-1,0] ¦ show_view_priv[12,-1,0] ¦ create_routine_priv[12,-1,0] ¦ alter_routine_priv[12,-1,0] ¦ execute_priv[12,-1,0] ¦ event_priv[12,-1,0] ¦ trigger_priv[12,-1,0] SELECT * FROM `mysql`.`procs_priv` LIMIT 0,1000; -host db user routine_name routine_type grantor proc_priv timestamp +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ routine_name[1,64,0] ¦ routine_type[12,-1,0] ¦ grantor[12,-1,0] ¦ proc_priv[12,-1,0] ¦ timestamp[93,64,0] SELECT * FROM `mysql`.`tables_priv` LIMIT 0,1000; -host db user table_name grantor timestamp table_priv column_priv +➤ host[1,255,0] ¦ db[1,64,0] ¦ user[1,32,0] ¦ table_name[1,64,0] ¦ grantor[12,-1,0] ¦ timestamp[93,64,0] ¦ table_priv[12,-1,0] ¦ column_priv[12,-1,0] SELECT * FROM `mysql`.`user` LIMIT 0,1000; -host user select_priv insert_priv update_priv delete_priv create_priv drop_priv reload_priv shutdown_priv process_priv file_priv grant_priv references_priv index_priv alter_priv show_db_priv super_priv create_tmp_table_priv lock_tables_priv execute_priv repl_slave_priv repl_client_priv create_view_priv show_view_priv create_routine_priv alter_routine_priv create_user_priv event_priv trigger_priv create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired password_last_changed password_lifetime account_locked create_role_priv drop_role_priv password_reuse_history password_reuse_time password_require_current user_attributes +➤ host[1,255,0] ¦ user[1,32,0] ¦ select_priv[12,-1,0] ¦ insert_priv[12,-1,0] ¦ update_priv[12,-1,0] ¦ delete_priv[12,-1,0] ¦ create_priv[12,-1,0] ¦ drop_priv[12,-1,0] ¦ reload_priv[12,-1,0] ¦ shutdown_priv[12,-1,0] ¦ process_priv[12,-1,0] ¦ file_priv[12,-1,0] ¦ grant_priv[12,-1,0] ¦ references_priv[12,-1,0] ¦ index_priv[12,-1,0] ¦ alter_priv[12,-1,0] ¦ show_db_priv[12,-1,0] ¦ super_priv[12,-1,0] ¦ create_tmp_table_priv[12,-1,0] ¦ lock_tables_priv[12,-1,0] ¦ execute_priv[12,-1,0] ¦ repl_slave_priv[12,-1,0] ¦ repl_client_priv[12,-1,0] ¦ create_view_priv[12,-1,0] ¦ show_view_priv[12,-1,0] ¦ create_routine_priv[12,-1,0] ¦ alter_routine_priv[12,-1,0] ¦ create_user_priv[12,-1,0] ¦ event_priv[12,-1,0] ¦ trigger_priv[12,-1,0] ¦ create_tablespace_priv[12,-1,0] ¦ ssl_type[12,-1,0] ¦ ssl_cipher[12,0,0] ¦ x509_issuer[12,0,0] ¦ x509_subject[12,0,0] ¦ max_questions[4,32,0] ¦ max_updates[4,32,0] ¦ max_connections[4,32,0] ¦ max_user_connections[4,32,0] ¦ plugin[1,64,0] ¦ authentication_string[12,0,0] ¦ password_expired[12,-1,0] ¦ password_last_changed[93,64,0] ¦ password_lifetime[5,16,0] ¦ account_locked[12,-1,0] ¦ create_role_priv[12,-1,0] ¦ drop_role_priv[12,-1,0] ¦ password_reuse_history[5,16,0] ¦ password_reuse_time[5,16,0] ¦ password_require_current[12,-1,0] ¦ user_attributes[-1,2147483647,0] use mysql; show tables; -Tables_in_mysql -columns_priv -db -procs_priv -role_edges -tables_priv +➤ Tables_in_mysql[12,-1,0] 𝄀 +columns_priv 𝄀 +db 𝄀 +procs_priv 𝄀 +role_edges 𝄀 +tables_priv 𝄀 user show columns from `db`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Select_priv VARCHAR(10) NO N -Insert_priv VARCHAR(10) NO N -Update_priv VARCHAR(10) NO N -Delete_priv VARCHAR(10) NO N -Create_priv VARCHAR(10) NO N -Drop_priv VARCHAR(10) NO N -Grant_priv VARCHAR(10) NO N -References_priv VARCHAR(10) NO N -Index_priv VARCHAR(10) NO N -Alter_priv VARCHAR(10) NO N -Create_tmp_table_priv VARCHAR(10) NO N -Lock_tables_priv VARCHAR(10) NO N -Create_view_priv VARCHAR(10) NO N -Show_view_priv VARCHAR(10) NO N -Create_routine_priv VARCHAR(10) NO N -Alter_routine_priv VARCHAR(10) NO N -Execute_priv VARCHAR(10) NO N -Event_priv VARCHAR(10) NO N -Trigger_priv VARCHAR(10) NO N +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Select_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Insert_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Update_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Delete_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Drop_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Grant_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +References_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Index_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_tmp_table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Lock_tables_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Show_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Execute_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Event_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Trigger_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ show columns from `procs_priv`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Routine_name CHAR(64) NO PRI -Routine_type VARCHAR(10) NO PRI null -Grantor VARCHAR(288) NO MUL -Proc_priv VARCHAR(10) NO -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_type ¦ VARCHAR(10) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Proc_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ show columns from `columns_priv`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Column_name CHAR(64) NO PRI -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Column_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ show columns from `tables_priv`; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Grantor VARCHAR(288) NO MUL -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Table_priv VARCHAR(10) NO -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ use information_schema; show tables; -Tables_in_information_schema -character_sets -collations -column_privileges -columns -engines -events -files -key_column_usage -keywords -parameters -partitions -processlist -profiling -referential_constraints -routines -schema_privileges -schemata -statistics -table_constraints -table_privileges -tables -triggers -user_privileges +➤ Tables_in_information_schema[12,-1,0] 𝄀 +character_sets 𝄀 +collations 𝄀 +column_privileges 𝄀 +columns 𝄀 +engines 𝄀 +events 𝄀 +files 𝄀 +key_column_usage 𝄀 +keywords 𝄀 +parameters 𝄀 +partitions 𝄀 +processlist 𝄀 +profiling 𝄀 +referential_constraints 𝄀 +routines 𝄀 +schema_privileges 𝄀 +schemata 𝄀 +statistics 𝄀 +table_constraints 𝄀 +table_privileges 𝄀 +tables 𝄀 +triggers 𝄀 +user_privileges 𝄀 views show columns from `KEY_COLUMN_USAGE`; -Field Type Null Key Default Extra Comment -CONSTRAINT_CATALOG VARCHAR(64) YES null -CONSTRAINT_SCHEMA VARCHAR(64) YES null -CONSTRAINT_NAME VARCHAR(64) YES null -TABLE_CATALOG VARCHAR(64) YES null -TABLE_SCHEMA VARCHAR(64) YES null -TABLE_NAME VARCHAR(64) YES null -COLUMN_NAME VARCHAR(64) YES null -ORDINAL_POSITION INT UNSIGNED(32) YES null -POSITION_IN_UNIQUE_CONSTRAINT INT UNSIGNED(32) YES null -REFERENCED_TABLE_SCHEMA VARCHAR(64) YES null -REFERENCED_TABLE_NAME VARCHAR(64) YES null -REFERENCED_COLUMN_NAME VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ show columns from `COLUMNS`; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(256) YES null -table_name VARCHAR(256) YES null -column_name VARCHAR(256) YES null -ordinal_position INT(0) YES null -column_default VARCHAR(65535) YES null -is_nullable VARCHAR(3) YES null -data_type VARCHAR(65535) YES null -character_maximum_length BIGINT(0) YES null -character_octet_length BIGINT(0) YES null -numeric_precision BIGINT(0) YES null -numeric_scale BIGINT(0) YES null -datetime_precision BIGINT(0) YES null -character_set_name VARCHAR(4) YES null -collation_name VARCHAR(8) YES null -column_type VARCHAR(65535) YES null -column_key VARCHAR(3) YES null -extra VARCHAR(24) YES null -privileges VARCHAR(31) NO null -column_comment VARCHAR(2048) YES null -generation_expression VARCHAR(500) YES null -srs_id BIGINT(0) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_default ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +is_nullable ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_maximum_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_octet_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_scale ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +datetime_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_set_name ¦ VARCHAR(4) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +collation_name ¦ VARCHAR(8) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_key ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +extra ¦ VARCHAR(24) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +privileges ¦ VARCHAR(31) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_comment ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +generation_expression ¦ VARCHAR(500) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +srs_id ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ show columns from `PROFILING`; -Field Type Null Key Default Extra Comment -QUERY_ID INT(32) NO 0 -SEQ INT(32) NO 0 -STATE VARCHAR(30) NO -DURATION DECIMAL(9,6) NO 0.000000 -CPU_USER DECIMAL(9,6) YES null -CPU_SYSTEM DECIMAL(9,6) YES null -CONTEXT_VOLUNTARY INT(32) YES null -CONTEXT_INVOLUNTARY INT(32) YES null -BLOCK_OPS_IN INT(32) YES null -BLOCK_OPS_OUT INT(32) YES null -MESSAGES_SENT INT(32) YES null -MESSAGES_RECEIVED INT(32) YES null -PAGE_FAULTS_MAJOR INT(32) YES null -PAGE_FAULTS_MINOR INT(32) YES null -SWAPS INT(32) YES null -SOURCE_FUNCTION VARCHAR(30) YES null -SOURCE_FILE VARCHAR(20) YES null -SOURCE_LINE INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +QUERY_ID ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +SEQ ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +STATE ¦ VARCHAR(30) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +DURATION ¦ DECIMAL(9,6) ¦ NO ¦ ¦ 0.000000 ¦ ¦ 𝄀 +CPU_USER ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CPU_SYSTEM ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_VOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_INVOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_IN ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_OUT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_SENT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_RECEIVED ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MAJOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MINOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SWAPS ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FUNCTION ¦ VARCHAR(30) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FILE ¦ VARCHAR(20) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_LINE ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ show columns from `USER_PRIVILEGES`; -Field Type Null Key Default Extra Comment -GRANTEE VARCHAR(292) NO -TABLE_CATALOG VARCHAR(512) NO -PRIVILEGE_TYPE VARCHAR(64) NO -IS_GRANTABLE VARCHAR(3) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +GRANTEE ¦ VARCHAR(292) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +TABLE_CATALOG ¦ VARCHAR(512) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +PRIVILEGE_TYPE ¦ VARCHAR(64) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +IS_GRANTABLE ¦ VARCHAR(3) ¦ NO ¦ ¦ ¦ ¦ show columns from `SCHEMATA`; -Field Type Null Key Default Extra Comment -catalog_name VARCHAR(3) NO null -schema_name VARCHAR(5000) YES null -default_character_set_name VARCHAR(7) NO null -default_collation_name VARCHAR(18) NO null -sql_path CHAR(0) YES null -default_encryption VARCHAR(3) NO null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +catalog_name ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +schema_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_character_set_name ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +default_collation_name ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +sql_path ¦ CHAR(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_encryption ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ show columns from `CHARACTER_SETS`; -Field Type Null Key Default Extra Comment -CHARACTER_SET_NAME VARCHAR(64) YES null -DEFAULT_COLLATE_NAME VARCHAR(64) YES null -DESCRIPTION VARCHAR(2048) YES null -MAXLEN INT UNSIGNED(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +CHARACTER_SET_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFAULT_COLLATE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DESCRIPTION ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MAXLEN ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ show columns from `TRIGGERS`; -Field Type Null Key Default Extra Comment -TRIGGER_CATALOG VARCHAR(64) YES null -TRIGGER_SCHEMA VARCHAR(64) YES null -TRIGGER_NAME VARCHAR(64) YES null -EVENT_MANIPULATION VARCHAR(10) YES null -EVENT_OBJECT_CATALOG VARCHAR(64) YES null -EVENT_OBJECT_SCHEMA VARCHAR(64) YES null -EVENT_OBJECT_TABLE VARCHAR(64) YES null -ACTION_ORDER INT UNSIGNED(32) YES null -ACTION_CONDITION BINARY(0) YES null -ACTION_STATEMENT TEXT(0) YES null -ACTION_ORIENTATION VARCHAR(3) YES null -ACTION_TIMING VARCHAR(10) YES null -ACTION_REFERENCE_OLD_TABLE BINARY(0) YES null -ACTION_REFERENCE_NEW_TABLE BINARY(0) YES null -ACTION_REFERENCE_OLD_ROW VARCHAR(3) YES null -ACTION_REFERENCE_NEW_ROW VARCHAR(3) YES null -CREATED TIMESTAMP(2) YES null -SQL_MODE VARCHAR(10) YES null -DEFINER VARCHAR(288) YES null -CHARACTER_SET_CLIENT VARCHAR(64) YES null -COLLATION_CONNECTION VARCHAR(64) YES null -DATABASE_COLLATION VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +TRIGGER_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_MANIPULATION ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_TABLE ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORDER ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_CONDITION ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_STATEMENT ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORIENTATION ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_TIMING ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CREATED ¦ TIMESTAMP(2) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SQL_MODE ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFINER ¦ VARCHAR(288) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CHARACTER_SET_CLIENT ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +COLLATION_CONNECTION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DATABASE_COLLATION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ show columns from `TABLES`; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(5000) YES null -table_name VARCHAR(5000) YES null -table_type VARCHAR(14) YES null -engine VARCHAR(3) YES null -version BIGINT(0) YES null -row_format VARCHAR(10) NO null -table_rows BIGINT(0) YES null -avg_row_length BIGINT(0) YES null -data_length BIGINT(0) YES null -max_data_length BIGINT(0) YES null -index_length BIGINT(0) YES null -data_free BIGINT(0) YES null -auto_increment BIGINT UNSIGNED(0) YES null -create_time TIMESTAMP(0) YES null -update_time TIMESTAMP(0) YES null -check_time TIMESTAMP(0) YES null -table_collation VARCHAR(18) NO null -checksum BIGINT(0) YES null -create_options VARCHAR(256) YES null -table_comment TEXT(0) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_type ¦ VARCHAR(14) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +engine ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +version ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +row_format ¦ VARCHAR(10) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_rows ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +avg_row_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +max_data_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +index_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_free ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +auto_increment ¦ BIGINT UNSIGNED(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +create_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +update_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +check_time ¦ TIMESTAMP(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_collation ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +checksum ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +create_options ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_comment ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ show columns from `PARTITIONS`; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(5000) YES null -table_name VARCHAR(5000) YES null -partition_name VARCHAR(64) YES null -subpartition_name TEXT(4) YES null -partition_ordinal_position SMALLINT UNSIGNED(16) YES null -subpartition_ordinal_position TEXT(4) YES null -partition_method VARCHAR(13) YES null -subpartition_method TEXT(4) YES null -partition_expression VARCHAR(2048) YES null -subpartition_expression TEXT(4) YES null -partition_description TEXT(0) YES null -table_rows BIGINT(0) YES null -avg_row_length BIGINT(0) NO null -data_length BIGINT(0) YES null -max_data_length BIGINT(0) NO null -index_length BIGINT(0) NO null -data_free BIGINT(0) NO null -create_time TIMESTAMP(0) YES null -update_time TEXT(4) YES null -check_time TEXT(4) YES null -checksum TEXT(4) YES null -partition_comment VARCHAR(2048) NO null -nodegroup VARCHAR(7) NO null -tablespace_name TEXT(4) YES null +[unknown result because it is related to issue#16438] use mo_catalog; show columns from `mo_data_key`; -Field Type Null Key Default Extra Comment -account_id BIGINT UNSIGNED(64) NO PRI null -key_id UUID(0) NO PRI null -encrypted_key VARCHAR(128) YES null -create_time TIMESTAMP(0) NO current_timestamp() -update_time TIMESTAMP(0) NO current_timestamp() +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +account_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +key_id ¦ UUID(0) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +encrypted_key ¦ VARCHAR(128) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +create_time ¦ TIMESTAMP(0) ¦ NO ¦ ¦ current_timestamp() ¦ ¦ 𝄀 +update_time ¦ TIMESTAMP(0) ¦ NO ¦ ¦ current_timestamp() ¦ ¦ drop database if exists test; create database test; use test; drop table if exists t2; create table t2(b int, a int); desc t2; -Field Type Null Key Default Extra Comment -b INT(32) YES null -a INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +b ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +a ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ drop table t2; drop database test; diff --git a/test/distributed/cases/foreign_key/fk_base.result b/test/distributed/cases/foreign_key/fk_base.result index c7c4b0b2b6b88..4233c0a4650a5 100644 --- a/test/distributed/cases/foreign_key/fk_base.result +++ b/test/distributed/cases/foreign_key/fk_base.result @@ -8,9 +8,9 @@ create table c1 (a int, b int, foreign key f_a(a) references f2(aa)); internal error: type of reference column 'aa' is not match for column 'a' create table c1 (a int, b int, foreign key f_a(a) references f1(a)); select * from f1; -a b +➤ b[4,32,0] ¦ a[4,32,0] select * from c1; -a b +➤ a[4,32,0] ¦ b[4,32,0] drop table f1; internal error: can not drop table 'f1' referenced by some foreign key constraint truncate f1; @@ -32,18 +32,18 @@ create table c1 (a int, b int, foreign key f_a(a) references f1(a) on delete set insert into c1 values (1,1), (2,2), (3,3); delete from f1 where a > 1; select * from c1; -a b -1 1 -NULL 2 -NULL 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +1 ¦ 1 𝄀 +null ¦ 2 𝄀 +null ¦ 3 drop table c1; insert into f1 values (2,2), (3,3); create table c1 (a int, b int, foreign key f_a(a) references f1(a) on delete cascade); insert into c1 values (1,1), (2,2), (3,3); delete from f1 where a > 1; select * from c1; -a b -1 1 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +1 ¦ 1 drop table c1; drop table f1; create table f1(a int primary key, b int unique key); @@ -56,25 +56,25 @@ update c1 set a = 11 where b = 1; Cannot add or update a child row: a foreign key constraint fails update c1 set a = null where b = 1; select * from c1 order by b; -a b -NULL 1 -2 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +null ¦ 1 𝄀 +2 ¦ 2 𝄀 +3 ¦ 3 update c1 set a = 3 where b = 2; select * from c1 order by b; -a b -NULL 1 -3 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +null ¦ 1 𝄀 +3 ¦ 2 𝄀 +3 ¦ 3 drop table c1; create table c1 (a int, b int, foreign key f_a(a) references f1(a) on update set null); insert into c1 values (1,1), (2,2), (3,3); update f1 set a=11 where a=1; select * from c1 order by b; -a b -NULL 1 -2 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +null ¦ 1 𝄀 +2 ¦ 2 𝄀 +3 ¦ 3 drop table c1; drop table f1; create table f1(a int primary key, b int unique key); @@ -85,10 +85,10 @@ update f1 set a=0 where b>1; Duplicate entry '0' for key 'a' update f1 set a=0 where b=1; select * from c1 order by b; -a b -0 1 -2 2 -3 3 +➤ a[4,32,0] ¦ b[4,32,0] 𝄀 +0 ¦ 1 𝄀 +2 ¦ 2 𝄀 +3 ¦ 3 drop table c1; drop table f1; drop table if exists t_dept; @@ -127,21 +127,21 @@ update t_emp set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp set deptId = null where salary < 1500; select * from t_emp order by salary; -id name deptid salary -7521 WARD null 1250.0 -1234 MEIXI null 1250.0 -7369 SMITH null 1300.0 -7499 ALLEN 30 1600.0 -7698 BLAKE 30 2850.0 -7782 CLARK 10 2950.0 -7566 JONES 20 3475.0 -7788 SCOTT 20 3500.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7521 ¦ WARD ¦ null ¦ 1250.0 𝄀 +1234 ¦ MEIXI ¦ null ¦ 1250.0 𝄀 +7369 ¦ SMITH ¦ null ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7782 ¦ CLARK ¦ 10 ¦ 2950.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 select * from t_dept; -id name location -10 ACCOUNTING NEW YORK -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +10 ¦ ACCOUNTING ¦ NEW YORK 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON drop table t_emp; drop table t_dept; drop table if exists t_dept1; @@ -174,36 +174,36 @@ INSERT INTO t_emp1 VALUES (7782,'CLARK',10,2950.00); INSERT INTO t_emp1 VALUES (7788,'SCOTT',20,3500.00); update t_dept1 set id = 50 where name = 'ACCOUNTING'; select * from t_dept1; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON -50 ACCOUNTING NEW YORK +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON 𝄀 +50 ¦ ACCOUNTING ¦ NEW YORK select * from t_emp1; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 -7782 CLARK 50 2950.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 +7782 ¦ CLARK ¦ 50 ¦ 2950.0 delete from t_dept1 where name = 'ACCOUNTING'; select * from t_dept1; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON select * from t_emp1; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 update t_emp1 set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp1 set deptId = null where salary < 1500; @@ -239,37 +239,37 @@ INSERT INTO t_emp2 VALUES (7782,'CLARK',10,2950.00); INSERT INTO t_emp2 VALUES (7788,'SCOTT',20,3500.00); update t_dept2 set id = 50 where name = 'ACCOUNTING'; select * from t_dept2; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON -50 ACCOUNTING NEW YORK +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON 𝄀 +50 ¦ ACCOUNTING ¦ NEW YORK select * from t_emp2; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 -7782 CLARK null 2950.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 +7782 ¦ CLARK ¦ null ¦ 2950.0 delete from t_dept2 where name = 'ACCOUNTING'; select * from t_dept2; -id name location -20 RESEARCH DALLAS -30 SALES CHICAGO -40 OPERATIONS BOSTON +➤ id[4,32,0] ¦ name[12,-1,0] ¦ location[12,-1,0] 𝄀 +20 ¦ RESEARCH ¦ DALLAS 𝄀 +30 ¦ SALES ¦ CHICAGO 𝄀 +40 ¦ OPERATIONS ¦ BOSTON select * from t_emp2; -id name deptid salary -7369 SMITH 20 1300.0 -7499 ALLEN 30 1600.0 -7521 WARD 30 1250.0 -7566 JONES 20 3475.0 -1234 MEIXI 30 1250.0 -7698 BLAKE 30 2850.0 -7788 SCOTT 20 3500.0 -7782 CLARK null 2950.0 +➤ id[4,32,0] ¦ name[12,-1,0] ¦ deptid[4,32,0] ¦ salary[7,24,0] 𝄀 +7369 ¦ SMITH ¦ 20 ¦ 1300.0 𝄀 +7499 ¦ ALLEN ¦ 30 ¦ 1600.0 𝄀 +7521 ¦ WARD ¦ 30 ¦ 1250.0 𝄀 +7566 ¦ JONES ¦ 20 ¦ 3475.0 𝄀 +1234 ¦ MEIXI ¦ 30 ¦ 1250.0 𝄀 +7698 ¦ BLAKE ¦ 30 ¦ 2850.0 𝄀 +7788 ¦ SCOTT ¦ 20 ¦ 3500.0 𝄀 +7782 ¦ CLARK ¦ null ¦ 2950.0 update t_emp2 set deptId = 50 where salary < 1500; Cannot add or update a child row: a foreign key constraint fails update t_emp2 set deptId = null where salary < 1500; @@ -287,10 +287,10 @@ update c1 set aaa=4, bbb=22 where bbb=11; Cannot add or update a child row: a foreign key constraint fails update c1 set aaa=2, bbb=33 where bbb=11; select * from c1 order by bbb; -aaa bbbb -2 22 -3 33 -2 33 +➤ aaa[4,32,0] ¦ bbb[4,32,0] 𝄀 +2 ¦ 22 𝄀 +3 ¦ 33 𝄀 +2 ¦ 33 drop table c1; drop table f2; drop table f1; @@ -317,7 +317,9 @@ create table fk_01(a int,b varchar(20),c tinyint,primary key(a,b)); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1,col2) REFERENCES fk_01(a,b) on delete RESTRICT on update RESTRICT); create table fk_03(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col1) REFERENCES fk_01(a) on delete RESTRICT on update RESTRICT); create table fk_04(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(b) on delete RESTRICT on update RESTRICT); +internal error: failed to add the foreign key constraint drop table fk_04; +no such table fk_base.fk_04 drop table fk_03; drop table fk_02; drop table fk_01; @@ -354,7 +356,7 @@ drop database db1; create database db1; use db1; show tables; -Tables_in_db1 +➤ Tables_in_db1[12,-1,0] drop database db1; create account acc1 ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database db2; @@ -367,7 +369,7 @@ drop database db2; create database db2; use db2; show tables; -Tables_in_db2 +➤ Tables_in_db2[12,-1,0] drop database db2; drop account if exists acc1; drop database if exists db1; diff --git a/test/distributed/cases/foreign_key/foreign_key.result b/test/distributed/cases/foreign_key/foreign_key.result index 8de680e2665fd..66ca0e7ab08ad 100644 --- a/test/distributed/cases/foreign_key/foreign_key.result +++ b/test/distributed/cases/foreign_key/foreign_key.result @@ -1,21 +1,26 @@ create table fk_01(col1 varchar(30) not null primary key,col2 int); create table fk_02(col1 int,col2 varchar(25),col3 tinyint,constraint ck foreign key(col2) REFERENCES fk_01(col1)); show create table fk_02; -Table Create Table -fk_02 CREATE TABLE `fk_02` (\n `col1` int DEFAULT NULL,\n `col2` varchar(25) DEFAULT NULL,\n `col3` tinyint DEFAULT NULL,\n CONSTRAINT `ck` FOREIGN KEY (`col2`) REFERENCES `fk_01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +fk_02 ¦ CREATE TABLE `fk_02` ( + `col1` int DEFAULT NULL, + `col2` varchar(25) DEFAULT NULL, + `col3` tinyint DEFAULT NULL, + CONSTRAINT `ck` FOREIGN KEY (`col2`) REFERENCES `fk_01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_01 values ('90',5983),('100',734),('190',50); insert into fk_02(col2,col3) values ('90',5),('90',4),('100',0),(NULL,80); select * from fk_01; -col1 col2 -90 5983 -100 734 -190 50 +➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 734 𝄀 +190 ¦ 50 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null 100 0 -null null 80 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ 100 ¦ 0 𝄀 +null ¦ null ¦ 80 insert into fk_02(col2,col3) values ('200',5); internal error: Cannot add or update a child row: a foreign key constraint fails update fk_02 set col2='80' where col2='90'; @@ -26,26 +31,26 @@ delete from fk_01 where col1='90'; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_01 where col1='190'; select * from fk_01; -col1 col2 -90 5983 -100 734 +➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 734 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null 100 0 -null null 80 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ 100 ¦ 0 𝄀 +null ¦ null ¦ 80 update fk_01 set col2=500 where col2=734; delete from fk_02 where col2='100'; select * from fk_01; -col1 col2 -90 5983 -100 500 +➤ col1[12,-1,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 500 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null null 80 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ null ¦ 80 drop table fk_02; drop table fk_01; create table fk_01(col1 char(30) primary key,col2 int); @@ -57,15 +62,15 @@ insert into fk_02(col2,col3) values ('90',5),('90',4),('100',0); truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint select * from fk_01; -col1 col2 -90 5983 -100 734 -190 50 +➤ col1[1,30,0] ¦ col2[4,32,0] 𝄀 +90 ¦ 5983 𝄀 +100 ¦ 734 𝄀 +190 ¦ 50 select * from fk_02; -col1 col2 col3 -null 90 5 -null 90 4 -null 100 0 +➤ col1[4,32,0] ¦ col2[1,25,0] ¦ col3[-6,8,0] 𝄀 +null ¦ 90 ¦ 5 𝄀 +null ¦ 90 ¦ 4 𝄀 +null ¦ 100 ¦ 0 drop table fk_02; drop table fk_01; create table fk_01(col1 int auto_increment primary key,col2 varchar(25),col3 tinyint); @@ -78,38 +83,38 @@ insert into fk_01 values (2,'yellow',20),(10,'apple',50),(11,'opppo',51); insert into fk_02 values(2,'score',1),(2,'student',4),(10,'goods',2); insert into fk_02 values(NULL,NULL,NULL); select * from fk_01; -col1 col2 col3 -2 yellow 20 -10 apple 50 -11 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +10 ¦ apple ¦ 50 𝄀 +11 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 -2 score 1 -2 student 4 -10 goods 2 -null null null +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ score ¦ 1 𝄀 +2 ¦ student ¦ 4 𝄀 +10 ¦ goods ¦ 2 𝄀 +null ¦ null ¦ null update fk_02 set col1=10 where col3=4; select * from fk_02; -col1 col2 col3 -2 score 1 -10 goods 2 -null null null -10 student 4 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ score ¦ 1 𝄀 +10 ¦ goods ¦ 2 𝄀 +null ¦ null ¦ null 𝄀 +10 ¦ student ¦ 4 update fk_02 set col1=20 where col3=4; Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(15,'ssss',10); internal error: Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=11; select * from fk_01; -col1 col2 col3 -2 yellow 20 -10 apple 50 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +10 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -2 score 1 -10 goods 2 -null null null -10 student 4 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ score ¦ 1 𝄀 +10 ¦ goods ¦ 2 𝄀 +null ¦ null ¦ null 𝄀 +10 ¦ student ¦ 4 update fk_01 set col3=110 where col1=10; delete from fk_01 where col1=2; internal error: Cannot delete or update a parent row: a foreign key constraint fails @@ -117,7 +122,7 @@ truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint truncate table fk_02; select * from fk_02; -col1 col2 col3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -129,15 +134,15 @@ insert into fk_02 values(2,'apple',1),(2,'apple',4),(1,'opppo',2); insert into fk_02 values(20,'score',1),(12,'apple',4),(1,'yellow',2); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 yellow 20 -2 apple 50 -1 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 𝄀 +1 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 -2 apple 1 -2 apple 4 -1 opppo 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ apple ¦ 1 𝄀 +2 ¦ apple ¦ 4 𝄀 +1 ¦ opppo ¦ 2 update fk_02 set col1=3 where col1=2; Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=2 and col2='apple'; @@ -147,25 +152,25 @@ Cannot delete or update a parent row: a foreign key constraint fails update fk_01 set col1=1 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 yellow 20 -2 apple 50 -1 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 𝄀 +1 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 -2 apple 1 -2 apple 4 -1 opppo 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ apple ¦ 1 𝄀 +2 ¦ apple ¦ 4 𝄀 +1 ¦ opppo ¦ 2 delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_02; select * from fk_01; -col1 col2 col3 -2 yellow 20 -2 apple 50 -1 opppo 51 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 𝄀 +1 ¦ opppo ¦ 51 select * from fk_02; -col1 col2 col3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] drop table fk_02; drop table fk_01; create table fk_01(col1 bigint primary key,col2 varchar(25),col3 tinyint); @@ -177,35 +182,35 @@ insert into fk_02 values(4,'age',3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(1,'score',1),(2,'student',NULL); select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -1 score 1 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ score ¦ 1 𝄀 +2 ¦ student ¦ null update fk_02 set col3=4 where col3=1; select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 delete from fk_01 where col1=1; select * from fk_02; -col1 col2 col3 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ student ¦ null update fk_01 set col1=5 where col2='apple'; select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -5 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ student ¦ null delete from fk_02 where col1=5; select * from fk_02; -col1 col2 col3 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 drop table fk_02; drop table fk_01; create table fk_01(col1 decimal(38,18),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); @@ -217,35 +222,35 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 col4 -23.100000000000000000 a 20 2022-10-01 -23.100000000000000000 a 21 2022-10-01 -23.100000000000000000 a 20 2022-10-02 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100000000000000000 a 20 2022-10-01 -23.100000000000000000 a 21 2022-10-01 -23.100000000000000000 a 20 2022-10-02 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100000000000000000 ¦ a ¦ 20 ¦ 2022-10-02 update fk_02 set col3=19 where col3=20; Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col3=20; select * from fk_01; -col1 col2 col3 col4 -23.100000000000000000 a 21 2022-10-01 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 select * from fk_02; -col1 col2 col3 col4 -23.100000000000000000 a 21 2022-10-01 -null a null null -null a null null +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +null ¦ a ¦ null ¦ null 𝄀 +null ¦ a ¦ null ¦ null update fk_01 set col3=19 where col2='a'; select * from fk_01; -col1 col2 col3 col4 -23.100000000000000000 a 19 2022-10-01 +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100000000000000000 ¦ a ¦ 19 ¦ 2022-10-01 select * from fk_02; -col1 col2 col3 col4 -null a null null -null a null null -null a null null +➤ col1[3,38,18] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +null ¦ a ¦ null ¦ null 𝄀 +null ¦ a ¦ null ¦ null 𝄀 +null ¦ a ¦ null ¦ null drop table fk_02; drop table fk_01; create table fk_01(col1 int primary key auto_increment,col2 varchar(25),col3 varchar(50)); @@ -259,39 +264,39 @@ Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -2 cc dd 1 -3 ee ff 1 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +2 ¦ cc ¦ dd ¦ 1 𝄀 +3 ¦ ee ¦ ff ¦ 1 delete from fk_02 where col4=1; delete from fk_01 where col1=1; select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 update fk_01 set col1=8 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -302,71 +307,71 @@ insert into fk_01(col2,col3) values ('non-failing','deli'),('safer','prow'),('ul insert into fk_02(col2,col3,col4) values('aa','bb',2),('cc','dd',1),('ee','ff',1); insert into fk_02(col2,col3,col4) values('aa','bb',3); select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong -4 aaa bbb -select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -2 cc dd 1 -3 ee ff 1 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb +select * from fk_02; +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +2 ¦ cc ¦ dd ¦ 1 𝄀 +3 ¦ ee ¦ ff ¦ 1 𝄀 +4 ¦ aa ¦ bb ¦ 3 delete from fk_01 where col1=1; internal error: Cannot delete or update a parent row: a foreign key constraint fails delete from fk_02 where col4=1; select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong -4 aaa bbb +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb update fk_01 set col1=8 where col1=2; Cannot delete or update a parent row: a foreign key constraint fails update fk_02 set col4=5 where col3='ff'; select * from fk_01; -col1 col2 col3 -1 non-failing deli -2 safer prow -3 ultra strong -4 aaa bbb +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ non-failing ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 update fk_01 set col2='window' where col1=1; delete from fk_01 where col1=3; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -2 safer prow -3 ultra strong -4 aaa bbb -1 window deli +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb 𝄀 +1 ¦ window ¦ deli select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 truncate table fk_01; internal error: can not truncate table 'fk_01' referenced by some foreign key constraint insert into fk_01(col2,col3) values ('zhi','gao'),('er','li'); select * from fk_01 order by col1; -col1 col2 col3 -1 window deli -2 safer prow -3 ultra strong -4 aaa bbb -9 zhi gao -10 er li -select * from fk_02; -col1 col2 col3 col4 -1 aa bb 2 -4 aa bb 3 +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[12,-1,0] 𝄀 +1 ¦ window ¦ deli 𝄀 +2 ¦ safer ¦ prow 𝄀 +3 ¦ ultra ¦ strong 𝄀 +4 ¦ aaa ¦ bbb 𝄀 +9 ¦ zhi ¦ gao 𝄀 +10 ¦ er ¦ li +select * from fk_02; +➤ col1[4,32,0] ¦ col2[12,-1,0] ¦ col3[1,5,0] ¦ col4[4,32,0] 𝄀 +1 ¦ aa ¦ bb ¦ 2 𝄀 +4 ¦ aa ¦ bb ¦ 3 drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint drop table fk_02; @@ -380,35 +385,35 @@ insert into fk_02 values(4,'age',3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(1,'score',1),(2,'student',NULL); select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -1 score 1 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ score ¦ 1 𝄀 +2 ¦ student ¦ null update fk_02 set col3=4 where col3=1; select * from fk_01; -col1 col2 col3 -1 yellow 20 -2 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +1 ¦ yellow ¦ 20 𝄀 +2 ¦ apple ¦ 50 delete from fk_01 where col1=1; select * from fk_02; -col1 col2 col3 -2 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +2 ¦ student ¦ null update fk_01 set col1=5 where col2='apple'; select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 select * from fk_02; -col1 col2 col3 -5 student null +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ student ¦ null delete from fk_02 where col1=5; select * from fk_02; -col1 col2 col3 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] select * from fk_01; -col1 col2 col3 -5 apple 50 +➤ col1[-5,64,0] ¦ col2[12,-1,0] ¦ col3[-6,8,0] 𝄀 +5 ¦ apple ¦ 50 drop table fk_02; drop table fk_01; create table fk_01(id int primary key auto_increment,title varchar(25)); @@ -423,34 +428,34 @@ update fk_03 set book_id=6 where book_id=2; Cannot add or update a child row: a foreign key constraint fails update fk_03 set book_id=3 where book_id=2; select * from fk_03; -id book_id author_id -1 1 2 -3 3 1 -2 3 2 +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 +1 ¦ 1 ¦ 2 𝄀 +3 ¦ 3 ¦ 1 𝄀 +2 ¦ 3 ¦ 2 update fk_01 set id=5 where title='self'; select * from fk_03; -id book_id author_id -3 3 1 -2 3 2 -1 5 2 -select * from fk_01; -id title -2 method -3 console -5 self +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 +3 ¦ 3 ¦ 1 𝄀 +2 ¦ 3 ¦ 2 𝄀 +1 ¦ 5 ¦ 2 +select * from fk_01; +➤ id[4,32,0] ¦ title[12,-1,0] 𝄀 +2 ¦ method 𝄀 +3 ¦ console 𝄀 +5 ¦ self delete from fk_02 where id=1; select * from fk_02; -id name -2 wulan +➤ id[4,32,0] ¦ name[12,-1,0] 𝄀 +2 ¦ wulan select * from fk_03; -id book_id author_id -2 3 2 -1 5 2 +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] 𝄀 +2 ¦ 3 ¦ 2 𝄀 +1 ¦ 5 ¦ 2 delete from fk_03; drop table fk_01; internal error: can not drop table 'fk_01' referenced by some foreign key constraint select * from fk_03; -id book_id author_id +➤ id[4,32,0] ¦ book_id[4,32,0] ¦ author_id[4,32,0] drop table fk_02; internal error: can not drop table 'fk_02' referenced by some foreign key constraint drop table fk_03; @@ -465,14 +470,14 @@ internal error: Cannot add or update a child row: a foreign key constraint fails delete from fk_01 where col3='2001-10-09 01:00:09'; internal error: Cannot delete or update a parent row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 -9 2001-10-19 00:00:00 2001-10-09 01:00:09 -10 2011-12-09 00:00:00 2001-10-09 01:00:09 -11 2011-12-09 00:00:00 2001-10-09 01:00:09 +➤ col1[4,32,0] ¦ col2[93,64,0] ¦ col3[93,64,0] 𝄀 +9 ¦ 2001-10-19 00:00:00 ¦ 2001-10-09 01:00:09 𝄀 +10 ¦ 2011-12-09 00:00:00 ¦ 2001-10-09 01:00:09 𝄀 +11 ¦ 2011-12-09 00:00:00 ¦ 2001-10-09 01:00:09 select * from fk_02; -col1 col2 col3 col4 -9 2001-10-19 00:00:00 left 2001-10-09 01:00:09 -11 2011-12-09 00:00:00 right 2001-10-09 01:00:09 +➤ col1[4,32,0] ¦ col2[93,64,0] ¦ col3[1,25,0] ¦ col4[93,64,0] 𝄀 +9 ¦ 2001-10-19 00:00:00 ¦ left ¦ 2001-10-09 01:00:09 𝄀 +11 ¦ 2011-12-09 00:00:00 ¦ right ¦ 2001-10-09 01:00:09 drop table fk_02; drop table fk_01; create table fk_an_01(col1 int,col2 varchar(25),col3 tinyint,primary key(col2)); @@ -487,9 +492,9 @@ create table f1 (fa int primary key); CREATE TABLE c1 (ca INT, cb INT); ALTER TABLE c1 ADD CONSTRAINT ffa FOREIGN KEY (ca) REFERENCES f1(fa); desc c1; -Field Type Null Key Default Extra Comment -ca INT(32) YES MUL null -cb INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +ca ¦ INT(32) ¦ YES ¦ MUL ¦ null ¦ ¦ 𝄀 +cb ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ drop table if exists c1; drop table if exists f1; create table f1 (a int, b int, c int, d int, e int, primary key(a,b), unique key(c,d)); @@ -503,7 +508,7 @@ create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constrai insert into c1 values (1,1,1,1,1); delete from f1 where a=1 and b=2; select * from c1; -a f_a f_b f_c f_d +➤ a[4,32,0] ¦ f_a[4,32,0] ¦ f_b[4,32,0] ¦ f_c[4,32,0] ¦ f_d[4,32,0] drop table c1; create table c1 (a int primary key, f_a int, f_b int, f_c int, f_d int, constraint ck foreign key(f_a,f_b) REFERENCES f1(a,b)); drop table c1; @@ -519,30 +524,30 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 update fk_02 set col3=19 where col3=20; select * from fk_02; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 -23.100 a 19 2022-10-01 -23.100 a 19 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 19 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 19 ¦ 2022-10-02 delete from fk_01 where col3=20; select * from fk_01; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 select * from fk_02; -col1 col2 col3 col4 -null a 21 2022-10-01 -null a 19 2022-10-01 -null a 19 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +null ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +null ¦ a ¦ 19 ¦ 2022-10-01 𝄀 +null ¦ a ¦ 19 ¦ 2022-10-02 drop table if exists c1; drop table if exists f1; create table f1(a int, b int, c int, primary key(a,b)); @@ -551,24 +556,24 @@ create table c1(a int primary key, c_a int, c_b int, constraint c1_ck foreign ke insert into c1 values (1,2,1),(2,2,2),(3,2,3); update f1 set a=111 where b=1; select * from f1; -a b c -2 2 2 -2 3 3 -111 1 1 +➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 +2 ¦ 2 ¦ 2 𝄀 +2 ¦ 3 ¦ 3 𝄀 +111 ¦ 1 ¦ 1 select * from c1; -a c_a c_b -1 111 1 -2 111 2 -3 111 3 +➤ a[4,32,0] ¦ c_a[4,32,0] ¦ c_b[4,32,0] 𝄀 +1 ¦ 111 ¦ 1 𝄀 +2 ¦ 111 ¦ 2 𝄀 +3 ¦ 111 ¦ 3 delete from c1; insert into c1 values (1,2,1),(2,2,2),(3,2,3); delete from f1 where b=2; select * from f1; -a b c -2 3 3 -111 1 1 +➤ a[4,32,0] ¦ b[4,32,0] ¦ c[4,32,0] 𝄀 +2 ¦ 3 ¦ 3 𝄀 +111 ¦ 1 ¦ 1 select * from c1; -a c_a c_b +➤ a[4,32,0] ¦ c_a[4,32,0] ¦ c_b[4,32,0] drop table if exists fk_02; drop table if exists fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col3,col4)); @@ -580,32 +585,32 @@ internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_02 values(0.001,'b',20,'2022-10-01'),(4.5,'a',21,'2022-10-01'),(56,'a',20,'2022-10-02'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 update fk_02 set col3=19 where col3=20; select * from fk_02; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 -23.100 a 19 2022-10-01 -23.100 a 19 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 19 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 19 ¦ 2022-10-02 delete from fk_01 where col3=19; select * from fk_01; -col1 col2 col3 col4 -23.100 a 20 2022-10-01 -23.100 a 21 2022-10-01 -23.100 a 20 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 20 ¦ 2022-10-02 select * from fk_02; -col1 col2 col3 col4 -23.100 a 21 2022-10-01 -23.100 a 19 2022-10-01 -23.100 a 19 2022-10-02 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +23.100 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 19 ¦ 2022-10-01 𝄀 +23.100 ¦ a ¦ 19 ¦ 2022-10-02 drop table fk_02; drop table fk_01; create table fk_01(col1 decimal(38,3),col2 char(25),col3 int,col4 date,primary key(col1,col2), unique key(col3)); @@ -620,38 +625,38 @@ insert into fk_02 values(8.9,'c',20,'2022-10-01'),(null,'a',21,'2022-10-01'); insert into fk_02 values(3.5,'e',20,'2022-10-01'),(8.9,'a',21,'2022-10-01'); internal error: Cannot add or update a child row: a foreign key constraint fails select * from fk_01; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -6.000 a 21 2022-10-01 -4.300 c 20 2022-10-02 -select * from fk_02; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -8.900 a 21 2022-10-01 -6.000 a 20 2022-10-02 -8.900 c 20 2022-10-01 -null a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +4.300 ¦ c ¦ 20 ¦ 2022-10-02 +select * from fk_02; +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +8.900 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 +8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 +null ¦ a ¦ 21 ¦ 2022-10-01 update fk_02 set col1=6.0 where col3=21; select * from fk_02; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -6.000 a 20 2022-10-02 -8.900 c 20 2022-10-01 -6.000 a 21 2022-10-01 -6.000 a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 +8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 update fk_01 set col2='d' where col1=6.0; select * from fk_01; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -4.300 c 20 2022-10-02 -6.000 d 21 2022-10-01 -select * from fk_02; -col1 col2 col3 col4 -8.900 a 20 2022-10-01 -6.000 a 20 2022-10-02 -8.900 c 20 2022-10-01 -6.000 a 21 2022-10-01 -6.000 a 21 2022-10-01 +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +4.300 ¦ c ¦ 20 ¦ 2022-10-02 𝄀 +6.000 ¦ d ¦ 21 ¦ 2022-10-01 +select * from fk_02; +➤ col1[3,38,3] ¦ col2[1,25,0] ¦ col3[4,32,0] ¦ col4[91,64,0] 𝄀 +8.900 ¦ a ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 20 ¦ 2022-10-02 𝄀 +8.900 ¦ c ¦ 20 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 𝄀 +6.000 ¦ a ¦ 21 ¦ 2022-10-01 set autocommit=0; create table t1(a int primary key); insert into t1 values (1); diff --git a/test/distributed/cases/git4data/clone/clone_fk_after_alter.result b/test/distributed/cases/git4data/clone/clone_fk_after_alter.result index 247f29fc460ae..8598f192443e3 100644 --- a/test/distributed/cases/git4data/clone/clone_fk_after_alter.result +++ b/test/distributed/cases/git4data/clone/clone_fk_after_alter.result @@ -25,25 +25,31 @@ select table_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_alter_child_src' order by constraint_name; -table_name refer_table_name -child parent +➤ table_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ parent delete from fk_clone_alter_child_src.parent where id = 1; internal error: Cannot delete or update a parent row: a foreign key constraint fails create database fk_clone_alter_child_dst clone fk_clone_alter_child_src; select * from fk_clone_alter_child_dst.child order by id; -id parent_id payload -10 1 c1 -20 2 c2 +➤ id[4,32,0] ¦ parent_id[4,32,0] ¦ payload[12,-1,0] 𝄀 +10 ¦ 1 ¦ c1 𝄀 +20 ¦ 2 ¦ c2 show create table fk_clone_alter_child_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` varchar(64) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_child_parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_child_parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) delete from fk_clone_alter_child_dst.parent where id = 1; internal error: Cannot delete or update a parent row: a foreign key constraint fails insert into fk_clone_alter_child_dst.child values (30, 999, 'invalid'); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_clone_alter_child_dst.child values (30, 1, 'valid'); select count(*) from fk_clone_alter_child_dst.child; -count(*) +➤ count(*)[-5,64,0] 𝄀 3 drop database fk_clone_alter_child_dst; drop database fk_clone_alter_child_src; @@ -68,15 +74,27 @@ alter table fk_clone_alter_both_src.parent modify column description varchar(128 alter table fk_clone_alter_both_src.child add column created_at datetime; create database fk_clone_alter_both_dst clone fk_clone_alter_both_src; show create table fk_clone_alter_both_dst.parent; -Table Create Table -parent CREATE TABLE `parent` (\n `id` int NOT NULL,\n `code` varchar(16) DEFAULT NULL,\n `description` varchar(128) DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `code` (`code`)\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +parent ¦ CREATE TABLE `parent` ( + `id` int NOT NULL, + `code` varchar(16) DEFAULT NULL, + `description` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) show create table fk_clone_alter_both_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `created_at` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_both` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_both` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_alter_both_dst.child(id, parent_id) values (2, 404); internal error: Cannot add or update a child row: a foreign key constraint fails select count(*) from fk_clone_alter_both_dst.child; -count(*) +➤ count(*)[-5,64,0] 𝄀 1 drop database fk_clone_alter_both_dst; drop database fk_clone_alter_both_src; @@ -102,11 +120,24 @@ alter table fk_clone_siblings_src.child_b add column b1 int default 2; alter table fk_clone_siblings_src.child_a add column a2 int default 3; create database fk_clone_siblings_dst clone fk_clone_siblings_src; show create table fk_clone_siblings_dst.child_a; -Table Create Table -child_a CREATE TABLE `child_a` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `a1` int DEFAULT 1,\n `a2` int DEFAULT 3,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_sibling_a` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child_a ¦ CREATE TABLE `child_a` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `a1` int DEFAULT 1, + `a2` int DEFAULT 3, + PRIMARY KEY (`id`), + CONSTRAINT `fk_sibling_a` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) show create table fk_clone_siblings_dst.child_b; -Table Create Table -child_b CREATE TABLE `child_b` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `b1` int DEFAULT 2,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_sibling_b` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child_b ¦ CREATE TABLE `child_b` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `b1` int DEFAULT 2, + PRIMARY KEY (`id`), + CONSTRAINT `fk_sibling_b` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_siblings_dst.child_a values (1, 100, 1, 3); internal error: Cannot add or update a child row: a foreign key constraint fails insert into fk_clone_siblings_dst.child_b values (1, 100, 2); @@ -141,8 +172,8 @@ select leaf.id, middle.id, root.id from fk_clone_chain_dst.leaf leaf join fk_clone_chain_dst.middle middle on leaf.middle_id = middle.id join fk_clone_chain_dst.root root on middle.root_id = root.id; -id id id -1 1 1 +➤ id[4,32,0] ¦ id[4,32,0] ¦ id[4,32,0] 𝄀 +1 ¦ 1 ¦ 1 insert into fk_clone_chain_dst.leaf(id, middle_id) values (2, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_chain_dst; @@ -169,8 +200,15 @@ alter table fk_clone_composite_src.child add column payload varchar(32); alter table fk_clone_composite_src.child modify column payload varchar(64); create database fk_clone_composite_dst clone fk_clone_composite_src; show create table fk_clone_composite_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `tenant_id` int DEFAULT NULL,\n `object_id` int DEFAULT NULL,\n `payload` varchar(64) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_composite` FOREIGN KEY (`tenant_id`,`object_id`) REFERENCES `parent` (`tenant_id`,`object_id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `tenant_id` int DEFAULT NULL, + `object_id` int DEFAULT NULL, + `payload` varchar(64) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_composite` FOREIGN KEY (`tenant_id`,`object_id`) REFERENCES `parent` (`tenant_id`,`object_id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_composite_dst.child(id, tenant_id, object_id) values (2, 1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_composite_dst; @@ -194,8 +232,17 @@ alter table fk_clone_multi_parent_src.child add column payload int default 0; alter table fk_clone_multi_parent_src.child add column note varchar(32); create database fk_clone_multi_parent_dst clone fk_clone_multi_parent_src; show create table fk_clone_multi_parent_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_a_id` int DEFAULT NULL,\n `parent_b_id` int DEFAULT NULL,\n `payload` int DEFAULT 0,\n `note` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_multi_a` FOREIGN KEY (`parent_a_id`) REFERENCES `parent_a` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,\n CONSTRAINT `fk_multi_b` FOREIGN KEY (`parent_b_id`) REFERENCES `parent_b` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_a_id` int DEFAULT NULL, + `parent_b_id` int DEFAULT NULL, + `payload` int DEFAULT 0, + `note` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_multi_a` FOREIGN KEY (`parent_a_id`) REFERENCES `parent_a` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `fk_multi_b` FOREIGN KEY (`parent_b_id`) REFERENCES `parent_b` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_multi_parent_dst.child(id, parent_a_id, parent_b_id) values (1, 1, 1); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_multi_parent_dst; @@ -215,12 +262,19 @@ alter table fk_clone_self_src.node add column label varchar(32); alter table fk_clone_self_src.node add index idx_label(label); create database fk_clone_self_dst clone fk_clone_self_src; select id, parent_id from fk_clone_self_dst.node order by id; -id parent_id -1 null -2 1 +➤ id[4,32,0] ¦ parent_id[4,32,0] 𝄀 +1 ¦ null 𝄀 +2 ¦ 1 show create table fk_clone_self_dst.node; -Table Create Table -node CREATE TABLE `node` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `label` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx_label` (`label`),\n CONSTRAINT `fk_node_parent` FOREIGN KEY (`parent_id`) REFERENCES `node` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +node ¦ CREATE TABLE `node` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `label` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx_label` (`label`), + CONSTRAINT `fk_node_parent` FOREIGN KEY (`parent_id`) REFERENCES `node` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_self_dst.node(id, parent_id) values (3, 999); Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_self_dst; @@ -244,8 +298,15 @@ references fk_clone_recreate_fk_src.parent(id); alter table fk_clone_recreate_fk_src.child add column note varchar(32); create database fk_clone_recreate_fk_dst clone fk_clone_recreate_fk_src; show create table fk_clone_recreate_fk_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` varchar(32) DEFAULT NULL,\n `note` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_recreated` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` varchar(32) DEFAULT NULL, + `note` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_recreated` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_recreate_fk_dst.child(id, parent_id) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_recreate_fk_dst; @@ -265,13 +326,19 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_forward_src' order by constraint_name; -table_name constraint_name refer_table_name -child fk_forward parent +➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ fk_forward ¦ parent create table fk_clone_forward_src.parent (id int primary key); set foreign_key_checks = 1; show create table fk_clone_forward_src.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_forward` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_forward` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) insert into fk_clone_forward_src.child values (1, 404, 0); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_forward_src; @@ -292,13 +359,19 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_forward_drop_src' order by constraint_name; -table_name constraint_name refer_table_name -child fk_forward_drop parent +➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ fk_forward_drop ¦ parent create table fk_clone_forward_drop_src.parent (id int primary key); set foreign_key_checks = 1; show create table fk_clone_forward_drop_src.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `payload` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_forward_drop` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `payload` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_forward_drop` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION +) insert into fk_clone_forward_drop_src.child values (1, 404, 0); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_forward_drop_src; @@ -322,9 +395,9 @@ select table_name, constraint_name, refer_table_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_self_external_src' order by table_name, constraint_name; -table_name constraint_name refer_table_name -child fk_self_external_child parent -parent fk_self_external_self parent +➤ table_name[12,-1,0] ¦ constraint_name[12,-1,0] ¦ refer_table_name[12,-1,0] 𝄀 +child ¦ fk_self_external_child ¦ parent 𝄀 +parent ¦ fk_self_external_self ¦ parent drop table fk_clone_self_external_src.child; drop table fk_clone_self_external_src.parent; drop database fk_clone_self_external_src; @@ -347,12 +420,17 @@ select table_name, column_name, refer_table_name, refer_column_name from mo_catalog.mo_foreign_keys where db_name = 'fk_clone_rename_columns_src' order by constraint_name; -table_name column_name refer_table_name refer_column_name -child parent_id parent id +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] ¦ refer_table_name[12,-1,0] ¦ refer_column_name[12,-1,0] 𝄀 +child ¦ parent_id ¦ parent ¦ id create database fk_clone_rename_columns_dst clone fk_clone_rename_columns_src; show create table fk_clone_rename_columns_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_rename_columns` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_rename_columns` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_rename_columns_dst.child values (1, 404); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_rename_columns_dst; @@ -379,11 +457,17 @@ insert into fk_clone_snapshot_src.child(id, parent_id) values (2, 2); create database fk_clone_snapshot_dst clone fk_clone_snapshot_src {snapshot = 'fk_clone_alter_snapshot'}; show create table fk_clone_snapshot_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `before_snapshot` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_snapshot` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `before_snapshot` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_snapshot` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) select id, parent_id from fk_clone_snapshot_dst.child order by id; -id parent_id -1 1 +➤ id[4,32,0] ¦ parent_id[4,32,0] 𝄀 +1 ¦ 1 insert into fk_clone_snapshot_dst.child(id, parent_id) values (3, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_snapshot_dst; @@ -407,8 +491,15 @@ use fk_clone_chain_clone_mid; alter table fk_clone_chain_clone_mid.child add column middle_value int; create database fk_clone_chain_clone_dst clone fk_clone_chain_clone_mid; show create table fk_clone_chain_clone_dst.child; -Table Create Table -child CREATE TABLE `child` (\n `id` int NOT NULL,\n `parent_id` int DEFAULT NULL,\n `source_value` int DEFAULT NULL,\n `middle_value` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_clone_chain` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +child ¦ CREATE TABLE `child` ( + `id` int NOT NULL, + `parent_id` int DEFAULT NULL, + `source_value` int DEFAULT NULL, + `middle_value` int DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_clone_chain` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_chain_clone_dst.child(id, parent_id) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_chain_clone_dst; @@ -432,8 +523,14 @@ rename table fk_clone_rename_src.child to fk_clone_rename_src.renamed_child; alter table fk_clone_rename_src.renamed_child add column payload varchar(32); create database fk_clone_rename_dst clone fk_clone_rename_src; show create table fk_clone_rename_dst.renamed_child; -Table Create Table -renamed_child CREATE TABLE `renamed_child` (\n `id` int NOT NULL,\n `parent_key` int DEFAULT NULL,\n `payload` varchar(32) DEFAULT NULL,\n PRIMARY KEY (`id`),\n CONSTRAINT `fk_rename` FOREIGN KEY (`parent_key`) REFERENCES `renamed_parent` (`parent_key`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) +➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀 +renamed_child ¦ CREATE TABLE `renamed_child` ( + `id` int NOT NULL, + `parent_key` int DEFAULT NULL, + `payload` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_rename` FOREIGN KEY (`parent_key`) REFERENCES `renamed_parent` (`parent_key`) ON DELETE RESTRICT ON UPDATE RESTRICT +) insert into fk_clone_rename_dst.renamed_child(id, parent_key) values (1, 999); internal error: Cannot add or update a child row: a foreign key constraint fails drop database fk_clone_rename_dst; diff --git a/test/distributed/cases/system_variable/system_variables.result b/test/distributed/cases/system_variable/system_variables.result index 290f48da83954..f3a9f5217caf2 100644 --- a/test/distributed/cases/system_variable/system_variables.result +++ b/test/distributed/cases/system_variable/system_variables.result @@ -7,149 +7,149 @@ set wait_timeout = default; set tx_isolation = default; set tx_isolation = default; show variables like 'server_id'; -Variable_name Value -server_id uuid +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +server_id ¦ dd1dccb4-4d3c-41f8-b482-5251dc7a41bf select @@server_id; -@@server_id -uuid +➤ @@server_id[12,0,0] 𝄀 +dd1dccb4-4d3c-41f8-b482-5251dc7a41bf show variables like 'auto%'; -Variable_name Value -auto_generate_certs on -auto_increment_increment 1 -auto_increment_offset 1 -autocommit on -automatic_sp_privileges on +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_generate_certs ¦ on 𝄀 +auto_increment_increment ¦ 1 𝄀 +auto_increment_offset ¦ 1 𝄀 +autocommit ¦ on 𝄀 +automatic_sp_privileges ¦ on show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 1 set auto_increment_increment = 2; show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 2 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 2 set auto_increment_increment = 1+1; show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 2 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 2 set auto_increment_increment = 2*3; show variables like 'auto_increment_increment'; -Variable_name Value -auto_increment_increment 6 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +auto_increment_increment ¦ 6 show variables like 'init%'; -Variable_name Value -init_connect -init_file +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +init_connect ¦ 𝄀 +init_file ¦ show variables like 'init_connect'; -Variable_name Value -init_connect +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +init_connect ¦ show variables like 'interactive%'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 set interactive_timeout = 36600; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 36600 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 36600 set interactive_timeout = 30000+100; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 30100 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 30100 set global interactive_timeout = default; set @g_interactive_timeout_before = @@global.interactive_timeout; set global interactive_timeout = 30000+100; select @@global.interactive_timeout = @g_interactive_timeout_before; -@@interactive_timeout = @g_interactive_timeout_before +➤ @@global.interactive_timeout = @g_interactive_timeout_before[-7,1,0] 𝄀 0 show global variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 30100 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 30100 set global interactive_timeout = default; select @@session.interactive_timeout; -@@interactive_timeout +➤ @@interactive_timeout[12,0,0] 𝄀 30100 set interactive_timeout = 0; internal error: convert to the system variable int type failed set interactive_timeout = 1; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 1 set interactive_timeout = 86400; show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 set interactive_timeout = 86401; invalid input: interactive_timeout must be <= 86400 show variables like 'interactive_timeout'; -Variable_name Value -interactive_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +interactive_timeout ¦ 86400 show variables like 'lower%'; -Variable_name Value -lower_case_file_system off -lower_case_table_names 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +lower_case_file_system ¦ off 𝄀 +lower_case_table_names ¦ 1 show variables like 'lower_case_table_names'; -Variable_name Value -lower_case_table_names 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +lower_case_table_names ¦ 1 show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 60 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 60 set net_write_timeout = 70; show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 70 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 70 set net_write_timeout = 20*20; show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 400 set net_write_timeout = 60; show variables like 'net_write_timeout'; -Variable_name Value -net_write_timeout 60 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +net_write_timeout ¦ 60 show variables where variable_name like 'system%' and variable_name != 'system_time_zone'; -Variable_name Value +➤ Variable_name[12,0,0] ¦ Value[12,0,0] select @@system_time_zone != ''; -@@system_time_zone != +➤ @@system_time_zone != [-7,1,0] 𝄀 1 show variables like 'trans%'; -Variable_name Value -transaction_alloc_block_size 8192 -transaction_isolation REPEATABLE-READ -transaction_operator_open_log off -transaction_prealloc_size 4096 -transaction_read_only 0 -transferred off +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_alloc_block_size ¦ 8192 𝄀 +transaction_isolation ¦ REPEATABLE-READ 𝄀 +transaction_operator_open_log ¦ off 𝄀 +transaction_prealloc_size ¦ 4096 𝄀 +transaction_read_only ¦ 0 𝄀 +transferred ¦ off show variables like 'transaction_isolation'; -Variable_name Value -transaction_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_isolation ¦ REPEATABLE-READ show variables like 'wait%'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 set wait_timeout = 33600; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 33600 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 33600 set wait_timeout = 10; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 10 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 10 set wait_timeout = 0; internal error: convert to the system variable int type failed set wait_timeout = 1; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 1 set wait_timeout = 86400; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 set wait_timeout = 86401; invalid input: wait_timeout must be <= 86400 show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 set wait_timeout = 10; drop table if exists t; create table t( @@ -159,8 +159,8 @@ c int, primary key(a) ); show indexes from t; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t 0 PRIMARY 1 a A 0 NULL NULL YES a +➤ Table[12,-1,0] ¦ Non_unique[-5,64,0] ¦ Key_name[12,-1,0] ¦ Seq_in_index[4,32,0] ¦ Column_name[12,-1,0] ¦ Collation[12,-1,0] ¦ Cardinality[-5,64,0] ¦ Sub_part[12,-1,0] ¦ Packed[12,-1,0] ¦ Null[12,-1,0] ¦ Index_type[12,-1,0] ¦ Comment[1,0,0] ¦ Index_comment[12,-1,0] ¦ Index_params[12,-1,0] ¦ Visible[12,-1,0] ¦ Expression[12,-1,0] 𝄀 +t ¦ 0 ¦ PRIMARY ¦ 1 ¦ a ¦ A ¦ 0 ¦ NULL ¦ NULL ¦ ¦ ¦ ¦ ¦ ¦ YES ¦ a create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database db1; use db1; @@ -172,395 +172,395 @@ c int, primary key(a) ); show indexes from t; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t 0 PRIMARY 1 a A 0 NULL NULL YES a +➤ Table[12,-1,0] ¦ Non_unique[-5,64,0] ¦ Key_name[12,-1,0] ¦ Seq_in_index[4,32,0] ¦ Column_name[12,-1,0] ¦ Collation[12,-1,0] ¦ Cardinality[-5,64,0] ¦ Sub_part[12,-1,0] ¦ Packed[12,-1,0] ¦ Null[12,-1,0] ¦ Index_type[12,-1,0] ¦ Comment[1,0,0] ¦ Index_comment[12,-1,0] ¦ Index_params[12,-1,0] ¦ Visible[12,-1,0] ¦ Expression[12,-1,0] 𝄀 +t ¦ 0 ¦ PRIMARY ¦ 1 ¦ a ¦ A ¦ 0 ¦ NULL ¦ NULL ¦ ¦ ¦ ¦ ¦ ¦ YES ¦ a drop database db1; drop account acc_idx; use information_schema; show tables; -Tables_in_information_schema -character_sets -collations -column_privileges -columns -engines -events -files -key_column_usage -keywords -parameters -partitions -processlist -profiling -referential_constraints -routines -schema_privileges -schemata -statistics -table_constraints -table_privileges -tables -triggers -user_privileges +➤ Tables_in_information_schema[12,-1,0] 𝄀 +character_sets 𝄀 +collations 𝄀 +column_privileges 𝄀 +columns 𝄀 +engines 𝄀 +events 𝄀 +files 𝄀 +key_column_usage 𝄀 +keywords 𝄀 +parameters 𝄀 +partitions 𝄀 +processlist 𝄀 +profiling 𝄀 +referential_constraints 𝄀 +routines 𝄀 +schema_privileges 𝄀 +schemata 𝄀 +statistics 𝄀 +table_constraints 𝄀 +table_privileges 𝄀 +tables 𝄀 +triggers 𝄀 +user_privileges 𝄀 views desc key_column_usage; -Field Type Null Key Default Extra Comment -CONSTRAINT_CATALOG VARCHAR(64) YES null -CONSTRAINT_SCHEMA VARCHAR(64) YES null -CONSTRAINT_NAME VARCHAR(64) YES null -TABLE_CATALOG VARCHAR(64) YES null -TABLE_SCHEMA VARCHAR(64) YES null -TABLE_NAME VARCHAR(64) YES null -COLUMN_NAME VARCHAR(64) YES null -ORDINAL_POSITION INT UNSIGNED(32) YES null -POSITION_IN_UNIQUE_CONSTRAINT INT UNSIGNED(32) YES null -REFERENCED_TABLE_SCHEMA VARCHAR(64) YES null -REFERENCED_TABLE_NAME VARCHAR(64) YES null -REFERENCED_COLUMN_NAME VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +constraint_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +constraint_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_catalog ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +position_in_unique_constraint ¦ INT UNSIGNED(32) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_schema ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_table_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_column_name ¦ VARCHAR(64) ¦ NO ¦ ¦ null ¦ ¦ select table_name, column_name from key_column_usage limit 2; -table_name column_name +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] desc columns; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(256) YES null -table_name VARCHAR(256) YES null -column_name VARCHAR(256) YES null -ordinal_position INT(0) YES null -column_default VARCHAR(65535) YES null -is_nullable VARCHAR(3) YES null -data_type VARCHAR(65535) YES null -character_maximum_length BIGINT(0) YES null -character_octet_length BIGINT(0) YES null -numeric_precision BIGINT(0) YES null -numeric_scale BIGINT(0) YES null -datetime_precision BIGINT(0) YES null -character_set_name VARCHAR(4) YES null -collation_name VARCHAR(8) YES null -column_type VARCHAR(65535) YES null -column_key VARCHAR(3) YES null -extra VARCHAR(24) YES null -privileges VARCHAR(31) NO null -column_comment VARCHAR(2048) YES null -generation_expression VARCHAR(500) YES null -srs_id BIGINT(0) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_name ¦ VARCHAR(256) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ordinal_position ¦ INT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_default ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +is_nullable ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +data_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_maximum_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_octet_length ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +numeric_scale ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +datetime_precision ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +character_set_name ¦ VARCHAR(4) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +collation_name ¦ VARCHAR(8) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_type ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +column_key ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +extra ¦ VARCHAR(24) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +privileges ¦ VARCHAR(31) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +column_comment ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +generation_expression ¦ VARCHAR(500) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +srs_id ¦ BIGINT(0) ¦ YES ¦ ¦ null ¦ ¦ select table_name, column_name from columns where table_schema = 'mo_catalog' and column_name != '__mo_index_idx_col' and column_name != '__mo_index_pri_col' order by table_name, column_name limit 5; -table_name column_name -mo_account account_id -mo_account account_name -mo_account admin_name -mo_account comments -mo_account create_version +➤ table_name[12,-1,0] ¦ column_name[12,-1,0] 𝄀 +mo_account ¦ account_id 𝄀 +mo_account ¦ account_name 𝄀 +mo_account ¦ admin_name 𝄀 +mo_account ¦ comments 𝄀 +mo_account ¦ create_version desc views; -Field Type Null Key Default Extra Comment -table_catalog VARCHAR(3) NO null -table_schema VARCHAR(5000) YES null -table_name VARCHAR(5000) YES null -view_definition TEXT(0) YES null -check_option VARCHAR(4) NO null -is_updatable VARCHAR(3) NO null -definer VARCHAR(65535) YES null -security_type VARCHAR(7) NO null -character_set_client VARCHAR(7) NO null -collation_connection VARCHAR(18) NO null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +table_catalog ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +table_schema ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +table_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +view_definition ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +check_option ¦ VARCHAR(4) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +is_updatable ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +definer ¦ VARCHAR(65535) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +security_type ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +character_set_client ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +collation_connection ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ select table_schema, table_name, definer from views where table_schema = 'system' order by table_name; -table_schema table_name definer -system error_info root@localhost -system log_info root@localhost -system span_info root@localhost -system sql_statement_hotspot root@localhost +➤ table_schema[12,-1,0] ¦ table_name[12,-1,0] ¦ definer[12,-1,0] 𝄀 +system ¦ error_info ¦ root@localhost 𝄀 +system ¦ log_info ¦ root@localhost 𝄀 +system ¦ span_info ¦ root@localhost 𝄀 +system ¦ sql_statement_hotspot ¦ root@localhost desc profiling; -Field Type Null Key Default Extra Comment -QUERY_ID INT(32) NO 0 -SEQ INT(32) NO 0 -STATE VARCHAR(30) NO -DURATION DECIMAL(9,6) NO 0.000000 -CPU_USER DECIMAL(9,6) YES null -CPU_SYSTEM DECIMAL(9,6) YES null -CONTEXT_VOLUNTARY INT(32) YES null -CONTEXT_INVOLUNTARY INT(32) YES null -BLOCK_OPS_IN INT(32) YES null -BLOCK_OPS_OUT INT(32) YES null -MESSAGES_SENT INT(32) YES null -MESSAGES_RECEIVED INT(32) YES null -PAGE_FAULTS_MAJOR INT(32) YES null -PAGE_FAULTS_MINOR INT(32) YES null -SWAPS INT(32) YES null -SOURCE_FUNCTION VARCHAR(30) YES null -SOURCE_FILE VARCHAR(20) YES null -SOURCE_LINE INT(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +QUERY_ID ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +SEQ ¦ INT(32) ¦ NO ¦ ¦ 0 ¦ ¦ 𝄀 +STATE ¦ VARCHAR(30) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +DURATION ¦ DECIMAL(9,6) ¦ NO ¦ ¦ 0.000000 ¦ ¦ 𝄀 +CPU_USER ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CPU_SYSTEM ¦ DECIMAL(9,6) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_VOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CONTEXT_INVOLUNTARY ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_IN ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +BLOCK_OPS_OUT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_SENT ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MESSAGES_RECEIVED ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MAJOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +PAGE_FAULTS_MINOR ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SWAPS ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FUNCTION ¦ VARCHAR(30) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_FILE ¦ VARCHAR(20) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SOURCE_LINE ¦ INT(32) ¦ YES ¦ ¦ null ¦ ¦ select seq, state from profiling; -seq state +➤ seq[4,32,0] ¦ state[12,-1,0] desc user_privileges; -Field Type Null Key Default Extra Comment -GRANTEE VARCHAR(292) NO -TABLE_CATALOG VARCHAR(512) NO -PRIVILEGE_TYPE VARCHAR(64) NO -IS_GRANTABLE VARCHAR(3) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +GRANTEE ¦ VARCHAR(292) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +TABLE_CATALOG ¦ VARCHAR(512) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +PRIVILEGE_TYPE ¦ VARCHAR(64) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +IS_GRANTABLE ¦ VARCHAR(3) ¦ NO ¦ ¦ ¦ ¦ select grantee, table_catalog from user_privileges limit 2; -grantee table_catalog +➤ grantee[12,-1,0] ¦ table_catalog[12,-1,0] desc schemata; -Field Type Null Key Default Extra Comment -catalog_name VARCHAR(3) NO null -schema_name VARCHAR(5000) YES null -default_character_set_name VARCHAR(7) NO null -default_collation_name VARCHAR(18) NO null -sql_path CHAR(0) YES null -default_encryption VARCHAR(3) NO null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +catalog_name ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +schema_name ¦ VARCHAR(5000) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_character_set_name ¦ VARCHAR(7) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +default_collation_name ¦ VARCHAR(18) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +sql_path ¦ CHAR(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +default_encryption ¦ VARCHAR(3) ¦ NO ¦ ¦ null ¦ ¦ select catalog_name, schema_name from schemata where schema_name = 'mo_catalog' or schema_name = 'mo_task' order by catalog_name, schema_name; -catalog_name schema_name -def mo_catalog -def mo_task +➤ catalog_name[12,-1,0] ¦ schema_name[12,-1,0] 𝄀 +def ¦ mo_catalog 𝄀 +def ¦ mo_task desc character_sets; -Field Type Null Key Default Extra Comment -CHARACTER_SET_NAME VARCHAR(64) YES null -DEFAULT_COLLATE_NAME VARCHAR(64) YES null -DESCRIPTION VARCHAR(2048) YES null -MAXLEN INT UNSIGNED(32) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +CHARACTER_SET_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFAULT_COLLATE_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DESCRIPTION ¦ VARCHAR(2048) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +MAXLEN ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ select character_set_name, description, maxlen from character_sets limit 5; -character_set_name description maxlen -binary Binary pseudo charset 1 -utf8 UTF-8 Unicode 4 -utf8mb4 UTF-8 Unicode 4 +➤ character_set_name[12,-1,0] ¦ description[12,-1,0] ¦ maxlen[4,32,0] 𝄀 +binary ¦ Binary pseudo charset ¦ 1 𝄀 +utf8 ¦ UTF-8 Unicode ¦ 4 𝄀 +utf8mb4 ¦ UTF-8 Unicode ¦ 4 desc triggers; -Field Type Null Key Default Extra Comment -TRIGGER_CATALOG VARCHAR(64) YES null -TRIGGER_SCHEMA VARCHAR(64) YES null -TRIGGER_NAME VARCHAR(64) YES null -EVENT_MANIPULATION VARCHAR(10) YES null -EVENT_OBJECT_CATALOG VARCHAR(64) YES null -EVENT_OBJECT_SCHEMA VARCHAR(64) YES null -EVENT_OBJECT_TABLE VARCHAR(64) YES null -ACTION_ORDER INT UNSIGNED(32) YES null -ACTION_CONDITION BINARY(0) YES null -ACTION_STATEMENT TEXT(0) YES null -ACTION_ORIENTATION VARCHAR(3) YES null -ACTION_TIMING VARCHAR(10) YES null -ACTION_REFERENCE_OLD_TABLE BINARY(0) YES null -ACTION_REFERENCE_NEW_TABLE BINARY(0) YES null -ACTION_REFERENCE_OLD_ROW VARCHAR(3) YES null -ACTION_REFERENCE_NEW_ROW VARCHAR(3) YES null -CREATED TIMESTAMP(2) YES null -SQL_MODE VARCHAR(10) YES null -DEFINER VARCHAR(288) YES null -CHARACTER_SET_CLIENT VARCHAR(64) YES null -COLLATION_CONNECTION VARCHAR(64) YES null -DATABASE_COLLATION VARCHAR(64) YES null +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +TRIGGER_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +TRIGGER_NAME ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_MANIPULATION ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_CATALOG ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_SCHEMA ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +EVENT_OBJECT_TABLE ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORDER ¦ INT UNSIGNED(32) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_CONDITION ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_STATEMENT ¦ TEXT(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_ORIENTATION ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_TIMING ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_TABLE ¦ BINARY(0) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_OLD_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +ACTION_REFERENCE_NEW_ROW ¦ VARCHAR(3) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CREATED ¦ TIMESTAMP(2) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +SQL_MODE ¦ VARCHAR(10) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DEFINER ¦ VARCHAR(288) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +CHARACTER_SET_CLIENT ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +COLLATION_CONNECTION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ 𝄀 +DATABASE_COLLATION ¦ VARCHAR(64) ¦ YES ¦ ¦ null ¦ ¦ select trigger_name, action_order from triggers limit 3; -trigger_name action_order +➤ trigger_name[12,-1,0] ¦ action_order[4,32,0] use mysql; select host, user from user limit 2; -host user +➤ host[1,255,0] ¦ user[1,32,0] desc db; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Select_priv VARCHAR(10) NO N -Insert_priv VARCHAR(10) NO N -Update_priv VARCHAR(10) NO N -Delete_priv VARCHAR(10) NO N -Create_priv VARCHAR(10) NO N -Drop_priv VARCHAR(10) NO N -Grant_priv VARCHAR(10) NO N -References_priv VARCHAR(10) NO N -Index_priv VARCHAR(10) NO N -Alter_priv VARCHAR(10) NO N -Create_tmp_table_priv VARCHAR(10) NO N -Lock_tables_priv VARCHAR(10) NO N -Create_view_priv VARCHAR(10) NO N -Show_view_priv VARCHAR(10) NO N -Create_routine_priv VARCHAR(10) NO N -Alter_routine_priv VARCHAR(10) NO N -Execute_priv VARCHAR(10) NO N -Event_priv VARCHAR(10) NO N -Trigger_priv VARCHAR(10) NO N +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Select_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Insert_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Update_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Delete_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Drop_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Grant_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +References_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Index_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_tmp_table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Lock_tables_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Show_view_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Create_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Alter_routine_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Execute_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Event_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ 𝄀 +Trigger_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ N ¦ ¦ select db, user from db limit 5; -db user +➤ db[1,64,0] ¦ user[1,32,0] desc procs_priv; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Routine_name CHAR(64) NO PRI -Routine_type VARCHAR(10) NO PRI null -Grantor VARCHAR(288) NO MUL -Proc_priv VARCHAR(10) NO -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Routine_type ¦ VARCHAR(10) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Proc_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ select routine_name, routine_type from procs_priv limit 5; -routine_name routine_type +➤ routine_name[1,64,0] ¦ routine_type[12,-1,0] desc columns_priv; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Column_name CHAR(64) NO PRI -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Column_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ select table_name, column_name from columns_priv limit 5; -table_name column_name +➤ table_name[1,64,0] ¦ column_name[1,64,0] desc tables_priv; -Field Type Null Key Default Extra Comment -Host CHAR(255) NO PRI -Db CHAR(64) NO PRI -User CHAR(32) NO PRI -Table_name CHAR(64) NO PRI -Grantor VARCHAR(288) NO MUL -Timestamp TIMESTAMP(0) NO CURRENT_TIMESTAMP() -Table_priv VARCHAR(10) NO -Column_priv VARCHAR(10) NO +➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 +Host ¦ CHAR(255) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Db ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +User ¦ CHAR(32) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Table_name ¦ CHAR(64) ¦ NO ¦ PRI ¦ ¦ ¦ 𝄀 +Grantor ¦ VARCHAR(288) ¦ NO ¦ MUL ¦ ¦ ¦ 𝄀 +Timestamp ¦ TIMESTAMP(0) ¦ NO ¦ ¦ CURRENT_TIMESTAMP() ¦ ¦ 𝄀 +Table_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +Column_priv ¦ VARCHAR(10) ¦ NO ¦ ¦ ¦ ¦ select host, table_name from tables_priv limit 5; -host table_name +➤ host[1,255,0] ¦ table_name[1,64,0] show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 18446744073709551615 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 18446744073709551615 set sql_select_limit = 100000; show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 100000 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 100000 set sql_select_limit = 1; show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 1 SET SQL_SELECT_LIMIT = Default; show variables like 'sql_select_limit'; -Variable_name Value -sql_select_limit 18446744073709551615 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +sql_select_limit ¦ 18446744073709551615 show variables like 'max_allowed_packet'; -Variable_name Value -max_allowed_packet 67108864 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +max_allowed_packet ¦ 67108864 set max_allowed_packet = 10000; show variables like 'max_allowed_packet'; -Variable_name Value -max_allowed_packet 10000 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +max_allowed_packet ¦ 10000 set max_allowed_packet = default; show variables like 'max_allowed_packet'; -Variable_name Value -max_allowed_packet 67108864 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +max_allowed_packet ¦ 67108864 show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 10 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 10 set wait_timeout = 10000; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 10000 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 10000 set wait_timeout = default; show variables like 'wait_timeout'; -Variable_name Value -wait_timeout 86400 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +wait_timeout ¦ 86400 show variables like 'character_set_results'; -Variable_name Value -character_set_results utf8 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_results ¦ utf8 set character_set_server = default; show variables like 'character_set_results'; -Variable_name Value -character_set_results utf8 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_results ¦ utf8 show variables like 'character_set_server'; -Variable_name Value -character_set_server utf8mb4 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_server ¦ utf8mb4 set character_set_server = default; show variables like 'character_set_server'; -Variable_name Value -character_set_server utf8mb4 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +character_set_server ¦ utf8mb4 show variables like 'transaction_isolation'; -Variable_name Value -transaction_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_isolation ¦ REPEATABLE-READ set transaction_isolation = default; show variables like 'transaction_isolation'; -Variable_name Value -transaction_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +transaction_isolation ¦ REPEATABLE-READ show variables like 'tx_isolation'; -Variable_name Value -tx_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +tx_isolation ¦ REPEATABLE-READ set tx_isolation = default; show variables like 'tx_isolation'; -Variable_name Value -tx_isolation REPEATABLE-READ +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +tx_isolation ¦ REPEATABLE-READ select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES set @@sql_mode =''; select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 set @@sql_mode = 'ONLY_FULL_GROUP_BY'; select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 ONLY_FULL_GROUP_BY set @@sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"; select @@sql_mode; -@@sql_mode +➤ @@sql_mode[12,0,0] 𝄀 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES set @@sql_mode = default; set global long_query_time = 1.1; show global variables like 'long_query_time'; -Variable_name Value -long_query_time 1.1 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +long_query_time ¦ 1.1 set global long_query_time = default; show global variables like 'long_query_time'; -Variable_name Value -long_query_time 10 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +long_query_time ¦ 10 create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; create database test_for_navicat; create database test_for_navicat; SELECT SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA where SCHEMA_NAME = 'test_for_navicat'; -SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME -test_for_navicat utf8mb4 utf8mb4_0900_ai_ci +➤ SCHEMA_NAME[12,-1,0] ¦ DEFAULT_CHARACTER_SET_NAME[12,-1,0] ¦ DEFAULT_COLLATION_NAME[12,-1,0] 𝄀 +test_for_navicat ¦ utf8mb4 ¦ utf8mb4_0900_ai_ci drop database test_for_navicat; drop account acc_idx; select @@profiling; -@@profiling +➤ @@profiling[12,0,0] 𝄀 0 select @@global.profiling; -@@profiling +➤ @@global.profiling[12,0,0] 𝄀 0 show variables like 'profiling'; -Variable_name Value -profiling 0 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling ¦ 0 select @@profiling_history_size; -@@profiling_history_size +➤ @@profiling_history_size[12,0,0] 𝄀 15 select @@global.profiling_history_size; -@@profiling_history_size +➤ @@global.profiling_history_size[12,0,0] 𝄀 15 show variables like 'profiling_history_size'; -Variable_name Value -profiling_history_size 15 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling_history_size ¦ 15 SET profiling_history_size = 0; select @@profiling_history_size; -@@profiling_history_size +➤ @@profiling_history_size[12,0,0] 𝄀 0 select @@global.profiling_history_size; -@@profiling_history_size +➤ @@global.profiling_history_size[12,0,0] 𝄀 15 show variables like 'profiling_history_size'; -Variable_name Value -profiling_history_size 0 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling_history_size ¦ 0 SET profiling_history_size = 15; select @@profiling_history_size; -@@profiling_history_size +➤ @@profiling_history_size[12,0,0] 𝄀 15 select @@global.profiling_history_size; -@@profiling_history_size +➤ @@global.profiling_history_size[12,0,0] 𝄀 15 show variables like 'profiling_history_size'; -Variable_name Value -profiling_history_size 15 +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +profiling_history_size ¦ 15 SET profiling_history_size = default; select @@optimizer_switch; -@@optimizer_switch +➤ @@optimizer_switch[12,0,0] 𝄀 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on select @@global.optimizer_switch; -@@optimizer_switch +➤ @@global.optimizer_switch[12,0,0] 𝄀 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on show variables like 'optimizer_switch'; -Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +optimizer_switch ¦ index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,hash_set_operations=on set optimizer_switch='semijoin=off'; select @@optimizer_switch; -@@optimizer_switch +➤ @@optimizer_switch[12,0,0] 𝄀 semijoin=off show variables like 'optimizer_switch'; -Variable_name Value -optimizer_switch semijoin=off +➤ Variable_name[12,0,0] ¦ Value[12,0,0] 𝄀 +optimizer_switch ¦ semijoin=off SET profiling_history_size = default; diff --git a/test/distributed/cases/table/truncate_table_2.result b/test/distributed/cases/table/truncate_table_2.result index 021ce0c696088..9a5c1b96acb1f 100644 --- a/test/distributed/cases/table/truncate_table_2.result +++ b/test/distributed/cases/table/truncate_table_2.result @@ -8,133 +8,132 @@ insert into trun_table_01 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','20 insert into trun_table_01 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,77.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_01 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,54.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,11.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 54.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 11.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} update trun_table_01 set clo3=90 ,col12='2011-01-21' where clo1=1; -Duplicate entry '3a155a41170b33cd' for key '__mo_cpkey_004clo3005col12' +[unknown result because it is related to issue#7133] update trun_table_01 set clo3=66 ,col12='2011-01-21' where clo1=1; +[unknown result because it is related to issue#7133] select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 66 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} +[unknown result because it is related to issue#7133] truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] delete from trun_table_01 where clo1=2; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] insert into trun_table_01(clo2,clo3,col12) select 36,118,'2002-12-03'; insert into trun_table_01(clo2,clo3,col12) select 45,108,'2012-02-23'; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 36 118 null null null null null null null style 2002-12-03 null null null null null null -2 45 108 null null null null null null null style 2012-02-23 null null null null null null +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ 36 ¦ 118 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ style ¦ 2002-12-03 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null 𝄀 +2 ¦ 45 ¦ 108 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null ¦ style ¦ 2012-02-23 ¦ null ¦ null ¦ null ¦ null ¦ null ¦ null truncate table trun_table_01; select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] drop table trun_table_01; create table trun_table_01(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_01 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} create temporary table trun_table_02(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_02 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,98.23,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,77.3,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=1; --- @regex("Duplicate entry '\(100,2021-01-21\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2021-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); -Duplicate entry '(100,2021-01-21)' for key '__mo_cpkey_col' --- @regex("Duplicate entry '\(102,2022-10-11\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) +-- @regex("Duplicate entry '\(100,2021-01-21\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) +Duplicate entry '(100,2021-01-21)' for key '(clo3,col12)' insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,2.43,'tttext','{"a": "3","b": [0,1,2]}'); -Duplicate entry '(102,2022-10-11)' for key '__mo_cpkey_col' +-- @regex("Duplicate entry '\(102,2022-10-11\)' for key '(__mo_cpkey_col|\(clo3,col12\))'", true) +Duplicate entry '(102,2022-10-11)' for key '(clo3,col12)' select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 77.30 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=3; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} insert into trun_table_02 select * from trun_table_01; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90 where clo1=1; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90, col12='1992-11-01' where clo1=1; select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1992-11-01 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; no such table truncate_table_2.trun_table_02 select * from trun_table_02; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 98.23 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 209.43 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +1 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1992-11-01 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} drop table trun_table_02; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; select * from trun_table_03; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; select * from trun_table_03; -clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +➤ clo1[-6,8,0] ¦ clo2[5,16,0] ¦ clo3[4,32,0] ¦ clo4[-5,64,0] ¦ clo5[-6,8,0] ¦ clo6[5,16,0] ¦ clo7[4,32,0] ¦ clo8[-5,64,0] ¦ col9[7,24,0] ¦ col10[8,54,0] ¦ col11[12,-1,0] ¦ col12[91,64,0] ¦ col13[93,64,0] ¦ col14[93,64,0] ¦ col15[-7,1,0] ¦ col16[3,5,2] ¦ col17[12,0,0] ¦ col18[-1,2147483647,0] 𝄀 +1 ¦ -2 ¦ 3 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 1999-11-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +2 ¦ -2 ¦ 90 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2011-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +3 ¦ -2 ¦ 100 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2021-01-21 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} 𝄀 +4 ¦ -2 ¦ 102 ¦ 56 ¦ 9 ¦ 8 ¦ 10 ¦ 50 ¦ 99.0 ¦ 82.99 ¦ yellllow ¦ 2022-10-11 ¦ 1999-11-11 12:00:00 ¦ 2010-11-11 11:00:00 ¦ 0 ¦ 23.98 ¦ tttext ¦ {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; drop table trun_table_03; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; @@ -167,7 +166,7 @@ truncate table span_info; no such table system.span_info use information_schema; truncate table key_column_usage ; -internal error: do not have privilege to execute the statement +no such table information_schema.key_column_usage truncate table columns; no such table information_schema.columns truncate table profiling; From 04dc7bc6512e343a8b4241f7f1a354036233f367 Mon Sep 17 00:00:00 2001 From: XuPeng-SH Date: Wed, 5 Aug 2026 23:40:55 +0800 Subject: [PATCH 24/24] fix: close foreign key metadata lifecycle gaps --- pkg/bootstrap/versions/v4_0_6/upgrade.go | 17 +- pkg/bootstrap/versions/v4_0_6/upgrade_test.go | 62 +++++ pkg/sql/plan/build_alter_add_primarykey.go | 3 + pkg/sql/plan/build_ddl.go | 218 ++++++++++++++---- pkg/sql/plan/build_ddl_test.go | 152 ++++++++++++ pkg/sql/plan/build_dml_util.go | 120 ++++++++-- pkg/sql/plan/build_dml_util_test.go | 51 ++++ .../fk_information_schema_metadata.result | 14 +- .../fk_information_schema_metadata.sql | 13 +- .../cases/foreign_key/fk_show_columns.result | 20 +- 10 files changed, 586 insertions(+), 84 deletions(-) diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade.go b/pkg/bootstrap/versions/v4_0_6/upgrade.go index cb6b5b75df414..aab494fb6170d 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade.go @@ -342,16 +342,23 @@ func getLegacyForeignKeyReferencedIndexName(tenantID int32, txn executor.TxnExec return ordered[i].name < ordered[j].name }) for _, candidate := range ordered { - if len(candidate.columns) != len(key.columns) { + if len(candidate.columns) < len(key.columns) { continue } - if strings.Join(candidate.columns, "\x00") == strings.Join(key.columns, "\x00") { + matched := true + for i, column := range key.columns { + if candidate.columns[i] != column { + matched = false + break + } + } + if matched { return candidate.name, nil } } - // Legacy MatrixOne accepted some FK shapes that do not name an exact - // PRIMARY/UNIQUE key. Leave the value empty rather than inventing a wrong - // UNIQUE_CONSTRAINT_NAME; new FK creation rejects those shapes. + // Legacy MatrixOne accepted some FK shapes that do not name an ordered + // leading prefix of a PRIMARY/UNIQUE key. Leave the value empty rather than + // inventing a wrong UNIQUE_CONSTRAINT_NAME; new FK creation rejects them. return "", nil } diff --git a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go index 8ba9207aab134..646bed2832745 100644 --- a/pkg/bootstrap/versions/v4_0_6/upgrade_test.go +++ b/pkg/bootstrap/versions/v4_0_6/upgrade_test.go @@ -174,6 +174,68 @@ func TestLegacyForeignKeyReferencedIndexNameSelectsExactPrimaryKey(t *testing.T) require.Contains(t, queries[0], "ORDER BY CASE WHEN idx.type = 'PRIMARY' THEN 0 ELSE 1 END") } +func TestLegacyForeignKeyReferencedIndexNameUsesOrderedLeadingPrefix(t *testing.T) { + tests := []struct { + name string + indexRows [][]string + foreignCols []string + want string + }{ + { + name: "composite primary prefix", + indexRows: [][]string{ + {"PRIMARY", "PRIMARY", "1", "id"}, + {"PRIMARY", "PRIMARY", "2", "code"}, + }, + foreignCols: []string{"id"}, + want: "PRIMARY", + }, + { + name: "primary wins over exact unique", + indexRows: [][]string{ + {"PRIMARY", "PRIMARY", "1", "id"}, + {"PRIMARY", "PRIMARY", "2", "code"}, + {"uq_id", "UNIQUE", "1", "id"}, + }, + foreignCols: []string{"id"}, + want: "PRIMARY", + }, + { + name: "non prefix is rejected", + indexRows: [][]string{ + {"uq_code_id", "UNIQUE", "1", "code"}, + {"uq_code_id", "UNIQUE", "2", "id"}, + }, + foreignCols: []string{"id"}, + want: "", + }, + { + name: "unique tie is lexical", + indexRows: [][]string{ + {"uq_z", "UNIQUE", "1", "id"}, + {"uq_a", "UNIQUE", "1", "id"}, + }, + foreignCols: []string{"id"}, + want: "uq_a", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + txnExecutor := newVersionTxnExecutor(t, func(string) (executor.Result, error) { + return newLegacyForeignKeyIndexResult(t, test.indexRows), nil + }) + name, err := getLegacyForeignKeyReferencedIndexName(9, txnExecutor, legacyForeignKeyReferencedKey{ + database: "db", + table: "parent", + columns: test.foreignCols, + }) + require.NoError(t, err) + require.Equal(t, test.want, name) + }) + } +} + func TestVersionHandleMetadata(t *testing.T) { meta := Handler.Metadata() require.Equal(t, "4.0.6", meta.Version) diff --git a/pkg/sql/plan/build_alter_add_primarykey.go b/pkg/sql/plan/build_alter_add_primarykey.go index e23ca40eb2110..5bba602d82175 100644 --- a/pkg/sql/plan/build_alter_add_primarykey.go +++ b/pkg/sql/plan/build_alter_add_primarykey.go @@ -99,6 +99,9 @@ func AddPrimaryKey(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.P func DropPrimaryKey(ctx CompilerContext, alterPlan *plan.AlterTable, alterCtx *AlterTableContext) error { tableDef := alterPlan.CopyTableDef + if err := checkDropReferencedKeyForeignKeyDependency(ctx, tableDef, "PRIMARY", nil); err != nil { + return err + } if tableDef.Pkey.PkeyColName == catalog.FakePrimaryKeyColName { return moerr.NewErrCantDropFieldOrKey(ctx.GetContext(), "PRIMARY") } diff --git a/pkg/sql/plan/build_ddl.go b/pkg/sql/plan/build_ddl.go index 487fa49004d3e..aaf4d10ab499d 100644 --- a/pkg/sql/plan/build_ddl.go +++ b/pkg/sql/plan/build_ddl.go @@ -1939,14 +1939,15 @@ func buildTableDefs(stmt *tree.CreateTable, ctx CompilerContext, createTable *pl if err := checkFkColsAreValid(ctx, selfRefer, createTable.TableDef); err != nil { return err } - selfRefer.UpdateSql = getSqlForAddFk(createTable.Database, createTable.TableDef.Name, selfRefer) + selfRefer.UpdateSql = getSqlForAddFkWithCatalogLayout( + createTable.Database, createTable.TableDef.Name, selfRefer, selfRefer.catalogLayout) createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, selfRefer.UpdateSql) } } skip := IsFkBannedDatabase(createTable.Database) if !skip { - fks, err := GetFkReferredTo(ctx, createTable.Database, createTable.TableDef.Name) + fks, catalogLayout, err := getFkReferredToWithCatalogLayout(ctx, createTable.Database, createTable.TableDef.Name) if err != nil { return err } @@ -1961,12 +1962,14 @@ func buildTableDefs(stmt *tree.CreateTable, ctx CompilerContext, createTable *pl if err != nil { return err } - // The child was created while foreign_key_checks was disabled, - // so its catalog row already exists with no parent key name. Now - // that the parent has been bound, persist the exact key selected - // by checkFkColsAreValid. - createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, - getSqlForUpdateFkReferencedIndex(rkey.Db, rkey.Tbl, constraintName, data.Def.ReferencedIndexName)) + // The child was created while foreign_key_checks was disabled, so + // its catalog row has no parent key name. Persist the selected key + // when the metadata column exists; an old-layout row is reconciled + // by the tenant migration after the columns are committed. + if catalogLayout == foreignKeyCatalogExtended { + createTable.UpdateFkSqls = append(createTable.UpdateFkSqls, + getSqlForUpdateFkReferencedIndex(rkey.Db, rkey.Tbl, constraintName, data.Def.ReferencedIndexName)) + } info := &plan.ForeignKeyInfo{ Db: rkey.Db, Table: rkey.Tbl, @@ -3591,6 +3594,83 @@ func rejectExternalTableInlineIndexes(ctx context.Context, stmt *tree.CreateTabl return nil } +// checkDropReferencedKeyForeignKeyDependency rejects removal of the exact +// PRIMARY/UNIQUE key selected by a live child FK. ForeignKeyDef instances +// written before ReferencedIndexName existed cannot prove which of several +// compatible keys was historically selected, so every compatible key is +// protected rather than guessing from today's index set and risking a stale +// catalog binding. +func checkDropReferencedKeyForeignKeyDependency( + ctx CompilerContext, + parentTableDef *TableDef, + indexName string, + ignoredSelfForeignKeys map[string]struct{}, +) error { + var targetColumns []string + if indexName == "PRIMARY" && parentTableDef.Pkey != nil { + targetColumns = parentTableDef.Pkey.Names + } else { + for _, index := range parentTableDef.Indexes { + if index.IndexName == indexName && index.Unique { + targetColumns = index.Parts + break + } + } + } + if len(targetColumns) == 0 || len(parentTableDef.RefChildTbls) == 0 { + return nil + } + + for _, childTableID := range parentTableDef.RefChildTbls { + selfReference := childTableID == 0 || childTableID == parentTableDef.TblId + childTableDef := parentTableDef + if !selfReference { + _, resolved, err := ctx.ResolveById(childTableID, nil) + if err != nil { + return err + } + if resolved == nil { + return moerr.NewInternalErrorf(ctx.GetContext(), + "The reference foreign key table %d does not exist", childTableID) + } + childTableDef = resolved + } + + for _, fk := range childTableDef.Fkeys { + if fk.ForeignTbl != parentTableDef.TblId && !(selfReference && fk.ForeignTbl == 0) { + continue + } + if selfReference { + if _, ignored := ignoredSelfForeignKeys[fk.Name]; ignored { + continue + } + } + + referencedIndexName := fk.ReferencedIndexName + if referencedIndexName == "" { + referredColumns := make([]string, len(fk.ForeignCols)) + for i, columnID := range fk.ForeignCols { + column := FindColumnByColId(parentTableDef.Cols, columnID) + if column == nil { + return moerr.NewInternalErrorf(ctx.GetContext(), + "foreign key %s references missing column id %d", fk.Name, columnID) + } + referredColumns[i] = column.Name + } + if foreignKeyReferencedColumnsMatch(targetColumns, referredColumns) { + return moerr.NewErrDropIndexNeededInForeignKey(ctx.GetContext(), indexName) + } + continue + } + + if referencedIndexName == indexName { + return moerr.NewErrDropIndexNeededInForeignKey(ctx.GetContext(), indexName) + } + } + } + return nil +} + func buildDropIndex(stmt *tree.DropIndex, ctx CompilerContext) (*Plan, error) { dropIndex := &plan.DropIndex{} if len(stmt.TableName.SchemaName) == 0 { @@ -3636,6 +3716,8 @@ func buildDropIndex(stmt *tree.DropIndex, ctx CompilerContext) (*Plan, error) { } else { return nil, moerr.NewInternalErrorf(ctx.GetContext(), "not found index: %s", dropIndex.IndexName) } + } else if err := checkDropReferencedKeyForeignKeyDependency(ctx, tableDef, dropIndex.IndexName, nil); err != nil { + return nil, err } return &Plan{ @@ -3897,6 +3979,12 @@ func buildAlterTableInplace(stmt *tree.AlterTable, ctx CompilerContext) (*Plan, var updateSqls []string uniqueIndexInfos := make([]*tree.UniqueIndex, 0) secondaryIndexInfos := make([]*tree.Index, 0) + droppedForeignKeys := make(map[string]struct{}) + for _, option := range stmt.Options { + if drop, ok := option.(*tree.AlterOptionDrop); ok && drop.Typ == tree.AlterTableDropForeignKey { + droppedForeignKeys[string(drop.Name)] = struct{}{} + } + } for i, option := range stmt.Options { switch opt := option.(type) { case *tree.AlterOptionDrop: @@ -3918,6 +4006,9 @@ func buildAlterTableInplace(stmt *tree.AlterTable, ctx CompilerContext) (*Plan, // check index for _, indexdef := range tableDef.Indexes { if constraintName == indexdef.IndexName { + if err := checkDropReferencedKeyForeignKeyDependency(ctx, tableDef, constraintName, droppedForeignKeys); err != nil { + return nil, err + } name_not_found = false break } @@ -4621,6 +4712,10 @@ type FkData struct { UpdateSql string // forward reference ForwardRefer bool + // catalogLayout records whether the tenant has committed all FK metadata + // columns. During an asynchronous same-version offset upgrade, legacy SQL + // remains valid against both the old and partially upgraded table layouts. + catalogLayout foreignKeyCatalogLayout } // getForeignKeyData prepares the foreign key data. @@ -4629,6 +4724,10 @@ type FkData struct { // because it is not ready. It should be checked after the pk,uk has been ready. func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, def *tree.ForeignKey) (*FkData, error) { refer := def.Refer + catalogLayout, err := resolveForeignKeyCatalogLayout(ctx) + if err != nil { + return nil, err + } fkData := FkData{ Def: &plan.ForeignKeyDef{ Name: def.ConstraintSymbol, @@ -4639,6 +4738,7 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d OnDeleteOrigin: foreignKeyActionOrigin(refer.OnDelete), OnUpdateOrigin: foreignKeyActionOrigin(refer.OnUpdate), }, + catalogLayout: catalogLayout, } // get fk columns of create table @@ -4723,7 +4823,7 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d // There is no parent key to bind yet, but the catalog row is the // durable record that lets the later parent CREATE reconcile this // forward reference. Its referenced_index_name is backfilled then. - fkData.UpdateSql = getSqlForAddFk(dbName, tableDef.Name, &fkData) + fkData.UpdateSql = getSqlForAddFkWithCatalogLayout(dbName, tableDef.Name, &fkData, fkData.catalogLayout) return &fkData, nil } return nil, moerr.NewNoSuchTable(ctx.GetContext(), ctx.DefaultDatabase(), parentTableName) @@ -4742,7 +4842,7 @@ func getForeignKeyData(ctx CompilerContext, dbName string, tableDef *TableDef, d if err := checkFkColsAreValid(ctx, &fkData, parentTableDef); err != nil { return nil, err } - fkData.UpdateSql = getSqlForAddFk(dbName, tableDef.Name, &fkData) + fkData.UpdateSql = getSqlForAddFkWithCatalogLayout(dbName, tableDef.Name, &fkData, fkData.catalogLayout) return &fkData, nil } @@ -4754,6 +4854,52 @@ func foreignKeyActionOrigin(option tree.ReferenceOptionType) plan.ForeignKeyDef_ return plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT } +type foreignKeyReferencedKey struct { + name string + columns []string +} + +// selectForeignKeyReferencedIndex applies the one binding contract shared by +// FK creation and by DDL lifecycle checks. A reference may use an ordered +// leading prefix of a PRIMARY/UNIQUE key. PRIMARY wins ties; otherwise the +// lexicographically first named UNIQUE key wins. +func selectForeignKeyReferencedIndex(parentTableDef *TableDef, referredColumns []string) (string, bool) { + keys := make([]foreignKeyReferencedKey, 0, len(parentTableDef.Indexes)+1) + if parentTableDef.Pkey != nil { + keys = append(keys, foreignKeyReferencedKey{name: "PRIMARY", columns: parentTableDef.Pkey.Names}) + } + for _, index := range parentTableDef.Indexes { + if index.Unique { + keys = append(keys, foreignKeyReferencedKey{name: index.IndexName, columns: index.Parts}) + } + } + sort.SliceStable(keys, func(i, j int) bool { + if keys[i].name == "PRIMARY" || keys[j].name == "PRIMARY" { + return keys[i].name == "PRIMARY" + } + return keys[i].name < keys[j].name + }) + + for _, key := range keys { + if foreignKeyReferencedColumnsMatch(key.columns, referredColumns) { + return key.name, true + } + } + return "", false +} + +func foreignKeyReferencedColumnsMatch(keyColumns, referredColumns []string) bool { + if len(keyColumns) < len(referredColumns) { + return false + } + for i, column := range referredColumns { + if keyColumns[i] != column { + return false + } + } + return true +} + /* checkFkColsAreValid check foreign key columns is valid or not, then it saves them. the columns referred by the foreign key in the children table must appear in the unique keys or primary key @@ -4793,50 +4939,22 @@ func checkFkColsAreValid(ctx CompilerContext, fkData *FkData, parentTableDef *Ta return err } - type referencedKey struct { - name string - columns []string - } - keys := make([]referencedKey, 0, len(parentTableDef.Indexes)+1) - if parentTableDef.Pkey != nil { - keys = append(keys, referencedKey{name: "PRIMARY", columns: parentTableDef.Pkey.Names}) - } - for _, index := range parentTableDef.Indexes { - if index.Unique { - keys = append(keys, referencedKey{name: index.IndexName, columns: index.Parts}) - } + indexName, matched := selectForeignKeyReferencedIndex(parentTableDef, fkData.ColsReferred.Cols) + if !matched { + return moerr.NewInternalError(ctx.GetContext(), "failed to add the foreign key constraint") } - sort.SliceStable(keys, func(i, j int) bool { - if keys[i].name == "PRIMARY" || keys[j].name == "PRIMARY" { - return keys[i].name == "PRIMARY" - } - return keys[i].name < keys[j].name - }) - for _, key := range keys { - if len(key.columns) < len(fkData.ColsReferred.Cols) { - continue - } - matchCols := make([]uint64, len(fkData.ColsReferred.Cols)) - matched := true - for i, referredColName := range fkData.ColsReferred.Cols { - if key.columns[i] != referredColName { - matched = false - break - } - colID := parentTableDef.Cols[columnNamePos[referredColName]].ColId - if parentTableDef.Cols[columnIdPos[colID]].Typ.Id != fkData.ColTyps[i].Id { - return moerr.NewInternalErrorf(ctx.GetContext(), "type of reference column '%v' is not match for column '%v'", referredColName, fkData.Cols.Cols[i]) - } - matchCols[i] = colID - } - if matched { - fkData.Def.ForeignCols = matchCols - fkData.Def.ReferencedIndexName = key.name - return nil + matchCols := make([]uint64, len(fkData.ColsReferred.Cols)) + for i, referredColName := range fkData.ColsReferred.Cols { + colID := parentTableDef.Cols[columnNamePos[referredColName]].ColId + if parentTableDef.Cols[columnIdPos[colID]].Typ.Id != fkData.ColTyps[i].Id { + return moerr.NewInternalErrorf(ctx.GetContext(), "type of reference column '%v' is not match for column '%v'", referredColName, fkData.Cols.Cols[i]) } + matchCols[i] = colID } - return moerr.NewInternalError(ctx.GetContext(), "failed to add the foreign key constraint") + fkData.Def.ForeignCols = matchCols + fkData.Def.ReferencedIndexName = indexName + return nil } func checkFkVirtualGeneratedColumns(ctx context.Context, parentTableDef *TableDef, referredCols []string) error { diff --git a/pkg/sql/plan/build_ddl_test.go b/pkg/sql/plan/build_ddl_test.go index b2b071c51ca48..9fd5fc7dab8fa 100644 --- a/pkg/sql/plan/build_ddl_test.go +++ b/pkg/sql/plan/build_ddl_test.go @@ -37,7 +37,9 @@ import ( "github.com/matrixorigin/matrixone/pkg/sql/parsers" "github.com/matrixorigin/matrixone/pkg/sql/parsers/dialect" "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree" + "github.com/matrixorigin/matrixone/pkg/testutil" "github.com/matrixorigin/matrixone/pkg/util/executor" + "github.com/matrixorigin/matrixone/pkg/vm/process" ) type rootSQLCompilerContext struct { @@ -2420,9 +2422,159 @@ func TestCheckFkColsAreValidRecordsReferencedKey(t *testing.T) { require.Equal(t, "uq_parent_code", unique.Def.ReferencedIndexName) } +func TestDropSelectedForeignKeyIndexIsRejected(t *testing.T) { + for _, referencedIndexName := range []string{"idx1", ""} { + mode := "persisted name" + if referencedIndexName == "" { + mode = "legacy inferred name" + } + t.Run(mode, func(t *testing.T) { + for _, sql := range []string{ + "drop index idx1 on test_idx", + "alter table test_idx drop index idx1", + } { + t.Run(sql, func(t *testing.T) { + mock := NewMockOptimizer(true) + parent := mock.ctxt.tables["test_idx"] + parent.TblId = 100 + parent.Pkey = nil + parent.RefChildTbls = []uint64{200} + parent.Indexes = []*plan.IndexDef{ + {IndexName: "idx1", Unique: true, Parts: []string{"n_nationkey"}}, + {IndexName: "idx_alternative", Unique: true, Parts: []string{"n_nationkey"}}, + {IndexName: "idx_unrelated", Unique: true, Parts: []string{"n_name"}}, + } + child := &TableDef{ + Name: "fk_child", + TblId: 200, + Fkeys: []*plan.ForeignKeyDef{{ + Name: "fk_child_parent", + ForeignTbl: parent.TblId, + ForeignCols: []uint64{parent.Cols[0].ColId}, + ReferencedIndexName: referencedIndexName, + }}, + } + mock.ctxt.tables[child.Name] = child + mock.ctxt.objects[child.Name] = &ObjectRef{SchemaName: "tpch", ObjName: child.Name} + mock.ctxt.id2name[child.TblId] = child.Name + + _, err := runOneStmt(mock, t, sql) + require.Error(t, err) + require.True(t, moerr.IsMoErrCode(err, moerr.ErrDropIndexNeededInForeignKey), err.Error()) + + plan, err := runOneStmt(mock, t, "drop index idx_unrelated on test_idx") + require.NoError(t, err) + require.Equal(t, "idx_unrelated", plan.GetDdl().GetDropIndex().GetIndexName()) + + _, err = runOneStmt(mock, t, "drop index idx_alternative on test_idx") + if referencedIndexName == "" { + require.Error(t, err, "legacy metadata must not guess which compatible key was bound") + require.True(t, moerr.IsMoErrCode(err, moerr.ErrDropIndexNeededInForeignKey), err.Error()) + } else { + require.NoError(t, err, "a persisted binding makes an alternative key independently droppable") + } + }) + } + }) + } +} + +func TestAlterCanDropSelfForeignKeyAndItsSelectedIndexTogether(t *testing.T) { + mock := NewMockOptimizer(true) + tableDef := mock.ctxt.tables["test_idx"] + tableDef.TblId = 100 + tableDef.Pkey = nil + tableDef.RefChildTbls = []uint64{0} + tableDef.Indexes = []*plan.IndexDef{{ + IndexName: "idx1", Unique: true, Parts: []string{"n_nationkey"}, + }} + tableDef.Fkeys = []*plan.ForeignKeyDef{{ + Name: "fk_self", + ForeignTbl: 0, + ForeignCols: []uint64{tableDef.Cols[0].ColId}, + ReferencedIndexName: "idx1", + }} + + logicPlan, err := runOneStmt(mock, t, + "alter table test_idx drop foreign key fk_self, drop index idx1") + require.NoError(t, err) + require.Len(t, logicPlan.GetDdl().GetAlterTable().GetActions(), 2) +} + +func TestDropReferencedPrimaryKeyIsRejected(t *testing.T) { + for _, referencedIndexName := range []string{"PRIMARY", ""} { + mock := NewMockOptimizer(true) + parent := mock.ctxt.tables["test_idx"] + parent.TblId = 100 + parent.RefChildTbls = []uint64{200} + child := &TableDef{ + Name: "fk_child_primary", + TblId: 200, + Fkeys: []*plan.ForeignKeyDef{{ + Name: "fk_child_primary", + ForeignTbl: parent.TblId, + ForeignCols: []uint64{parent.Cols[0].ColId}, + ReferencedIndexName: referencedIndexName, + }}, + } + mock.ctxt.tables[child.Name] = child + mock.ctxt.objects[child.Name] = &ObjectRef{SchemaName: "tpch", ObjName: child.Name} + mock.ctxt.id2name[child.TblId] = child.Name + + _, err := runOneStmt(mock, t, "alter table test_idx drop primary key") + require.Error(t, err) + require.True(t, moerr.IsMoErrCode(err, moerr.ErrDropIndexNeededInForeignKey), err.Error()) + } +} + +func TestCreateForeignKeyUsesLegacyCatalogBeforeTenantUpgrade(t *testing.T) { + mock := NewMockOptimizer(false) + legacyColumnNames := []string{ + "constraint_name", "constraint_id", "db_name", "db_id", "table_name", "table_id", + "column_name", "column_id", "refer_db_name", "refer_db_id", "refer_table_name", + "refer_table_id", "refer_column_name", "refer_column_id", "on_delete", "on_update", + } + legacyCatalog := &TableDef{Name: catalog.MOForeignKeys} + for _, name := range legacyColumnNames { + legacyCatalog.Cols = append(legacyCatalog.Cols, &ColDef{Name: name}) + } + mock.ctxt.tables[catalog.MOForeignKeys] = legacyCatalog + + proc := testutil.NewProcess(t) + proc.ReplaceTopCtx(defines.AttachAccountId(context.Background(), catalog.System_Account)) + mock.ctxt.GetProcessFunc = func() *process.Process { return proc } + var internalQueries []string + moruntime.ServiceRuntime(proc.GetService()).SetGlobalVariables( + moruntime.InternalSQLExecutor, + executor.NewMemExecutor(func(sql string) (executor.Result, error) { + internalQueries = append(internalQueries, sql) + return executor.Result{}, nil + }), + ) + + logicPlan, err := runOneStmt(mock, t, + "create table fk_before_upgrade (parent_id int, constraint fk_before_upgrade_parent foreign key (parent_id) references nation(n_nationkey))") + require.NoError(t, err) + createTable := logicPlan.GetDdl().GetCreateTable() + require.Len(t, createTable.UpdateFkSqls, 1) + require.NotContains(t, createTable.UpdateFkSqls[0], "referenced_index_name") + require.NotContains(t, createTable.UpdateFkSqls[0], "on_delete_origin") + require.Len(t, internalQueries, 1) + require.NotContains(t, internalQueries[0], "referenced_index_name") + require.NotContains(t, internalQueries[0], "on_delete_origin") +} + func TestForwardForeignKeyCatalogLifecycle(t *testing.T) { ctx := NewMockCompilerContext(true) ctx.SetContext(context.Background()) + ctx.tables[catalog.MOForeignKeys] = &TableDef{ + Name: catalog.MOForeignKeys, + Cols: []*ColDef{ + {Name: "referenced_index_name"}, + {Name: "on_delete_origin"}, + {Name: "on_update_origin"}, + }, + } ctx.ResolveVariableFunc = func(name string, _, _ bool) (interface{}, error) { if name == "foreign_key_checks" { return int64(0), nil diff --git a/pkg/sql/plan/build_dml_util.go b/pkg/sql/plan/build_dml_util.go index 1d48bca6458e2..b9f9abfed0700 100644 --- a/pkg/sql/plan/build_dml_util.go +++ b/pkg/sql/plan/build_dml_util.go @@ -4625,6 +4625,34 @@ func (fk FkReferDef) String() string { fk.Db, fk.Tbl, fk.Name, fk.Col, fk.ReferCol) } +type foreignKeyCatalogLayout uint8 + +const ( + foreignKeyCatalogLegacy foreignKeyCatalogLayout = iota + foreignKeyCatalogExtended +) + +// resolveForeignKeyCatalogLayout negotiates the tenant-local catalog shape. +// Tenant upgrades are asynchronous and add the metadata columns one at a time, +// so the extended layout is usable only after all three columns are visible. +// Legacy reads and explicit 16-column inserts remain valid during every earlier +// state, including a partially applied migration. +func resolveForeignKeyCatalogLayout(ctx CompilerContext) (foreignKeyCatalogLayout, error) { + _, tableDef, err := ctx.Resolve(catalog.MO_CATALOG, catalog.MOForeignKeys, nil) + if err != nil { + return foreignKeyCatalogLegacy, err + } + if tableDef == nil { + return foreignKeyCatalogLegacy, nil + } + for _, column := range []string{"referenced_index_name", "on_delete_origin", "on_update_origin"} { + if FindColumn(tableDef.Cols, column) == nil { + return foreignKeyCatalogLegacy, nil + } + } + return foreignKeyCatalogExtended, nil +} + // quoteSQLStringLiteral emits a literal that MatrixOne's MySQL scanner reads // byte-for-byte. Backslash is the scanner's escape introducer, including for a // single quote; doubling a quote would persist both quote bytes in INSERTs. @@ -4639,6 +4667,17 @@ func quoteSQLStringLiteral(s string) string { // GetSqlForFkReferredTo returns the query that retrieves the fk relationships // that refer to the table func GetSqlForFkReferredTo(db, table string) string { + return getSqlForFkReferredToWithCatalogLayout(db, table, foreignKeyCatalogExtended) +} + +func getSqlForFkReferredToWithCatalogLayout(db, table string, layout foreignKeyCatalogLayout) string { + metadataColumns := "" + if layout == foreignKeyCatalogExtended { + metadataColumns = + ", referenced_index_name, " + + "on_delete_origin, " + + "on_update_origin" + } return fmt.Sprintf( "select "+ "db_name, "+ @@ -4647,11 +4686,9 @@ func GetSqlForFkReferredTo(db, table string) string { "column_name, "+ "refer_column_name, "+ "on_delete, "+ - "on_update, "+ - "referenced_index_name, "+ - "on_delete_origin, "+ - "on_update_origin "+ - "from "+ + "on_update"+ + metadataColumns+ + " from "+ "`mo_catalog`.`mo_foreign_keys` "+ "where "+ "refer_db_name = %s and refer_table_name = %s "+ @@ -4664,11 +4701,20 @@ func GetSqlForFkReferredTo(db, table string) string { // GetFkReferredTo returns the foreign key relationships that refer to the table func GetFkReferredTo(ctx CompilerContext, db, table string) (map[FkReferKey]map[string][]*FkReferDef, error) { + ret, _, err := getFkReferredToWithCatalogLayout(ctx, db, table) + return ret, err +} + +func getFkReferredToWithCatalogLayout(ctx CompilerContext, db, table string) (map[FkReferKey]map[string][]*FkReferDef, foreignKeyCatalogLayout, error) { //exclude fk self reference - sql := GetSqlForFkReferredTo(db, table) + layout, err := resolveForeignKeyCatalogLayout(ctx) + if err != nil { + return nil, foreignKeyCatalogLegacy, err + } + sql := getSqlForFkReferredToWithCatalogLayout(db, table, layout) res, err := runSql(ctx, sql) if err != nil { - return nil, err + return nil, layout, err } defer res.Close() ret := make(map[FkReferKey]map[string][]*FkReferDef) @@ -4689,16 +4735,21 @@ func GetFkReferredTo(ctx CompilerContext, db, table string) (map[FkReferKey]map[ batch.Vecs[0].Length() > 0 { for i := 0; i < batch.Vecs[0].Length(); i++ { fk := &FkReferDef{ - Db: string(batch.Vecs[dbIdx].GetBytesAt(i)), - Tbl: string(batch.Vecs[tblIdx].GetBytesAt(i)), - Name: string(batch.Vecs[nameIdx].GetBytesAt(i)), - Col: string(batch.Vecs[colIdx].GetBytesAt(i)), - ReferCol: string(batch.Vecs[referColIdx].GetBytesAt(i)), - OnDelete: string(batch.Vecs[deleteIdx].GetBytesAt(i)), - OnUpdate: string(batch.Vecs[updateIdx].GetBytesAt(i)), - ReferencedIndexName: string(batch.Vecs[referencedIndexIdx].GetBytesAt(i)), - OnDeleteOrigin: string(batch.Vecs[deleteOriginIdx].GetBytesAt(i)), - OnUpdateOrigin: string(batch.Vecs[updateOriginIdx].GetBytesAt(i)), + Db: string(batch.Vecs[dbIdx].GetBytesAt(i)), + Tbl: string(batch.Vecs[tblIdx].GetBytesAt(i)), + Name: string(batch.Vecs[nameIdx].GetBytesAt(i)), + Col: string(batch.Vecs[colIdx].GetBytesAt(i)), + ReferCol: string(batch.Vecs[referColIdx].GetBytesAt(i)), + OnDelete: string(batch.Vecs[deleteIdx].GetBytesAt(i)), + OnUpdate: string(batch.Vecs[updateIdx].GetBytesAt(i)), + } + if layout == foreignKeyCatalogExtended { + fk.ReferencedIndexName = string(batch.Vecs[referencedIndexIdx].GetBytesAt(i)) + fk.OnDeleteOrigin = string(batch.Vecs[deleteOriginIdx].GetBytesAt(i)) + fk.OnUpdateOrigin = string(batch.Vecs[updateOriginIdx].GetBytesAt(i)) + } else { + fk.OnDeleteOrigin = legacyForeignKeyActionOrigin(fk.OnDelete) + fk.OnUpdateOrigin = legacyForeignKeyActionOrigin(fk.OnUpdate) } key := FkReferKey{Db: fk.Db, Tbl: fk.Tbl} var constraint map[string][]*FkReferDef @@ -4712,7 +4763,16 @@ func GetFkReferredTo(ctx CompilerContext, db, table string) (map[FkReferKey]map[ } } } - return ret, nil + return ret, layout, nil +} + +func legacyForeignKeyActionOrigin(action string) string { + switch strings.ToUpper(strings.ReplaceAll(strings.TrimSpace(action), " ", "_")) { + case plan.ForeignKeyDef_RESTRICT.String(), plan.ForeignKeyDef_NO_ACTION.String(): + return plan.ForeignKeyDef_ACTION_ORIGIN_LEGACY_AMBIGUOUS.String() + default: + return plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT.String() + } } func convertIntoReferAction(s string) plan.ForeignKeyDef_RefAction { @@ -4752,10 +4812,22 @@ func convertIntoReferActionOrigin(s string) plan.ForeignKeyDef_RefActionOrigin { // getSqlForAddFk returns the insert sql that adds a fk relationship // into the mo_foreign_keys table func getSqlForAddFk(db, table string, data *FkData) string { - row := make([]string, 19) + return getSqlForAddFkWithCatalogLayout(db, table, data, foreignKeyCatalogExtended) +} + +func getSqlForAddFkWithCatalogLayout(db, table string, data *FkData, layout foreignKeyCatalogLayout) string { + columnCount := 16 + columns := "constraint_name, constraint_id, db_name, db_id, table_name, table_id, column_name, column_id, refer_db_name, refer_db_id, refer_table_name, refer_table_id, refer_column_name, refer_column_id, on_delete, on_update" + if layout == foreignKeyCatalogExtended { + columnCount = 19 + columns += ", referenced_index_name, on_delete_origin, on_update_origin" + } + row := make([]string, columnCount) rows := 0 sb := strings.Builder{} - sb.WriteString("insert into `mo_catalog`.`mo_foreign_keys` (constraint_name, constraint_id, db_name, db_id, table_name, table_id, column_name, column_id, refer_db_name, refer_db_id, refer_table_name, refer_table_id, refer_column_name, refer_column_id, on_delete, on_update, referenced_index_name, on_delete_origin, on_update_origin)") + sb.WriteString("insert into `mo_catalog`.`mo_foreign_keys` (") + sb.WriteString(columns) + sb.WriteByte(')') sb.WriteString(" values ") for childIdx, childCol := range data.Cols.Cols { row[0] = data.Def.Name @@ -4775,9 +4847,11 @@ func getSqlForAddFk(db, table string, data *FkData) string { row[13] = "0" row[14] = data.Def.OnDelete.String() row[15] = data.Def.OnUpdate.String() - row[16] = data.Def.ReferencedIndexName - row[17] = data.Def.OnDeleteOrigin.String() - row[18] = data.Def.OnUpdateOrigin.String() + if layout == foreignKeyCatalogExtended { + row[16] = data.Def.ReferencedIndexName + row[17] = data.Def.OnDeleteOrigin.String() + row[18] = data.Def.OnUpdateOrigin.String() + } if data.Def.OnDeleteOrigin == plan.ForeignKeyDef_ACTION_ORIGIN_DEFAULT { row[14] = plan.ForeignKeyDef_NO_ACTION.String() } diff --git a/pkg/sql/plan/build_dml_util_test.go b/pkg/sql/plan/build_dml_util_test.go index ca9c0c7b2064e..bd68deb66784e 100644 --- a/pkg/sql/plan/build_dml_util_test.go +++ b/pkg/sql/plan/build_dml_util_test.go @@ -65,6 +65,57 @@ func TestGetSqlForFkReferredToEscapesStringLiterals(t *testing.T) { require.Contains(t, sql, "table_name != 'quote\\'src'") } +func TestForeignKeyCatalogLayoutIsExtendedOnlyAfterAllColumnsExist(t *testing.T) { + ctx := NewEmptyCompilerContext() + ctx.tables[catalog.MOForeignKeys] = &TableDef{ + Name: catalog.MOForeignKeys, + Cols: []*ColDef{{Name: "referenced_index_name"}, {Name: "on_delete_origin"}}, + } + layout, err := resolveForeignKeyCatalogLayout(ctx) + require.NoError(t, err) + require.Equal(t, foreignKeyCatalogLegacy, layout) + + ctx.tables[catalog.MOForeignKeys].Cols = append(ctx.tables[catalog.MOForeignKeys].Cols, + &ColDef{Name: "on_update_origin"}) + layout, err = resolveForeignKeyCatalogLayout(ctx) + require.NoError(t, err) + require.Equal(t, foreignKeyCatalogExtended, layout) +} + +func TestLegacyForeignKeyCatalogSQLAvoidsNewColumns(t *testing.T) { + readSQL := getSqlForFkReferredToWithCatalogLayout("parent_db", "parent", foreignKeyCatalogLegacy) + require.NotContains(t, readSQL, "referenced_index_name") + require.NotContains(t, readSQL, "on_delete_origin") + require.Contains(t, readSQL, "on_update from `mo_catalog`.`mo_foreign_keys`") + + fkData := &FkData{ + Def: &plan.ForeignKeyDef{ + Name: "fk_child_parent", + OnDelete: plan.ForeignKeyDef_RESTRICT, + OnUpdate: plan.ForeignKeyDef_RESTRICT, + OnDeleteOrigin: plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT, + OnUpdateOrigin: plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT, + }, + Cols: &plan.FkColName{Cols: []string{"parent_id"}}, + ColsReferred: &plan.FkColName{Cols: []string{"id"}}, + ParentDbName: "parent_db", + ParentTableName: "parent", + } + insertSQL := getSqlForAddFkWithCatalogLayout("child_db", "child", fkData, foreignKeyCatalogLegacy) + require.NotContains(t, insertSQL, "referenced_index_name") + require.NotContains(t, insertSQL, "on_delete_origin") + require.Contains(t, insertSQL, "on_delete, on_update) values") +} + +func TestLegacyForeignKeyActionOriginIsConservative(t *testing.T) { + require.Equal(t, plan.ForeignKeyDef_ACTION_ORIGIN_LEGACY_AMBIGUOUS.String(), + legacyForeignKeyActionOrigin("RESTRICT")) + require.Equal(t, plan.ForeignKeyDef_ACTION_ORIGIN_LEGACY_AMBIGUOUS.String(), + legacyForeignKeyActionOrigin("NO ACTION")) + require.Equal(t, plan.ForeignKeyDef_ACTION_ORIGIN_EXPLICIT.String(), + legacyForeignKeyActionOrigin("CASCADE")) +} + func TestGetSqlForAddFkEscapesStringLiterals(t *testing.T) { fkData := &FkData{ Def: &plan.ForeignKeyDef{ diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result index 61846384ba46f..763b9bb634e18 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.result +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.result @@ -2,7 +2,7 @@ drop database if exists mysql_compat_model11_min2; create database mysql_compat_model11_min2; use mysql_compat_model11_min2; create table p (id int primary key, key p_secondary (id)); -create table p_compound (id int, code int, unique key uq_p_compound (id, code), key p_compound_secondary (id, code)); +create table p_compound (id int, code int, unique key uq_p_compound (id, code), unique key zz_p_compound (id, code), key p_compound_secondary (id, code)); create table unrelated (id int, unique key unrelated_id (id)); create table c ( id int primary key, @@ -45,4 +45,16 @@ c ¦ parent_id ¦ p ¦ id ¦ 1 𝄀 c ¦ compound_parent_id ¦ p_compound ¦ id ¦ 1 𝄀 c ¦ parent_code ¦ p_compound ¦ code ¦ 2 𝄀 c ¦ restrict_parent_id ¦ p ¦ id ¦ 1 +drop index zz_p_compound on p_compound; +drop index uq_p_compound on p_compound; +Cannot drop index 'uq_p_compound': needed in a foreign key constraint +alter table p_compound drop index uq_p_compound; +Cannot drop index 'uq_p_compound': needed in a foreign key constraint +alter table p drop primary key; +Cannot drop index 'PRIMARY': needed in a foreign key constraint +select constraint_name, unique_constraint_name +from information_schema.referential_constraints +where constraint_schema = database() and constraint_name = 'fk_c_p_compound'; +➤ constraint_name[12,-1,0] ¦ unique_constraint_name[12,-1,0] 𝄀 +fk_c_p_compound ¦ uq_p_compound drop database mysql_compat_model11_min2; diff --git a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql index ef78b385afb51..a2987ad1f68ab 100644 --- a/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql +++ b/test/distributed/cases/foreign_key/fk_information_schema_metadata.sql @@ -4,7 +4,7 @@ create database mysql_compat_model11_min2; use mysql_compat_model11_min2; create table p (id int primary key, key p_secondary (id)); -create table p_compound (id int, code int, unique key uq_p_compound (id, code), key p_compound_secondary (id, code)); +create table p_compound (id int, code int, unique key uq_p_compound (id, code), unique key zz_p_compound (id, code), key p_compound_secondary (id, code)); create table unrelated (id int, unique key unrelated_id (id)); create table c ( id int primary key, @@ -37,4 +37,15 @@ from information_schema.key_column_usage where table_schema = database() and referenced_table_name is not null order by table_name, constraint_name, ordinal_position; +-- A compatible but unselected UNIQUE remains independently droppable, but the +-- exact key selected by the live FK is protected through both public DDL paths. +drop index zz_p_compound on p_compound; +drop index uq_p_compound on p_compound; +alter table p_compound drop index uq_p_compound; +alter table p drop primary key; + +select constraint_name, unique_constraint_name +from information_schema.referential_constraints +where constraint_schema = database() and constraint_name = 'fk_c_p_compound'; + drop database mysql_compat_model11_min2; diff --git a/test/distributed/cases/foreign_key/fk_show_columns.result b/test/distributed/cases/foreign_key/fk_show_columns.result index 9bfed542838be..c216c73add9c9 100644 --- a/test/distributed/cases/foreign_key/fk_show_columns.result +++ b/test/distributed/cases/foreign_key/fk_show_columns.result @@ -310,7 +310,10 @@ refer_table_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ refer_column_name ¦ VARCHAR(256) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 refer_column_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ 𝄀 on_delete ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ +on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_index_name ¦ VARCHAR(5000) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +on_delete_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ 𝄀 +on_update_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ desc mo_catalog.mo_snapshots ; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 snapshot_id ¦ UUID(0) ¦ YES ¦ UNI ¦ null ¦ ¦ 𝄀 @@ -632,7 +635,10 @@ refer_table_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ refer_column_name ¦ VARCHAR(256) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 refer_column_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ 𝄀 on_delete ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ +on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_index_name ¦ VARCHAR(5000) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +on_delete_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ 𝄀 +on_update_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ show columns from mo_catalog.mo_snapshots ; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 snapshot_id ¦ UUID(0) ¦ YES ¦ UNI ¦ null ¦ ¦ 𝄀 @@ -932,7 +938,10 @@ refer_table_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ refer_column_name ¦ VARCHAR(256) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 refer_column_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ 𝄀 on_delete ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ +on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_index_name ¦ VARCHAR(5000) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +on_delete_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ 𝄀 +on_update_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ desc mo_catalog.mo_snapshots ; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 snapshot_id ¦ UUID(0) ¦ YES ¦ UNI ¦ null ¦ ¦ 𝄀 @@ -1232,7 +1241,10 @@ refer_table_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ refer_column_name ¦ VARCHAR(256) ¦ NO ¦ PRI ¦ null ¦ ¦ 𝄀 refer_column_id ¦ BIGINT UNSIGNED(64) ¦ NO ¦ PRI ¦ 0 ¦ ¦ 𝄀 on_delete ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 -on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ +on_update ¦ VARCHAR(128) ¦ NO ¦ ¦ null ¦ ¦ 𝄀 +referenced_index_name ¦ VARCHAR(5000) ¦ NO ¦ ¦ ¦ ¦ 𝄀 +on_delete_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ 𝄀 +on_update_origin ¦ VARCHAR(64) ¦ NO ¦ ¦ ACTION_ORIGIN_EXPLICIT ¦ ¦ show columns from mo_catalog.mo_snapshots ; ➤ Field[1,0,0] ¦ Type[1,0,0] ¦ Null[1,0,0] ¦ Key[1,0,0] ¦ Default[1,0,0] ¦ Extra[1,0,0] ¦ Comment[1,0,0] 𝄀 snapshot_id ¦ UUID(0) ¦ YES ¦ UNI ¦ null ¦ ¦ 𝄀