# # # patch "database.cc" # from [428d1e533e23dcc021dd4f6dbdca8c61ca67bfe9] # to [5d6aa4492c9e21562db4a04c0b28faa16bb5dd2c] # ============================================================ --- database.cc 428d1e533e23dcc021dd4f6dbdca8c61ca67bfe9 +++ database.cc 5d6aa4492c9e21562db4a04c0b28faa16bb5dd2c @@ -2305,7 +2305,7 @@ spot++; certvalue = i->second.substr(spot); lim += "SELECT id FROM revision_certs "; - lim += (boost::format("WHERE name='%s' AND unbase64(value) glob '%s'") + lim += (boost::format("WHERE name='%s' AND value glob '%s'") % certname % certvalue).str(); } else @@ -2324,7 +2324,7 @@ % author_cert_name % tag_cert_name % branch_cert_name).str(); - lim += (boost::format(" AND unbase64(value) glob '*%s*'") + lim += (boost::format(" AND value glob '*%s*'") % i->second).str(); } else if (i->first == selectors::sel_head) @@ -2338,7 +2338,7 @@ } else { - string subquery = (boost::format("SELECT DISTINCT value FROM revision_certs WHERE name='%s' and unbase64(value) glob '%s'") + string subquery = (boost::format("SELECT DISTINCT value FROM revision_certs WHERE name='%s' and value glob '%s'") % branch_cert_name % i->second).str(); results res; fetch(res, one_col, any_rows, subquery.c_str()); @@ -2385,8 +2385,7 @@ if ((i->first == selectors::sel_branch) && (i->second.size() == 0)) { __app->require_working_copy("the empty branch selector b: refers to the current branch"); - // FIXME: why do we have to glob on the unbase64(value), rather than being able to use == ? - lim += (boost::format("SELECT id FROM revision_certs WHERE name='%s' AND unbase64(value) glob '%s'") + lim += (boost::format("SELECT id FROM revision_certs WHERE name='%s' AND value glob '%s'") % branch_cert_name % __app->branch_name).str(); L(FL("limiting to current branch '%s'\n") % __app->branch_name); } @@ -2396,13 +2395,13 @@ switch (i->first) { case selectors::sel_earlier: - lim += (boost::format("unbase64(value) <= X'%s'") % encode_hexenc(i->second)).str(); + lim += (boost::format("value <= X'%s'") % encode_hexenc(i->second)).str(); break; case selectors::sel_later: - lim += (boost::format("unbase64(value) > X'%s'") % encode_hexenc(i->second)).str(); + lim += (boost::format("value > X'%s'") % encode_hexenc(i->second)).str(); break; default: - lim += (boost::format("unbase64(value) glob '%s%s%s'") + lim += (boost::format("value glob '%s%s%s'") % prefix % i->second % suffix).str(); break; } @@ -2443,7 +2442,7 @@ (boost::format(" (name='%s')") % certname).str(); } - query += (boost::format(" AND (unbase64(value) GLOB '%s%s%s')") + query += (boost::format(" AND (value GLOB '%s%s%s')") % prefix % partial % suffix).str(); query += (boost::format(" AND (id IN %s)") % lim).str(); }