============================================================ ReleaseStatements mixed DDL test ============================================================
(t *testing.T)
| 907 | // ============================================================ |
| 908 | |
| 909 | func TestReleaseStatementsMixedDDL(t *testing.T) { |
| 910 | stmts := []Statement{ |
| 911 | &CreateTableStatement{Name: "t1"}, |
| 912 | &AlterTableStatement{Table: "t2"}, |
| 913 | &CreateIndexStatement{Name: "idx"}, |
| 914 | &MergeStatement{TargetAlias: "tgt"}, |
| 915 | &CreateViewStatement{Name: "v1"}, |
| 916 | &CreateMaterializedViewStatement{Name: "mv1"}, |
| 917 | &RefreshMaterializedViewStatement{Name: "mv1"}, |
| 918 | &DropStatement{ObjectType: "TABLE"}, |
| 919 | &TruncateStatement{Tables: []string{"t1"}}, |
| 920 | &ShowStatement{ShowType: "TABLES"}, |
| 921 | &DescribeStatement{TableName: "users"}, |
| 922 | &ReplaceStatement{TableName: "cache"}, |
| 923 | &AlterStatement{Name: "r1"}, |
| 924 | // DML |
| 925 | &SelectStatement{TableName: "users"}, |
| 926 | &InsertStatement{TableName: "orders"}, |
| 927 | } |
| 928 | |
| 929 | // Should not panic |
| 930 | ReleaseStatements(stmts) |
| 931 | |
| 932 | for i, s := range stmts { |
| 933 | if s != nil { |
| 934 | t.Errorf("stmts[%d] not cleared after ReleaseStatements", i) |
| 935 | } |
| 936 | } |
| 937 | } |
| 938 | |
| 939 | // ============================================================ |
| 940 | // Benchmarks |
nothing calls this directly
no test coverage detected