From 58609b8d83bb57b4bd4256aca9096515ff682883 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Fri, 7 Jan 2022 10:30:06 -0800 Subject: [PATCH] sql: log undecoded values as in tracing Previously, if the value part of a key-value pair wasn't needed, we would log it as `NULL`. However, that can be confusing whether an actual `NULL` value was decoded or not. This commit replaces the undecoded values with `` reducing the confusion (given that the likelihood of the value actually being equal to `` is negligible). Release note: None --- .../logic_test/regional_by_row_query_behavior | 24 +-- pkg/sql/colfetcher/cfetcher.go | 2 +- .../opt/exec/execbuilder/testdata/aggregate | 8 +- pkg/sql/opt/exec/execbuilder/testdata/ddl | 12 +- pkg/sql/opt/exec/execbuilder/testdata/insert | 78 +++++----- pkg/sql/opt/exec/execbuilder/testdata/orderby | 16 +- ...ndary_index_column_families_nonmetamorphic | 10 +- pkg/sql/opt/exec/execbuilder/testdata/select | 10 +- .../exec/execbuilder/testdata/select_index | 140 +++++++++--------- pkg/sql/opt/exec/execbuilder/testdata/update | 18 +-- .../testdata/update_nonmetamorphic | 6 +- pkg/sql/opt/exec/execbuilder/testdata/window | 12 +- pkg/sql/row/fetcher.go | 4 +- pkg/sql/schema_changer_test.go | 2 +- 14 files changed, 171 insertions(+), 171 deletions(-) diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior index 593dfda9e84a..93a1c77ba8ac 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior @@ -618,7 +618,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0, /Table/62/1/"\x80"/10/0, /Table/62/1/"\xc0"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0, /Table/61/1/"\x80"/10/0, /Table/61/1/"\xc0"/10/0 -fetched: /parent/parent_pkey/?/? -> NULL +fetched: /parent/parent_pkey/?/? -> # Semi join with locality optimized search disabled. query T @@ -648,7 +648,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0, /Table/62/1/"\x80"/10/0, /Table/62/1/"\xc0"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0, /Table/61/1/"\x80"/10/0, /Table/61/1/"\xc0"/10/0 -fetched: /parent/parent_pkey/?/? -> NULL +fetched: /parent/parent_pkey/?/? -> output row: [10 10] # Inner join with locality optimized search disabled. @@ -679,7 +679,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0, /Table/62/1/"\x80"/10/0, /Table/62/1/"\xc0"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0, /Table/61/1/"\x80"/10/0, /Table/61/1/"\xc0"/10/0 -fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> output row: [10 10 10] # Left join with locality optimized search disabled. @@ -710,7 +710,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0, /Table/62/1/"\x80"/10/0, /Table/62/1/"\xc0"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0, /Table/61/1/"\x80"/10/0, /Table/61/1/"\xc0"/10/0 -fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> output row: [10 10 10] statement ok @@ -777,7 +777,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0 -fetched: /parent/parent_pkey/?/? -> NULL +fetched: /parent/parent_pkey/?/? -> statement ok SET tracing = on,kv,results; SELECT * FROM child WHERE NOT EXISTS (SELECT * FROM parent WHERE p_id = c_p_id) AND c_id = 20; SET tracing = off @@ -795,7 +795,7 @@ Scan /Table/62/1/"\x80"/20/0, /Table/62/1/"\xc0"/20/0 fetched: /child/child_pkey/?/20/c_p_id -> /20 Scan /Table/61/1/"@"/20/0 Scan /Table/61/1/"\x80"/20/0, /Table/61/1/"\xc0"/20/0 -fetched: /parent/parent_pkey/?/? -> NULL +fetched: /parent/parent_pkey/?/? -> # Semi join with locality optimized search enabled. query T @@ -853,7 +853,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0 -fetched: /parent/parent_pkey/?/? -> NULL +fetched: /parent/parent_pkey/?/? -> output row: [10 10] statement ok @@ -872,7 +872,7 @@ Scan /Table/62/1/"\x80"/20/0, /Table/62/1/"\xc0"/20/0 fetched: /child/child_pkey/?/20/c_p_id -> /20 Scan /Table/61/1/"@"/20/0 Scan /Table/61/1/"\x80"/20/0, /Table/61/1/"\xc0"/20/0 -fetched: /parent/parent_pkey/?/? -> NULL +fetched: /parent/parent_pkey/?/? -> output row: [20 20] # Inner join with locality optimized search enabled. @@ -931,7 +931,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0 -fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> output row: [10 10 10] statement ok @@ -950,7 +950,7 @@ Scan /Table/62/1/"\x80"/20/0, /Table/62/1/"\xc0"/20/0 fetched: /child/child_pkey/?/20/c_p_id -> /20 Scan /Table/61/1/"@"/20/0 Scan /Table/61/1/"\x80"/20/0, /Table/61/1/"\xc0"/20/0 -fetched: /parent/parent_pkey/'ca-central-1'/20 -> NULL +fetched: /parent/parent_pkey/'ca-central-1'/20 -> output row: [20 20 20] # Left join with locality optimized search enabled. @@ -1009,7 +1009,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/62/1/"@"/10/0 fetched: /child/child_pkey/?/10/c_p_id -> /10 Scan /Table/61/1/"@"/10/0 -fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> output row: [10 10 10] statement ok @@ -1028,7 +1028,7 @@ Scan /Table/62/1/"\x80"/20/0, /Table/62/1/"\xc0"/20/0 fetched: /child/child_pkey/?/20/c_p_id -> /20 Scan /Table/61/1/"@"/20/0 Scan /Table/61/1/"\x80"/20/0, /Table/61/1/"\xc0"/20/0 -fetched: /parent/parent_pkey/'ca-central-1'/20 -> NULL +fetched: /parent/parent_pkey/'ca-central-1'/20 -> output row: [20 20 20] query T diff --git a/pkg/sql/colfetcher/cfetcher.go b/pkg/sql/colfetcher/cfetcher.go index d8a7ed9f7953..05a0898c7a88 100644 --- a/pkg/sql/colfetcher/cfetcher.go +++ b/pkg/sql/colfetcher/cfetcher.go @@ -1176,7 +1176,7 @@ func (rf *cFetcher) processValue(ctx context.Context, familyID descpb.FamilyID) } if rf.traceKV && prettyValue == "" { - prettyValue = tree.DNull.String() + prettyValue = "" } return nil diff --git a/pkg/sql/opt/exec/execbuilder/testdata/aggregate b/pkg/sql/opt/exec/execbuilder/testdata/aggregate index 755c141489ee..c71fc86a7baa 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/aggregate +++ b/pkg/sql/opt/exec/execbuilder/testdata/aggregate @@ -727,7 +727,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /xyz/zyx/?/?/1 -> NULL +fetched: /xyz/zyx/?/?/1 -> output row: [1] query T @@ -1082,13 +1082,13 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /xyz/xyz_pkey/1 -> NULL +fetched: /xyz/xyz_pkey/1 -> fetched: /xyz/xyz_pkey/1/y -> 2 fetched: /xyz/xyz_pkey/1/z -> 3.0 -fetched: /xyz/xyz_pkey/4 -> NULL +fetched: /xyz/xyz_pkey/4 -> fetched: /xyz/xyz_pkey/4/y -> 5 fetched: /xyz/xyz_pkey/4/z -> 6.0 -fetched: /xyz/xyz_pkey/7 -> NULL +fetched: /xyz/xyz_pkey/7 -> fetched: /xyz/xyz_pkey/7/z -> 8.0 output row: [9 4.5 6.33333333333333] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/ddl b/pkg/sql/opt/exec/execbuilder/testdata/ddl index 86753e91474f..10842170d161 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/ddl +++ b/pkg/sql/opt/exec/execbuilder/testdata/ddl @@ -137,7 +137,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1 -> NULL +fetched: /t/t_pkey/1 -> fetched: /t/t_pkey/1/b -> 1 output row: [1 1] @@ -163,7 +163,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/foo/1/1 -> NULL +fetched: /t/foo/1/1 -> output row: [1 1] statement ok @@ -177,8 +177,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/foo/1/1 -> NULL -fetched: /t/foo/1/2 -> NULL +fetched: /t/foo/1/1 -> +fetched: /t/foo/1/2 -> output row: [1 1] output row: [2 1] @@ -213,8 +213,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/b_desc/?/2 -> NULL -fetched: /t/b_desc/?/1 -> NULL +fetched: /t/b_desc/?/2 -> +fetched: /t/b_desc/?/1 -> fetched: /t/t_pkey/1/b/c -> /1/1 fetched: /t/t_pkey/2/b/c -> /2/2 output row: [1 1 1] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/insert b/pkg/sql/opt/exec/execbuilder/testdata/insert index e6a31b806566..4dccd1721921 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/insert +++ b/pkg/sql/opt/exec/execbuilder/testdata/insert @@ -31,19 +31,19 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/kv_pkey/'A' -> NULL -fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'A' -> +fetched: /kv/kv_pkey/'a' -> fetched: /kv/kv_pkey/'a'/v -> 'b' -fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c' -> fetched: /kv/kv_pkey/'c'/v -> 'd' -fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e' -> fetched: /kv/kv_pkey/'e'/v -> 'f' -fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g' -> fetched: /kv/kv_pkey/'g'/v -> '' -fetched: /kv/kv_pkey/'nil1' -> NULL -fetched: /kv/kv_pkey/'nil2' -> NULL -fetched: /kv/kv_pkey/'nil3' -> NULL -fetched: /kv/kv_pkey/'nil4' -> NULL +fetched: /kv/kv_pkey/'nil1' -> +fetched: /kv/kv_pkey/'nil2' -> +fetched: /kv/kv_pkey/'nil3' -> +fetched: /kv/kv_pkey/'nil4' -> output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -92,19 +92,19 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/kv_pkey/'A' -> NULL -fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'A' -> +fetched: /kv/kv_pkey/'a' -> fetched: /kv/kv_pkey/'a'/v -> 'b' -fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c' -> fetched: /kv/kv_pkey/'c'/v -> 'd' -fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e' -> fetched: /kv/kv_pkey/'e'/v -> 'f' -fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g' -> fetched: /kv/kv_pkey/'g'/v -> '' -fetched: /kv/kv_pkey/'nil1' -> NULL -fetched: /kv/kv_pkey/'nil2' -> NULL -fetched: /kv/kv_pkey/'nil3' -> NULL -fetched: /kv/kv_pkey/'nil4' -> NULL +fetched: /kv/kv_pkey/'nil1' -> +fetched: /kv/kv_pkey/'nil2' -> +fetched: /kv/kv_pkey/'nil3' -> +fetched: /kv/kv_pkey/'nil4' -> output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -153,21 +153,21 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/kv_pkey/'A' -> NULL -fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'A' -> +fetched: /kv/kv_pkey/'a' -> fetched: /kv/kv_pkey/'a'/v -> 'b' -fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c' -> fetched: /kv/kv_pkey/'c'/v -> 'd' -fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e' -> fetched: /kv/kv_pkey/'e'/v -> 'f' -fetched: /kv/kv_pkey/'f' -> NULL +fetched: /kv/kv_pkey/'f' -> fetched: /kv/kv_pkey/'f'/v -> 'g' -fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g' -> fetched: /kv/kv_pkey/'g'/v -> '' -fetched: /kv/kv_pkey/'nil1' -> NULL -fetched: /kv/kv_pkey/'nil2' -> NULL -fetched: /kv/kv_pkey/'nil3' -> NULL -fetched: /kv/kv_pkey/'nil4' -> NULL +fetched: /kv/kv_pkey/'nil1' -> +fetched: /kv/kv_pkey/'nil2' -> +fetched: /kv/kv_pkey/'nil3' -> +fetched: /kv/kv_pkey/'nil4' -> output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -219,21 +219,21 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/kv_pkey/'A' -> NULL -fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'A' -> +fetched: /kv/kv_pkey/'a' -> fetched: /kv/kv_pkey/'a'/v -> 'b' -fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c' -> fetched: /kv/kv_pkey/'c'/v -> 'd' -fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e' -> fetched: /kv/kv_pkey/'e'/v -> 'f' -fetched: /kv/kv_pkey/'f' -> NULL +fetched: /kv/kv_pkey/'f' -> fetched: /kv/kv_pkey/'f'/v -> 'g' -fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g' -> fetched: /kv/kv_pkey/'g'/v -> '' -fetched: /kv/kv_pkey/'nil1' -> NULL -fetched: /kv/kv_pkey/'nil2' -> NULL -fetched: /kv/kv_pkey/'nil3' -> NULL -fetched: /kv/kv_pkey/'nil4' -> NULL +fetched: /kv/kv_pkey/'nil1' -> +fetched: /kv/kv_pkey/'nil2' -> +fetched: /kv/kv_pkey/'nil3' -> +fetched: /kv/kv_pkey/'nil4' -> output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -292,7 +292,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv5/a/NULL/'a' -> NULL +fetched: /kv5/a/NULL/'a' -> output row: ['a' NULL] statement ok diff --git a/pkg/sql/opt/exec/execbuilder/testdata/orderby b/pkg/sql/opt/exec/execbuilder/testdata/orderby index 2f746f3e6c1e..d6efd042a732 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/orderby +++ b/pkg/sql/opt/exec/execbuilder/testdata/orderby @@ -302,9 +302,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /abc/abc_pkey/1/2/3 -> NULL +fetched: /abc/abc_pkey/1/2/3 -> fetched: /abc/abc_pkey/1/2/3/d -> 'one' -fetched: /abc/abc_pkey/4/5/6 -> NULL +fetched: /abc/abc_pkey/4/5/6 -> fetched: /abc/abc_pkey/4/5/6/d -> 'Two' output row: [1 2 3 'one'] output row: [4 5 6 'Two'] @@ -317,8 +317,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /abc/ba/2/1/? -> NULL -fetched: /abc/ba/5/4/? -> NULL +fetched: /abc/ba/2/1/? -> +fetched: /abc/ba/5/4/? -> output row: [1 2] output row: [4 5] @@ -490,10 +490,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /abc/abc_pkey/4/?/? -> NULL -fetched: /abc/abc_pkey/4/?/? -> NULL -fetched: /abc/abc_pkey/1/?/? -> NULL -fetched: /abc/abc_pkey/1/?/? -> NULL +fetched: /abc/abc_pkey/4/?/? -> +fetched: /abc/abc_pkey/4/?/? -> +fetched: /abc/abc_pkey/1/?/? -> +fetched: /abc/abc_pkey/1/?/? -> output row: [4] output row: [1] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/secondary_index_column_families_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/secondary_index_column_families_nonmetamorphic index b1757917cd17..0b444422d03f 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/secondary_index_column_families_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/secondary_index_column_families_nonmetamorphic @@ -59,7 +59,7 @@ query T SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE message LIKE 'fetched: /t1/nonuniqueidx/%' ---- -fetched: /t1/nonuniqueidx/1/? -> NULL +fetched: /t1/nonuniqueidx/1/? -> query I SET TRACING=on,kv,results; @@ -85,7 +85,7 @@ query T SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE message LIKE 'fetched: /t1/nonuniqueidxstoring/%' ---- -fetched: /t1/nonuniqueidxstoring/1/1 -> NULL +fetched: /t1/nonuniqueidxstoring/1/1 -> fetched: /t1/nonuniqueidxstoring/1/1/z -> /1 fetched: /t1/nonuniqueidxstoring/1/1/a/b -> /1/1 @@ -319,11 +319,11 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE message LIKE 'fetched%' ORDER BY message ---- -fetched: /t/i/2/1 -> NULL +fetched: /t/i/2/1 -> fetched: /t/i/2/1/w -> /3 -fetched: /t/i/5/4 -> NULL +fetched: /t/i/5/4 -> fetched: /t/i/5/4/z -> /6 -fetched: /t/i/9/8 -> NULL +fetched: /t/i/9/8 -> statement ok DROP TABLE IF EXISTS t; diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select b/pkg/sql/opt/exec/execbuilder/testdata/select index 8c25a35d8403..0d9da29764aa 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select +++ b/pkg/sql/opt/exec/execbuilder/testdata/select @@ -609,8 +609,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/b_idx/NULL/2 -> NULL -fetched: /t/b_idx/NULL/3 -> NULL +fetched: /t/b_idx/NULL/2 -> +fetched: /t/b_idx/NULL/3 -> fetched: /t/b_idx/2/1/c/d -> /3/4 output row: [2 NULL NULL NULL] output row: [3 NULL NULL NULL] @@ -826,7 +826,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453' -> NULL +fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453' -> fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453'/b -> '2015-08-25' fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453'/c -> '02:45:02.234' output row: ['2015-08-25 04:45:45.53453' '2015-08-25' '02:45:02.234'] @@ -947,8 +947,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /c/b_idx/NULL/2 -> NULL -fetched: /c/b_idx/NULL/3 -> NULL +fetched: /c/b_idx/NULL/2 -> +fetched: /c/b_idx/NULL/3 -> fetched: /c/b_idx/0.4/1/b -> /0.40 output row: [2 NULL] output row: [3 NULL] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select_index b/pkg/sql/opt/exec/execbuilder/testdata/select_index index 886850993bf3..7764cfaa8626 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/select_index @@ -29,7 +29,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/2/'two' -> NULL +fetched: /t/t_pkey/2/'two' -> fetched: /t/t_pkey/2/'two'/c -> 22 fetched: /t/t_pkey/2/'two'/d -> 'bar' output row: [2 'two' 22 'bar'] @@ -42,10 +42,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one' -> fetched: /t/t_pkey/1/'one'/c -> 11 fetched: /t/t_pkey/1/'one'/d -> 'foo' -fetched: /t/t_pkey/3/'three' -> NULL +fetched: /t/t_pkey/3/'three' -> fetched: /t/t_pkey/3/'three'/c -> 33 fetched: /t/t_pkey/3/'three'/d -> 'blah' output row: [1 'one' 11 'foo'] @@ -59,8 +59,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/dc/'bar'/22/2/'two' -> NULL -fetched: /t/dc/'foo'/11/1/'one' -> NULL +fetched: /t/dc/'bar'/22/2/'two' -> +fetched: /t/dc/'foo'/11/1/'one' -> output row: [2 'two' 22 'bar'] output row: [1 'one' 11 'foo'] @@ -72,8 +72,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/dc/'bar'/22/2/'two' -> NULL -fetched: /t/dc/'foo'/11/1/'one' -> NULL +fetched: /t/dc/'bar'/22/2/'two' -> +fetched: /t/dc/'foo'/11/1/'one' -> output row: [2 'two' 22 'bar'] output row: [1 'one' 11 'foo'] @@ -85,7 +85,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/dc/'foo'/11/1/'one' -> NULL +fetched: /t/dc/'foo'/11/1/'one' -> output row: [1 'one' 11 'foo'] statement ok @@ -96,7 +96,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one' -> fetched: /t/t_pkey/1/'one'/c -> 11 fetched: /t/t_pkey/1/'one'/d -> 'foo' output row: [1 'one' 11 'foo'] @@ -109,10 +109,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one' -> fetched: /t/t_pkey/1/'one'/c -> 11 fetched: /t/t_pkey/1/'one'/d -> 'foo' -fetched: /t/t_pkey/2/'two' -> NULL +fetched: /t/t_pkey/2/'two' -> fetched: /t/t_pkey/2/'two'/c -> 22 fetched: /t/t_pkey/2/'two'/d -> 'bar' output row: [1 'one' 11 'foo'] @@ -126,8 +126,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/bc/'three'/?/3 -> NULL -fetched: /t/bc/'two'/?/2 -> NULL +fetched: /t/bc/'three'/?/3 -> +fetched: /t/bc/'two'/?/2 -> output row: [3 'three'] output row: [2 'two'] @@ -139,7 +139,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/dc/'bar'/22/2/'two' -> NULL +fetched: /t/dc/'bar'/22/2/'two' -> output row: [2 'two' 22 'bar'] statement ok @@ -150,13 +150,13 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one' -> fetched: /t/t_pkey/1/'one'/c -> 11 fetched: /t/t_pkey/1/'one'/d -> 'foo' -fetched: /t/t_pkey/2/'two' -> NULL +fetched: /t/t_pkey/2/'two' -> fetched: /t/t_pkey/2/'two'/c -> 22 fetched: /t/t_pkey/2/'two'/d -> 'bar' -fetched: /t/t_pkey/3/'three' -> NULL +fetched: /t/t_pkey/3/'three' -> fetched: /t/t_pkey/3/'three'/c -> 33 fetched: /t/t_pkey/3/'three'/d -> 'blah' output row: [2 'two' 22 'bar'] @@ -170,9 +170,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/a_desc/3/? -> NULL -fetched: /t/a_desc/2/? -> NULL -fetched: /t/a_desc/1/? -> NULL +fetched: /t/a_desc/3/? -> +fetched: /t/a_desc/2/? -> +fetched: /t/a_desc/1/? -> output row: [3] output row: [2] output row: [1] @@ -186,8 +186,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/a_desc/3/? -> NULL -fetched: /t/a_desc/2/? -> NULL +fetched: /t/a_desc/3/? -> +fetched: /t/a_desc/2/? -> output row: [3] output row: [2] @@ -249,7 +249,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'c' -> NULL +fetched: /t/t_pkey/1/'c' -> output row: [1 'c' NULL NULL] statement ok @@ -260,7 +260,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'c' -> NULL +fetched: /t/t_pkey/1/'c' -> output row: [1 'c' NULL NULL] statement ok @@ -288,7 +288,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/t_pkey/1/'b' -> NULL +fetched: /t/t_pkey/1/'b' -> output row: [1 'b' NULL NULL] statement ok @@ -312,7 +312,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL +fetched: /t/ab/3/4 -> output row: [3 4] statement ok @@ -323,7 +323,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL +fetched: /t/ab/3/4 -> output row: [3 4] statement ok @@ -334,8 +334,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL -fetched: /t/ab/5/6 -> NULL +fetched: /t/ab/3/4 -> +fetched: /t/ab/5/6 -> output row: [3 4] output row: [5 6] @@ -347,8 +347,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/1/2 -> NULL -fetched: /t/ab/3/4 -> NULL +fetched: /t/ab/1/2 -> +fetched: /t/ab/3/4 -> output row: [1 2] output row: [3 4] @@ -360,8 +360,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/1/2 -> NULL -fetched: /t/ab/3/4 -> NULL +fetched: /t/ab/1/2 -> +fetched: /t/ab/3/4 -> output row: [1 2] output row: [3 4] @@ -373,8 +373,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/1/2 -> NULL -fetched: /t/ab/3/4 -> NULL +fetched: /t/ab/1/2 -> +fetched: /t/ab/3/4 -> output row: [1 2] output row: [3 4] @@ -386,8 +386,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL -fetched: /t/ab/5/6 -> NULL +fetched: /t/ab/3/4 -> +fetched: /t/ab/5/6 -> output row: [3 4] output row: [5 6] @@ -399,8 +399,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL -fetched: /t/ab/5/6 -> NULL +fetched: /t/ab/3/4 -> +fetched: /t/ab/5/6 -> output row: [3 4] output row: [5 6] @@ -412,8 +412,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL -fetched: /t/ab/5/6 -> NULL +fetched: /t/ab/3/4 -> +fetched: /t/ab/5/6 -> output row: [3 4] output row: [5 6] @@ -425,8 +425,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/1/2 -> NULL -fetched: /t/ab/5/6 -> NULL +fetched: /t/ab/1/2 -> +fetched: /t/ab/5/6 -> output row: [1 2] output row: [5 6] @@ -438,7 +438,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/ab/3/4 -> NULL +fetched: /t/ab/3/4 -> output row: [3 4] query T @@ -1318,8 +1318,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /noncover/b/?/1 -> NULL -fetched: /noncover/noncover_pkey/1 -> NULL +fetched: /noncover/b/?/1 -> +fetched: /noncover/noncover_pkey/1 -> fetched: /noncover/noncover_pkey/1/b -> 2 fetched: /noncover/noncover_pkey/1/c -> 3 fetched: /noncover/noncover_pkey/1/d -> 4 @@ -1356,7 +1356,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- fetched: /noncover/c/? -> /5 -fetched: /noncover/noncover_pkey/5 -> NULL +fetched: /noncover/noncover_pkey/5 -> fetched: /noncover/noncover_pkey/5/b -> 6 fetched: /noncover/noncover_pkey/5/c -> 7 fetched: /noncover/noncover_pkey/5/d -> 8 @@ -1599,10 +1599,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t2/bc/2/1/4 -> NULL -fetched: /t2/bc/2/2/5 -> NULL -fetched: /t2/bc/2/3/6 -> NULL -fetched: /t2/t2_pkey/5 -> NULL +fetched: /t2/bc/2/1/4 -> +fetched: /t2/bc/2/2/5 -> +fetched: /t2/bc/2/3/6 -> +fetched: /t2/t2_pkey/5 -> fetched: /t2/t2_pkey/5/b -> 2 fetched: /t2/t2_pkey/5/c -> 2 fetched: /t2/t2_pkey/5/s -> '22' @@ -1635,13 +1635,13 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t2/bc/?/?/4 -> NULL -fetched: /t2/bc/?/?/6 -> NULL -fetched: /t2/t2_pkey/4 -> NULL +fetched: /t2/bc/?/?/4 -> +fetched: /t2/bc/?/?/6 -> +fetched: /t2/t2_pkey/4 -> fetched: /t2/t2_pkey/4/b -> 2 fetched: /t2/t2_pkey/4/c -> 1 fetched: /t2/t2_pkey/4/s -> '21' -fetched: /t2/t2_pkey/6 -> NULL +fetched: /t2/t2_pkey/6 -> fetched: /t2/t2_pkey/6/b -> 2 fetched: /t2/t2_pkey/6/c -> 3 fetched: /t2/t2_pkey/6/s -> '23' @@ -1657,13 +1657,13 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t2/bc/?/?/4 -> NULL -fetched: /t2/bc/?/?/6 -> NULL -fetched: /t2/t2_pkey/4 -> NULL +fetched: /t2/bc/?/?/4 -> +fetched: /t2/bc/?/?/6 -> +fetched: /t2/t2_pkey/4 -> fetched: /t2/t2_pkey/4/b -> 2 fetched: /t2/t2_pkey/4/c -> 1 fetched: /t2/t2_pkey/4/s -> '21' -fetched: /t2/t2_pkey/6 -> NULL +fetched: /t2/t2_pkey/6 -> fetched: /t2/t2_pkey/6/b -> 2 fetched: /t2/t2_pkey/6/c -> 3 fetched: /t2/t2_pkey/6/s -> '23' @@ -1679,39 +1679,39 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t2/t2_pkey/1 -> NULL +fetched: /t2/t2_pkey/1 -> fetched: /t2/t2_pkey/1/b -> 1 fetched: /t2/t2_pkey/1/c -> 1 fetched: /t2/t2_pkey/1/s -> '11' -fetched: /t2/t2_pkey/2 -> NULL +fetched: /t2/t2_pkey/2 -> fetched: /t2/t2_pkey/2/b -> 1 fetched: /t2/t2_pkey/2/c -> 2 fetched: /t2/t2_pkey/2/s -> '12' -fetched: /t2/t2_pkey/3 -> NULL +fetched: /t2/t2_pkey/3 -> fetched: /t2/t2_pkey/3/b -> 1 fetched: /t2/t2_pkey/3/c -> 3 fetched: /t2/t2_pkey/3/s -> '13' -fetched: /t2/t2_pkey/4 -> NULL +fetched: /t2/t2_pkey/4 -> fetched: /t2/t2_pkey/4/b -> 2 fetched: /t2/t2_pkey/4/c -> 1 fetched: /t2/t2_pkey/4/s -> '21' -fetched: /t2/t2_pkey/5 -> NULL +fetched: /t2/t2_pkey/5 -> fetched: /t2/t2_pkey/5/b -> 2 fetched: /t2/t2_pkey/5/c -> 2 fetched: /t2/t2_pkey/5/s -> '22' -fetched: /t2/t2_pkey/6 -> NULL +fetched: /t2/t2_pkey/6 -> fetched: /t2/t2_pkey/6/b -> 2 fetched: /t2/t2_pkey/6/c -> 3 fetched: /t2/t2_pkey/6/s -> '23' -fetched: /t2/t2_pkey/7 -> NULL +fetched: /t2/t2_pkey/7 -> fetched: /t2/t2_pkey/7/b -> 3 fetched: /t2/t2_pkey/7/c -> 1 fetched: /t2/t2_pkey/7/s -> '31' -fetched: /t2/t2_pkey/8 -> NULL +fetched: /t2/t2_pkey/8 -> fetched: /t2/t2_pkey/8/b -> 3 fetched: /t2/t2_pkey/8/c -> 2 fetched: /t2/t2_pkey/8/s -> '32' -fetched: /t2/t2_pkey/9 -> NULL +fetched: /t2/t2_pkey/9 -> fetched: /t2/t2_pkey/9/b -> 3 fetched: /t2/t2_pkey/9/c -> 3 fetched: /t2/t2_pkey/9/s -> '33' @@ -1806,7 +1806,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t4/t4_pkey/?/? -> NULL +fetched: /t4/t4_pkey/?/? -> fetched: /t4/t4_pkey/?/?/c -> 30 output row: [30] @@ -1830,7 +1830,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t4/t4_pkey/?/? -> NULL +fetched: /t4/t4_pkey/?/? -> fetched: /t4/t4_pkey/?/?/d -> 40 output row: [40] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/update b/pkg/sql/opt/exec/execbuilder/testdata/update index f837456c71bc..2dbc8332e4f4 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/update +++ b/pkg/sql/opt/exec/execbuilder/testdata/update @@ -20,13 +20,13 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv2/kv2_pkey/'a' -> NULL +fetched: /kv2/kv2_pkey/'a' -> fetched: /kv2/kv2_pkey/'a'/v -> 'b' -fetched: /kv2/kv2_pkey/'c' -> NULL +fetched: /kv2/kv2_pkey/'c' -> fetched: /kv2/kv2_pkey/'c'/v -> 'd' -fetched: /kv2/kv2_pkey/'e' -> NULL +fetched: /kv2/kv2_pkey/'e' -> fetched: /kv2/kv2_pkey/'e'/v -> 'f' -fetched: /kv2/kv2_pkey/'f' -> NULL +fetched: /kv2/kv2_pkey/'f' -> fetched: /kv2/kv2_pkey/'f'/v -> 'g' output row: ['a' 'b'] output row: ['c' 'd'] @@ -61,13 +61,13 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv2/kv2_pkey/'a' -> NULL +fetched: /kv2/kv2_pkey/'a' -> fetched: /kv2/kv2_pkey/'a'/v -> 'b' -fetched: /kv2/kv2_pkey/'c' -> NULL +fetched: /kv2/kv2_pkey/'c' -> fetched: /kv2/kv2_pkey/'c'/v -> 'd' -fetched: /kv2/kv2_pkey/'e' -> NULL +fetched: /kv2/kv2_pkey/'e' -> fetched: /kv2/kv2_pkey/'e'/v -> 'f' -fetched: /kv2/kv2_pkey/'f' -> NULL +fetched: /kv2/kv2_pkey/'f' -> fetched: /kv2/kv2_pkey/'f'/v -> 'g' output row: ['a' 'b'] output row: ['c' 'd'] @@ -301,7 +301,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /pks/pks_pkey/2/2 -> NULL +fetched: /pks/pks_pkey/2/2 -> fetched: /pks/pks_pkey/2/2/v -> 3 output row: [2 2 3] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic index c7059feb1373..fa2ef182c9ca 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic @@ -44,8 +44,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE operation != 'dist sender send' ---- Scan /Table/56/{1-2} -fetched: /tu/tu_pkey/1 -> NULL -fetched: /tu/tu_pkey/1 -> NULL +fetched: /tu/tu_pkey/1 -> +fetched: /tu/tu_pkey/1 -> fetched: /tu/tu_pkey/1/c/d -> /3/4 Put /Table/56/1/1/2/1 -> /TUPLE/3:3:Int/4/1:4:Int/4 fast path completed @@ -59,7 +59,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE operation != 'dist sender send' ---- Scan /Table/56/{1-2} -fetched: /tu/tu_pkey/1 -> NULL +fetched: /tu/tu_pkey/1 -> fetched: /tu/tu_pkey/1/b -> 2 fetched: /tu/tu_pkey/1/c/d -> /4/4 Del /Table/56/1/1/1/1 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/window b/pkg/sql/opt/exec/execbuilder/testdata/window index 6b70745ecb0a..46fa5118e261 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/window +++ b/pkg/sql/opt/exec/execbuilder/testdata/window @@ -33,21 +33,21 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- fetched: /kv/kv_pkey/1/v -> /2 fetched: /kv/kv_pkey/1/d -> 1 -fetched: /kv/kv_pkey/1 -> NULL +fetched: /kv/kv_pkey/1 -> fetched: /kv/kv_pkey/3/v -> /4 fetched: /kv/kv_pkey/3/d -> 8 -fetched: /kv/kv_pkey/3 -> NULL -fetched: /kv/kv_pkey/5 -> NULL +fetched: /kv/kv_pkey/3 -> +fetched: /kv/kv_pkey/5 -> fetched: /kv/kv_pkey/5/d -> -321 fetched: /kv/kv_pkey/6/v -> /2 fetched: /kv/kv_pkey/6/d -> 4.4 -fetched: /kv/kv_pkey/6 -> NULL +fetched: /kv/kv_pkey/6 -> fetched: /kv/kv_pkey/7/v -> /2 fetched: /kv/kv_pkey/7/d -> 7.9 -fetched: /kv/kv_pkey/7 -> NULL +fetched: /kv/kv_pkey/7 -> fetched: /kv/kv_pkey/8/v -> /4 fetched: /kv/kv_pkey/8/d -> 3 -fetched: /kv/kv_pkey/8 -> NULL +fetched: /kv/kv_pkey/8 -> output row: [5 NULL] output row: [1 3.4501207708330056852] output row: [6 3.4501207708330056852] diff --git a/pkg/sql/row/fetcher.go b/pkg/sql/row/fetcher.go index 0a34de20cc01..e3114a33ba69 100644 --- a/pkg/sql/row/fetcher.go +++ b/pkg/sql/row/fetcher.go @@ -869,7 +869,7 @@ func (rf *Fetcher) processKV( if table.neededCols.Empty() { // We don't need to decode any values. if rf.traceKV { - prettyValue = tree.DNull.String() + prettyValue = "" } return prettyKey, prettyValue, nil } @@ -977,7 +977,7 @@ func (rf *Fetcher) processKV( } if rf.traceKV && prettyValue == "" { - prettyValue = tree.DNull.String() + prettyValue = "" } return prettyKey, prettyValue, nil diff --git a/pkg/sql/schema_changer_test.go b/pkg/sql/schema_changer_test.go index 749df19a5300..09b6bb0a4d7d 100644 --- a/pkg/sql/schema_changer_test.go +++ b/pkg/sql/schema_changer_test.go @@ -3792,7 +3792,7 @@ CREATE TABLE d.t ( } // Ensure that the decoder sees the old encoding. for indexName, expExplainRow := range map[string]string{ - "i": "fetched: /t/i/1/11/2 -> NULL", + "i": "fetched: /t/i/1/11/2 -> ", "u": "fetched: /t/u/1 -> /11/2", } { t.Run("index scan", func(t *testing.T) {