mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-05 02:59:44 -06:00
fix RowDiffere initialization
This commit is contained in:
@@ -189,9 +189,9 @@ SQL
|
||||
run dolt --keyless sql -q "
|
||||
SELECT to_c0, to_c1, from_c0, from_c1
|
||||
FROM dolt_diff_keyless
|
||||
WHERE from_commit = hashof('HEAD')
|
||||
ORDER BY to_commit_date" -r csv
|
||||
[ $status -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 11 ]
|
||||
[[ "${lines[0]}" = "to_c0,to_c1,from_c0,from_c1" ]] || false
|
||||
[[ "${lines[1]}" = "8,8,," ]] || false
|
||||
[[ "${lines[2]}" = ",,1,1" ]] || false
|
||||
@@ -199,6 +199,10 @@ SQL
|
||||
[[ "${lines[4]}" = "1,9,," ]] || false
|
||||
[[ "${lines[5]}" = "1,9,," ]] || false
|
||||
[[ "${lines[6]}" = ",,0,0" ]] || false
|
||||
[[ "${lines[7]}" = "1,1,," ]] || false
|
||||
[[ "${lines[8]}" = "1,1,," ]] || false
|
||||
[[ "${lines[9]}" = "0,0,," ]] || false
|
||||
[[ "${lines[10]}" = "2,2,," ]] || false
|
||||
}
|
||||
|
||||
@test "keyless diff column add/drop" {
|
||||
|
||||
@@ -41,9 +41,12 @@ type RowDiffer interface {
|
||||
|
||||
func NewRowDiffer(ctx context.Context, fromSch, toSch schema.Schema, buf int) RowDiffer {
|
||||
ad := NewAsyncDiffer(buf)
|
||||
if schema.IsKeyless(fromSch) && schema.IsKeyless(toSch) {
|
||||
|
||||
// assumes no PK changes
|
||||
if schema.IsKeyless(fromSch) || schema.IsKeyless(toSch) {
|
||||
return &keylessDiffer{AsyncDiffer: ad}
|
||||
}
|
||||
|
||||
return ad
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user