]> sourceware.org Git - bunsen.git/commitdiff
g-dejagnu-cluster-entropy: upsert syntax for rhel8 sqlite3
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 28 Jun 2022 22:35:55 +0000 (22:35 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 28 Jun 2022 22:35:55 +0000 (22:35 +0000)
3.24+ postgresql-style "upsert" requires a (...) bit no longer needed on newer sqlite3

bin/g-dejagnu-cluster-entropy

index 32a21f0d3bb1c1c7e9fe1c22b313f46c6063f3c8..4224966af6a1cc93b00c3a4e7b9af4680b5cd8f9 100755 (executable)
@@ -143,7 +143,7 @@ limit 1
                               expfileid, expfile_names[expfileid], set(expfiles_census[expfileid]), list(resultdict.items()), expentropy)
                 db.execute("""
 insert into testrun_cluster_dejagnu_expfile_entropy (cluster, expfile, entropy) values (?,?,?)
-on conflict do update set entropy=excluded.entropy;
+on conflict (cluster, expfile) do update set entropy=excluded.entropy;
 """, (clid, expfileid, expentropy))
                 db.commit()
                 clustentropy += expentropy
@@ -156,7 +156,7 @@ on conflict do update set entropy=excluded.entropy;
             # https://www.sqlite.org/lang_UPSERT.html
             db.execute("""
 insert into testrun_cluster_dejagnu_expfile_entropy_fresh (cluster, memberhash) values (?, ?)
-on conflict do update set memberhash=excluded.memberhash;
+on conflict(cluster) do update set memberhash=excluded.memberhash;
 """, (clid,memberhash))
             db.commit()
 
This page took 0.025115 seconds and 5 git commands to generate.