Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit c9539f24 authored by Jerome Touvier's avatar Jerome Touvier
Browse files

fix misplaced SET

parent 96be9947
Pipeline #50253 passed with stage
in 34 seconds
......@@ -49,7 +49,7 @@ def sql_request(paramslist):
select = list()
for params in paramslist:
s = f"""SET random_page_cost=1; SELECT network, station, location, channel, quality, samplerate, starttime, endtime, updated_at, UPPER(policy::text), rph5_id FROM rph5 WHERE"""
s = f"""SELECT network, station, location, channel, quality, samplerate, starttime, endtime, updated_at, UPPER(policy::text), rph5_id FROM rph5 WHERE"""
s = f"""{s} ({is_like_or_equal(params, "network")})"""
if params["station"] != "*":
s = f"""{s} AND ({is_like_or_equal(params, "station")})"""
......@@ -67,7 +67,7 @@ def sql_request(paramslist):
select.append(s.replace("?", "_").replace("*", "%"))
select = " UNION ".join(select)
nrows = get_max_rows(paramslist[0])
return f"""{select} ORDER BY network, station, location, channel, quality, samplerate, starttime, endtime LIMIT {nrows};"""
return f"""SET random_page_cost=1; {select} ORDER BY network, station, location, channel, quality, samplerate, starttime, endtime LIMIT {nrows};"""
def collect_data(params):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment