Skip to content

Instantly share code, notes, and snippets.

@andytill
Created December 14, 2016 13:46
Show Gist options
  • Save andytill/0ea161d304c139be2523d9289b5b5325 to your computer and use it in GitHub Desktop.
Save andytill/0ea161d304c139be2523d9289b5b5325 to your computer and use it in GitHub Desktop.
diff --git a/tests/ts_simple_blob.erl b/tests/ts_simple_blob.erl
index 7235a26..a9fdb42 100644
--- a/tests/ts_simple_blob.erl
+++ b/tests/ts_simple_blob.erl
@@ -52,10 +52,15 @@ confirm() ->
Expected =
{ok, {Headers, Data}},
- Cluster = ts_setup:start_cluster(1),
+ lager:info("FREAD OUTPUT ~p", [io:fread("Hi.", "\n")]),
+ [Node|_] = Cluster = ts_setup:start_cluster(1),
+ trace(Node, "riak_kv_qry_compiler:compile"),
ts_setup:create_bucket_type(Cluster, DDL, Table),
ts_setup:activate_bucket_type(Cluster, Table),
ts_ops:put(Cluster, Table, Data),
Got = ts_ops:query(Cluster, Qry, [{datatypes, true}]),
?assertEqual(Expected, Got),
pass.
+
+trace(Node, TraceString) ->
+ rpc:call(Node, redbug, start, [TraceString]).
13:42:54.512 [info] <0.215.0> Waiting for services [riak_kv]: current services: [riak_repl,riak_pipe,riak_kv]
13:42:54.631 [info] <0.215.0> Running query select * from MyBlob where time > 0 and time < 50 and name = 'fred' and version = 5 and firmware = 0x00010222
13:42:54.631 [info] <0.215.0> Waiting for services [riak_kv]: current services: [riak_repl,riak_pipe,riak_kv]
13:42:54.643 [info] <0.214.0> % 13:42:54 <0.2619.0>({riak_api_pb_server,init,1})
13:42:54.643 [info] <0.214.0> % riak_kv_qry_compiler:compile({ddl_v2,<<"MyBlob">>,
13:42:54.643 [info] <0.214.0> [{riak_field_v1,<<"name">>,1,varchar,false},
13:42:54.643 [info] <0.214.0> {riak_field_v1,<<"firmware">>,2,blob,false},
13:42:54.643 [info] <0.214.0> {riak_field_v1,<<"version">>,3,sint64,false},
13:42:54.643 [info] <0.214.0> {riak_field_v1,<<"time">>,4,timestamp,false},
13:42:54.643 [info] <0.214.0> {riak_field_v1,<<"weather">>,5,varchar,true}],
13:42:54.643 [info] <0.214.0> {key_v1,[{param_v2,[<<"name">>],undefined},
13:42:54.643 [info] <0.214.0> {param_v2,[<<"firmware">>],undefined},
13:42:54.643 [info] <0.214.0> {param_v2,[<<"version">>],undefined},
13:42:54.643 [info] <0.214.0> {hash_fn_v1,riak_ql_quanta,quantum,
13:42:54.643 [info] <0.214.0> [{param_v2,[<<"time">>],undefined},15,m],
13:42:54.643 [info] <0.214.0> timestamp}]},
13:42:54.643 [info] <0.214.0> {key_v1,[{param_v2,[<<"name">>],undefined},
13:42:54.643 [info] <0.214.0> {param_v2,[<<"firmware">>],undefined},
13:42:54.643 [info] <0.214.0> {param_v2,[<<"version">>],undefined},
13:42:54.643 [info] <0.214.0> {param_v2,[<<"time">>],undefined}]},
13:42:54.643 [info] <0.214.0> v2}, {riak_select_v3,
13:42:54.643 [info] <0.214.0> {riak_sel_clause_v1,rows,[],[],[],[{identifier,[<<"*">>]}],[]},
13:42:54.643 [info] <0.214.0> <<"MyBlob">>,
13:42:54.643 [info] <0.214.0> [{and_,
13:42:54.643 [info] <0.214.0> {'=',<<"firmware">>,{binary,<<0,1,2,34>>}},
13:42:54.643 [info] <0.214.0> {and_,
13:42:54.643 [info] <0.214.0> {'=',<<"version">>,{integer,5}},
13:42:54.643 [info] <0.214.0> {and_,
13:42:54.643 [info] <0.214.0> {'=',<<"name">>,{binary,<<"fred">>}},
13:42:54.643 [info] <0.214.0> {and_,
13:42:54.643 [info] <0.214.0> {'<',<<"time">>,{integer,50}},
13:42:54.644 [info] <0.214.0> {'>',<<"time">>,{integer,0}}}}}}],
13:42:54.644 [info] <0.214.0> [],[],riak_ql_table_MyBlob_320523031941664944417524937300681317050,none,
13:42:54.644 [info] <0.214.0> false,sql,undefined,undefined,[],[],undefined})
13:42:54.663 [info] <0.215.0> Result is {ok,{[{<<"name">>,varchar},{<<"firmware">>,blob},{<<"version">>,sint64},{<<"time">>,timestamp},{<<"weather">>,varchar}],[{<<"fred">>,<<0,1,2,34>>,5,1,<<"rainy">>},
{<<"fred">>,<<0,1,2,34>>,5,3,<<"snowy">>},{<<"fred">>,<<0,1,2,34>>,5,9,<<"generically wet">>}]}}
13:42:54.663 [notice] <0.2.0> ts_simple_blob Test Run Complete pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment