(t *testing.T)
| 586 | } |
| 587 | |
| 588 | func TestShowCreateTable(t *testing.T) { |
| 589 | if skipIntegrateTest { |
| 590 | t.Skip("Integration tests skipped") |
| 591 | } |
| 592 | |
| 593 | ctx, cancel := context.WithTimeout(context.Background(), 180*time.Second) |
| 594 | defer cancel() |
| 595 | |
| 596 | session, tableId, tearDown := setup(t, ctx, []string{}) |
| 597 | defer tearDown() |
| 598 | |
| 599 | stmt, err := BuildStatement(fmt.Sprintf("SHOW CREATE TABLE %s", tableId)) |
| 600 | if err != nil { |
| 601 | t.Fatalf("invalid statement: error=%s", err) |
| 602 | } |
| 603 | |
| 604 | result, err := stmt.Execute(ctx, session) |
| 605 | if err != nil { |
| 606 | t.Fatalf("unexpected error happened: %s", err) |
| 607 | } |
| 608 | |
| 609 | compareResult(t, result, &Result{ |
| 610 | ColumnNames: []string{"Table", "Create Table"}, |
| 611 | Rows: []Row{ |
| 612 | Row{[]string{tableId, fmt.Sprintf("CREATE TABLE %s (\n id INT64 NOT NULL,\n active BOOL NOT NULL,\n) PRIMARY KEY(id)", tableId)}}, |
| 613 | }, |
| 614 | AffectedRows: 1, |
| 615 | IsMutation: false, |
| 616 | }) |
| 617 | } |
| 618 | |
| 619 | func TestShowColumns(t *testing.T) { |
| 620 | if skipIntegrateTest { |
nothing calls this directly
no test coverage detected