X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fftacmp%2Fquery_plan.cc;fp=src%2Fftacmp%2Fquery_plan.cc;h=8e05ae27e8c8352dc6b577449638f95df31e6d31;hb=f6db93ae9480bc87fb36b61cec0bf17e6082b7c1;hp=2e2286ec989aeeb86c8683a4ee97b9abae7dd132;hpb=811ec19e8829c72e0171ed9aee77942baecb6f90;p=com%2Fgs-lite.git diff --git a/src/ftacmp/query_plan.cc b/src/ftacmp/query_plan.cc index 2e2286e..8e05ae2 100644 --- a/src/ftacmp/query_plan.cc +++ b/src/ftacmp/query_plan.cc @@ -11134,84 +11134,67 @@ string join_eq_hash_qpn::generate_functor(table_list *schema, ext_fcn_list *Ext_ // create a temp status tuple - ret += "int create_temp_status_tuple(const host_tuple &tup0, const host_tuple &tup1, host_tuple& result) {\n\n"; + ret += "int create_temp_status_tuple("+this->generate_functor_name()+"_tempeqdef *lts,"+this->generate_functor_name()+"_tempeqdef *rts, host_tuple& result) {\n\n"; ret += "\tgs_retval_t retval = 0;\n"; ret += "\tgs_int32_t problem = 0;\n"; - ret += "\tif(tup0.data){\n"; - -// Unpack all the temporal attributes references in select list - col_id_set found_cids; - - for(s=0;sse->get_data_type()->is_temporal()) { -// Find the set of attributes accessed in this SE - col_id_set new_cids; - get_new_se_cids(select_list[s]->se,found_cids, new_cids, NULL); - } + for(p=0;pmake_host_cvar(tmpstr)+";\n"; + sprintf(tmpstr,"rhs_var"); + ret+="\t"+temporal_dt[p]->make_host_cvar(tmpstr)+";\n"; } - // Deal with outer join stuff - l_cids.clear(), r_cids.clear(); - for(ocsi=found_cids.begin();ocsi!=found_cids.end();++ocsi){ - if((*ocsi).tblvar_ref == 0) l_cids.insert((*ocsi)); - else r_cids.insert((*ocsi)); + ret += "\tif(lts!=NULL){\n"; + for(p=0;pget_type_name(schref,field)); - literal_t empty_lit(dt.type_indicator()); - if(empty_lit.is_cpx_lit()){ - sprintf(tmpstr,"&(unpack_var_%s_1)",field.c_str()); - unpack_null += "\t"+empty_lit.to_hfta_C_code(tmpstr)+";\n"; - }else{ - unpack_null+="\tunpack_var_"+field+"_1="+empty_lit.to_hfta_C_code("")+";\n"; - } - } + ret += "\t}else{\n"; + for(p=0;pget_type_name(schref,field)); - literal_t empty_lit(dt.type_indicator()); - if(empty_lit.is_cpx_lit()){ - sprintf(tmpstr,"&(unpack_var_%s_0)",field.c_str()); - unpack_null += "\t"+empty_lit.to_hfta_C_code(tmpstr)+";\n"; - }else{ - unpack_null+="\tunpack_var_"+field+"_0="+empty_lit.to_hfta_C_code("")+";\n"; - } - } + ret += "\tif(rts!=NULL){\n"; + for(p=0;pget_node_name()); // Start packing. - ret += "//\t\tPack the fields into the tuple.\n"; - ret += gen_pack_tuple(schema,select_list,this->get_node_name(), true ); + + +// This is checked in the query analyzer so I think its safe, +// But a lot of older code has complex code to propagate multiple +// timestamps + for(s=0;sse; + data_type *sdt = se->get_data_type(); + if(sdt->is_temporal()){ + string target = "\ttuple->tuple_var"+to_string(s)+" = "; + if(from[0]->get_property()==0 && from[1]->get_property()==0){ // INNER + ret += target+"(lhs_var>rhs_var ? lhs_var : rhs_var); // INNER\n"; + } + if(from[0]->get_property()!=0 && from[1]->get_property()==0){ // LEFT + ret += target+"lhs_var; // LEFT\n"; +// ret += target+"rhs_var; // LEFT\n"; + } + if(from[0]->get_property()==0 && from[1]->get_property()!=0){ // RIGHT + ret += target+"rhs_var; // RIGHT\n"; +// ret += target+"lhs_var; // RIGHT\n"; + } + if(from[0]->get_property()!=0 && from[1]->get_property()!=0){ // OUTER + ret += target+"(lhs_var