MCPcopy
hub / github.com/go-gorm/gorm / TestInvalidCachedPlanSimpleProtocolGaussDB

Function TestInvalidCachedPlanSimpleProtocolGaussDB

tests/migrate_test.go:1337–1371  ·  view source on GitHub ↗

TODO: ERROR: must have at least one column (SQLSTATE 0A000)

(t *testing.T)

Source from the content-addressed store, hash-verified

1335
1336// TODO: ERROR: must have at least one column (SQLSTATE 0A000)
1337func TestInvalidCachedPlanSimpleProtocolGaussDB(t *testing.T) {
1338 t.Skipf("This test case skipped, because of gaussdb not support creaing empty table(SQLSTATE 0A000)")
1339 if DB.Dialector.Name() != "gaussdb" {
1340 return
1341 }
1342
1343 db, err := gorm.Open(gaussdb.Open(gaussdbDSN), &gorm.Config{})
1344 if err != nil {
1345 t.Errorf("Open err:%v", err)
1346 }
1347
1348 type Object1 struct{}
1349 type Object2 struct {
1350 Field1 string
1351 }
1352 type Object3 struct {
1353 Field2 string
1354 }
1355 db.Migrator().DropTable("objects")
1356
1357 err = db.Table("objects").AutoMigrate(&Object1{})
1358 if err != nil {
1359 t.Errorf("AutoMigrate err:%v", err)
1360 }
1361
1362 err = db.Table("objects").AutoMigrate(&Object2{})
1363 if err != nil {
1364 t.Errorf("AutoMigrate err:%v", err)
1365 }
1366
1367 err = db.Table("objects").AutoMigrate(&Object3{})
1368 if err != nil {
1369 t.Errorf("AutoMigrate err:%v", err)
1370 }
1371}
1372
1373func TestDifferentTypeWithoutDeclaredLength(t *testing.T) {
1374 type DiffType struct {

Callers

nothing calls this directly

Calls 6

OpenFunction · 0.92
NameMethod · 0.65
DropTableMethod · 0.65
MigratorMethod · 0.65
AutoMigrateMethod · 0.65
TableMethod · 0.65

Tested by

no test coverage detected