diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-10-12 13:02:23 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-10-12 14:47:32 +0200 |
commit | 55553e01b8e19d250756538a3d94e48f16ecbb7b (patch) | |
tree | d9229b9b3857ca5fa0984a1ee0acbd9ff8c8c85e /src/datacache | |
parent | 342ab049a74a951d30584ee88ae12765846ee38d (diff) | |
download | gnunet-55553e01b8e19d250756538a3d94e48f16ecbb7b.tar.gz gnunet-55553e01b8e19d250756538a3d94e48f16ecbb7b.zip |
-remove unnecessary and badly used extra argument in postgres statement preparation
Diffstat (limited to 'src/datacache')
-rw-r--r-- | src/datacache/plugin_datacache_postgres.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index b1f9a1b8e..01b2372f1 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c | |||
@@ -95,21 +95,17 @@ init_connection (struct Plugin *plugin) | |||
95 | struct GNUNET_PQ_PreparedStatement ps[] = { | 95 | struct GNUNET_PQ_PreparedStatement ps[] = { |
96 | GNUNET_PQ_make_prepare ("getkt", | 96 | GNUNET_PQ_make_prepare ("getkt", |
97 | "SELECT expiration_time,type,ro,value,trunc,path FROM gn180dc " | 97 | "SELECT expiration_time,type,ro,value,trunc,path FROM gn180dc " |
98 | "WHERE key=$1 AND type=$2 AND expiration_time >= $3", | 98 | "WHERE key=$1 AND type=$2 AND expiration_time >= $3"), |
99 | 3), | ||
100 | GNUNET_PQ_make_prepare ("getk", | 99 | GNUNET_PQ_make_prepare ("getk", |
101 | "SELECT expiration_time,type,ro,value,trunc,path FROM gn180dc " | 100 | "SELECT expiration_time,type,ro,value,trunc,path FROM gn180dc " |
102 | "WHERE key=$1 AND expiration_time >= $2", | 101 | "WHERE key=$1 AND expiration_time >= $2"), |
103 | 2), | ||
104 | GNUNET_PQ_make_prepare ("getex", | 102 | GNUNET_PQ_make_prepare ("getex", |
105 | "SELECT LENGTH(value) AS len,oid,key FROM gn180dc" | 103 | "SELECT LENGTH(value) AS len,oid,key FROM gn180dc" |
106 | " WHERE expiration_time < $1" | 104 | " WHERE expiration_time < $1" |
107 | " ORDER BY expiration_time ASC LIMIT 1", | 105 | " ORDER BY expiration_time ASC LIMIT 1"), |
108 | 1), | ||
109 | GNUNET_PQ_make_prepare ("getm", | 106 | GNUNET_PQ_make_prepare ("getm", |
110 | "SELECT LENGTH(value) AS len,oid,key FROM gn180dc" | 107 | "SELECT LENGTH(value) AS len,oid,key FROM gn180dc" |
111 | " ORDER BY prox ASC, expiration_time ASC LIMIT 1", | 108 | " ORDER BY prox ASC, expiration_time ASC LIMIT 1"), |
112 | 0), | ||
113 | GNUNET_PQ_make_prepare ("get_closest", | 109 | GNUNET_PQ_make_prepare ("get_closest", |
114 | "(SELECT expiration_time,type,ro,value,trunc,path,key FROM gn180dc" | 110 | "(SELECT expiration_time,type,ro,value,trunc,path,key FROM gn180dc" |
115 | " WHERE key >= $1" | 111 | " WHERE key >= $1" |
@@ -123,16 +119,13 @@ init_connection (struct Plugin *plugin) | |||
123 | " AND expiration_time >= $2" | 119 | " AND expiration_time >= $2" |
124 | " AND ( (type = $3) OR ( 0 = $3) )" | 120 | " AND ( (type = $3) OR ( 0 = $3) )" |
125 | " ORDER BY key DESC" | 121 | " ORDER BY key DESC" |
126 | " LIMIT $4)", | 122 | " LIMIT $4)"), |
127 | 4), | ||
128 | GNUNET_PQ_make_prepare ("delrow", | 123 | GNUNET_PQ_make_prepare ("delrow", |
129 | "DELETE FROM gn180dc WHERE oid=$1", | 124 | "DELETE FROM gn180dc WHERE oid=$1"), |
130 | 1), | ||
131 | GNUNET_PQ_make_prepare ("put", | 125 | GNUNET_PQ_make_prepare ("put", |
132 | "INSERT INTO gn180dc" | 126 | "INSERT INTO gn180dc" |
133 | " (type, ro, prox, expiration_time, key, value, trunc, path) " | 127 | " (type, ro, prox, expiration_time, key, value, trunc, path) " |
134 | "VALUES ($1, $2, $3, $4, $5, $6, $7, $8)", | 128 | "VALUES ($1, $2, $3, $4, $5, $6, $7, $8)"), |
135 | 8), | ||
136 | GNUNET_PQ_PREPARED_STATEMENT_END | 129 | GNUNET_PQ_PREPARED_STATEMENT_END |
137 | }; | 130 | }; |
138 | 131 | ||