summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c4265fb)
raw | patch | inline | side by side (parent: c4265fb)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 3 Feb 2009 20:35:01 +0000 (21:35 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 3 Feb 2009 20:35:01 +0000 (21:35 +0100) |
src/dbi.c | patch | blob | history |
diff --git a/src/dbi.c b/src/dbi.c
index ee43602309e55cbc8ec6749fb4fe974021c8e5b8..a542df32ed37cf9cd710353be64cf5c858330d0e 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
int success;
int status;
+ unsigned int db_version;
+
status = cdbi_connect_database (db);
if (status != 0)
return (status);
assert (db->connection != NULL);
+ db_version = dbi_conn_get_engine_version (db->connection);
+ /* TODO: Complain if `db_version == 0' */
+
success = 0;
for (i = 0; i < db->queries_num; i++)
{
+ /* Check if we know the database's version and if so, if this query applies
+ * to that version. */
+ if ((db_version != 0)
+ && (udb_query_check_version (db->queries[i], db_version) == 0))
+ continue;
+
status = cdbi_read_database_query (db, db->queries[i]);
if (status == 0)
success++;