summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/gfdb/gfdb_sqlite3.c
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-05-21 11:17:59 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-27 03:58:41 -0700
commit628198deaf0bc3192607a01ccfaa7a605723fa4d (patch)
tree6e1a77aabd77b83d89dff2f98f25f06527a72452 /libglusterfs/src/gfdb/gfdb_sqlite3.c
parent3b666b40efbed157e8c5991f29b345d93b28c659 (diff)
tier/tier.t: Fixing tier.t crash in regression runs
1) If the database file exists a. Dont try re-creating the db schema b. Dont try re-configuring the db. 2) Dont assert in fini_db () when connection is NULL Change-Id: I15dd103fe7542f70113c1d5e539a99f8cd062be4 BUG: 1163543 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/10870 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/gfdb/gfdb_sqlite3.c')
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3.c b/libglusterfs/src/gfdb/gfdb_sqlite3.c
index b9de3d3a3a6..02d60857498 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3.c
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3.c
@@ -436,9 +436,9 @@ gf_sqlite3_init (dict_t *args, void **db_conn) {
}
/* If the file exist we skip the config part
- * and create the schema if NOT Present*/
+ * and creation of the schema */
if (is_dbfile_exist)
- goto create_table;
+ goto db_exists;
/*Apply sqlite3 params to database*/
@@ -450,17 +450,16 @@ gf_sqlite3_init (dict_t *args, void **db_conn) {
goto out;
}
-/*Create the schema if NOT present*/
-create_table:
-
+ /*Create the schema if NOT present*/
ret = create_filetable (sql_conn->sqlite3_db_conn);
if (ret) {
gf_log (GFDB_STR_SQLITE3, GF_LOG_ERROR,
"Failed Creating %s Table", GF_FILE_TABLE);
goto out;
}
- ret = 0;
+db_exists:
+ ret = 0;
out:
if (ret) {
gf_sqlite3_fini ((void **)&sql_conn);