80
81
// Partial namespace creation is only relevant for Cassandra, the following tests will only run when the underlying cluster is cassandra
83
>
// only add the namespace to namespaces_by_id table and not namespaces table
84
>
const constNamespacePartition = 0
85
>
const templateCreateNamespaceQuery = `INSERT INTO namespaces_by_id (` +
86
>
`id, name) ` +
87
>
`VALUES(?, ?) IF NOT EXISTS`
88
>
query := m.DefaultTestCluster.(*cassandra.TestCluster).GetSession().Query(templateCreateNamespaceQuery, id, name).WithContext(context.Background())
89
>
err := query.Exec()
90
>
m.NoError(err)
91
>
92
>
}
93
95
>
query := m.DefaultTestCluster.(*cassandra.TestCluster).GetSession().Query("TRUNCATE namespaces_by_id").WithContext(context.Background())
96
>
err := query.Exec()
97
>
m.NoError(err)
98
>
99
>
query = m.DefaultTestCluster.(*cassandra.TestCluster).GetSession().Query("TRUNCATE namespaces").WithContext(context.Background())
100
>
err = query.Exec()
101
>
m.NoError(err)
102
>
}
103
104
func (m *MetadataPersistenceSuiteV2) TestCreateWithPartialNamespaceSameNameSameID() {