diff options
-rw-r--r-- | src/datacache/plugin_datacache_postgres.c | 18 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index 3486d76dc..0fabdb4c2 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c | |||
@@ -87,7 +87,10 @@ check_result (struct Plugin *plugin, PGresult * ret, int expected_status, | |||
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Run simple SQL statement (without results). | 89 | * Run simple SQL statement (without results). |
90 | */ | 90 | * |
91 | * @param plugin global context | ||
92 | * @param sql statement to run | ||
93 | * @param line code line for error reporting */ | ||
91 | static int | 94 | static int |
92 | pq_exec (struct Plugin *plugin, const char *sql, int line) | 95 | pq_exec (struct Plugin *plugin, const char *sql, int line) |
93 | { | 96 | { |
@@ -104,6 +107,13 @@ pq_exec (struct Plugin *plugin, const char *sql, int line) | |||
104 | 107 | ||
105 | /** | 108 | /** |
106 | * Prepare SQL statement. | 109 | * Prepare SQL statement. |
110 | * | ||
111 | * @param plugin global context | ||
112 | * @param name name for the prepared SQL statement | ||
113 | * @param sql SQL code to prepare | ||
114 | * @param nparams number of parameters in sql | ||
115 | * @param line code line for error reporting | ||
116 | * @return GNUNET_OK on success | ||
107 | */ | 117 | */ |
108 | static int | 118 | static int |
109 | pq_prepare (struct Plugin *plugin, const char *name, const char *sql, | 119 | pq_prepare (struct Plugin *plugin, const char *name, const char *sql, |
@@ -122,6 +132,8 @@ pq_prepare (struct Plugin *plugin, const char *name, const char *sql, | |||
122 | 132 | ||
123 | /** | 133 | /** |
124 | * @brief Get a database handle | 134 | * @brief Get a database handle |
135 | * | ||
136 | * @param plugin global context | ||
125 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 137 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
126 | */ | 138 | */ |
127 | static int | 139 | static int |
@@ -185,7 +197,6 @@ init_connection (struct Plugin *plugin) | |||
185 | } | 197 | } |
186 | } | 198 | } |
187 | PQclear (ret); | 199 | PQclear (ret); |
188 | #if 1 | ||
189 | ret = | 200 | ret = |
190 | PQexec (plugin->dbh, | 201 | PQexec (plugin->dbh, |
191 | "ALTER TABLE gn090dc ALTER value SET STORAGE EXTERNAL"); | 202 | "ALTER TABLE gn090dc ALTER value SET STORAGE EXTERNAL"); |
@@ -208,7 +219,6 @@ init_connection (struct Plugin *plugin) | |||
208 | return GNUNET_SYSERR; | 219 | return GNUNET_SYSERR; |
209 | } | 220 | } |
210 | PQclear (ret); | 221 | PQclear (ret); |
211 | #endif | ||
212 | if ((GNUNET_OK != | 222 | if ((GNUNET_OK != |
213 | pq_prepare (plugin, "getkt", | 223 | pq_prepare (plugin, "getkt", |
214 | "SELECT discard_time,type,value FROM gn090dc " | 224 | "SELECT discard_time,type,value FROM gn090dc " |
@@ -241,6 +251,8 @@ init_connection (struct Plugin *plugin) | |||
241 | * Delete the row identified by the given rowid (qid | 251 | * Delete the row identified by the given rowid (qid |
242 | * in postgres). | 252 | * in postgres). |
243 | * | 253 | * |
254 | * @param plugin global context | ||
255 | * @param rowid which row to delete | ||
244 | * @return GNUNET_OK on success | 256 | * @return GNUNET_OK on success |
245 | */ | 257 | */ |
246 | static int | 258 | static int |
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c index 16393c23c..31ba09a87 100644 --- a/src/datastore/plugin_datastore_postgres.c +++ b/src/datastore/plugin_datastore_postgres.c | |||
@@ -339,7 +339,7 @@ init_connection (struct Plugin *plugin) | |||
339 | * @return GNUNET_OK on success | 339 | * @return GNUNET_OK on success |
340 | */ | 340 | */ |
341 | static int | 341 | static int |
342 | delete_by_rowid (struct Plugin *plugin, unsigned int rowid) | 342 | delete_by_rowid (struct Plugin *plugin, uint32_t rowid) |
343 | { | 343 | { |
344 | uint32_t browid; | 344 | uint32_t browid; |
345 | const char *paramValues[] = { (const char *) &browid }; | 345 | const char *paramValues[] = { (const char *) &browid }; |