aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-03-22 18:12:39 +0000
committerChristian Grothoff <christian@grothoff.org>2012-03-22 18:12:39 +0000
commit6ba8bbb5b9034d61ea1b54c7a6d0a670e759b6eb (patch)
tree8fb62d98fd3d4462730c1fafec7b74ff1f96642d /src
parent1523e4484f658161ecbe4803ffab5d36ce277d0e (diff)
downloadgnunet-6ba8bbb5b9034d61ea1b54c7a6d0a670e759b6eb.tar.gz
gnunet-6ba8bbb5b9034d61ea1b54c7a6d0a670e759b6eb.zip
-docs
Diffstat (limited to 'src')
-rw-r--r--src/datacache/plugin_datacache_postgres.c18
-rw-r--r--src/datastore/plugin_datastore_postgres.c2
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 */
91static int 94static int
92pq_exec (struct Plugin *plugin, const char *sql, int line) 95pq_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 */
108static int 118static int
109pq_prepare (struct Plugin *plugin, const char *name, const char *sql, 119pq_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 */
127static int 139static 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 */
246static int 258static 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 */
341static int 341static int
342delete_by_rowid (struct Plugin *plugin, unsigned int rowid) 342delete_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 };