summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-01-14 21:02:21 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-01-14 21:02:21 (GMT)
commitde9e2e0b72c5f460e38f0157039836fcdfb35c21 (patch)
tree80c1f8678bf8e6ea82b98e9d0d53f50a2ec0452b
parent09a5fc198a98d697d3e50c1c76392b8373f1af12 (diff)
parent1a708967ba0c4a5604c1ac7d8f3c8112ec3e7044 (diff)
downloadDoxygen-de9e2e0b72c5f460e38f0157039836fcdfb35c21.zip
Doxygen-de9e2e0b72c5f460e38f0157039836fcdfb35c21.tar.gz
Doxygen-de9e2e0b72c5f460e38f0157039836fcdfb35c21.tar.bz2
Merge pull request #92 from groleo/sqlite3-fixes
sqlite3: clear bindings on errors and more care with return
-rw-r--r--src/sqlite3gen.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index d22d915..94afed7 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -708,14 +708,15 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
if (id_bfile == -1)
{
sqlite3_clear_bindings(i_s_memberdef);
- return;
}
+ else
+ {
+ bindIntParameter(i_s_memberdef,":id_ibfile",id_bfile);
+ bindIntParameter(i_s_memberdef,":bline",md->getStartBodyLine());
- bindIntParameter(i_s_memberdef,":id_ibfile",id_bfile);
- bindIntParameter(i_s_memberdef,":bline",md->getStartBodyLine());
-
- // XXX implement getStartBodyColumn
- bindIntParameter(i_s_memberdef,":bcolumn",1);
+ // XXX implement getStartBodyColumn
+ bindIntParameter(i_s_memberdef,":bcolumn",1);
+ }
}
}
}
@@ -724,7 +725,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def)
{
sqlite3_clear_bindings(i_s_memberdef);
}
- /*int id_src =*/ sqlite3_last_insert_rowid(db);
+ sqlite3_last_insert_rowid(db);
// + source references
// The cross-references in initializers only work when both the src and dst
@@ -825,8 +826,9 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindIntParameter(i_s_compounddef,":line",cd->getDefLine());
bindIntParameter(i_s_compounddef,":column",cd->getDefColumn());
- if (-1==step(db,i_s_compounddef))
- return;
+ if (-1==step(db,i_s_compounddef)) {
+ sqlite3_clear_bindings(i_s_compounddef);
+ }
// + list of direct super classes
if (cd->baseClasses())
@@ -848,8 +850,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter(i_s_basecompoundref,":base",bcd->classDef->displayName());
}
bindTextParameter(i_s_basecompoundref,":derived",cd->displayName());
- if (-1==step(db,i_s_basecompoundref))
+ if (-1==step(db,i_s_basecompoundref)) {
+ sqlite3_clear_bindings(i_s_basecompoundref);
continue;
+ }
}
}
@@ -865,8 +869,10 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindTextParameter(i_s_derivedcompoundref,":refid",bcd->classDef->getOutputFileBase());
bindIntParameter(i_s_derivedcompoundref,":prot",bcd->prot);
bindIntParameter(i_s_derivedcompoundref,":virt",bcd->virt);
- if (-1==step(db,i_s_derivedcompoundref))
+ if (-1==step(db,i_s_derivedcompoundref)) {
+ sqlite3_reset(i_s_derivedcompoundref);
continue;
+ }
}
}
@@ -888,7 +894,7 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd)
bindIntParameter(i_s_includes,":id_src",id_file);
bindTextParameter(i_s_includes,":dst",nm);
if (-1==step(db,i_s_includes))
- return;
+ sqlite3_clear_bindings(i_s_basecompoundref);
}
}
}