mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
fb-2026 : added test cases with cache type & size for copy
This commit is contained in:
parent
6383a96ac5
commit
605905e665
2 changed files with 47 additions and 1 deletions
|
|
@ -203,6 +203,8 @@ var TableTests []TableTest = []TableTest{
|
|||
// copy
|
||||
copyTable,
|
||||
copyTests,
|
||||
copyTableCache,
|
||||
copyTestsCache,
|
||||
|
||||
// bool (batch logic)
|
||||
boolTests,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,30 @@ var copyTable = TableTest{
|
|||
),
|
||||
SQLTests: nil,
|
||||
}
|
||||
|
||||
var copyTableCache = TableTest{
|
||||
name: "copyTableCache",
|
||||
Table: tbl(
|
||||
"copytestcache",
|
||||
srcHdrs(
|
||||
srcHdr("_id", fldTypeID),
|
||||
srcHdr("id_col", fldTypeID, "CACHETYPE LRU", "SIZE 1024"),
|
||||
srcHdr("string_col", fldTypeString, "CACHETYPE RANKED", "SIZE 1024"),
|
||||
srcHdr("int_col", fldTypeInt),
|
||||
srcHdr("decimal_col", fldTypeDecimal2),
|
||||
srcHdr("bool_col", fldTypeBool),
|
||||
srcHdr("time_col", fldTypeTimestamp),
|
||||
srcHdr("stringset_col", fldTypeStringSet, "CACHETYPE RANKED", "SIZE 1024"),
|
||||
srcHdr("idset_col", fldTypeIDSet, "CACHETYPE LRU", "SIZE 1024"),
|
||||
),
|
||||
srcRows(
|
||||
srcRow(int64(1), int64(10), string("foo"), int64(10), float64(10), bool(false), knownTimestamp(), []string{"foo", "bar"}, []int64{1, 2}),
|
||||
srcRow(int64(2), int64(11), string("foo1"), int64(11), float64(11), bool(true), knownTimestamp(), []string{"foo1", "bar1"}, []int64{11, 21}),
|
||||
srcRow(int64(3), int64(12), string("foo2"), int64(12), float64(12), bool(false), knownTimestamp(), []string{"foo2", "bar2"}, []int64{12, 22}),
|
||||
srcRow(int64(4), int64(13), string("foo3"), int64(13), float64(13), bool(true), knownTimestamp(), []string{"foo3", "bar3"}, []int64{13, 23}),
|
||||
),
|
||||
),
|
||||
SQLTests: nil,
|
||||
}
|
||||
var copyTests = TableTest{
|
||||
name: "copyTests",
|
||||
SQLTests: []SQLTest{
|
||||
|
|
@ -56,3 +79,24 @@ var copyTests = TableTest{
|
|||
},
|
||||
},
|
||||
}
|
||||
var copyTestsCache = TableTest{
|
||||
name: "copyTestsCache",
|
||||
SQLTests: []SQLTest{
|
||||
{
|
||||
name: "copy-table-to-table-same-name",
|
||||
SQLs: sqls(
|
||||
`copy copytestcache to copytestcache;`,
|
||||
),
|
||||
ExpErr: "already exists",
|
||||
},
|
||||
{
|
||||
name: "copy-table-to-table",
|
||||
SQLs: sqls(
|
||||
`copy copytestcache to copytestcachetwo;`,
|
||||
),
|
||||
ExpHdrs: hdrs(),
|
||||
ExpRows: rows(),
|
||||
Compare: CompareExactOrdered,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue