Skip to content

Commit 707e3e3

Browse files
committed
fix sqlite3gen regressions from 592aaa4
This removes the _static property from bindTextParameter and last two call sites using it. While SQLITE_STATIC (which tells sqlite it doesn't need to copy the value) was fine for string literals, it looks like we should always pass SQLITE_TRANSIENT (which tells sqlite to copy the value at bind time) when using QCString.
1 parent 7277a9a commit 707e3e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sqlite3gen.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -859,14 +859,14 @@ class TextGeneratorSqlite3Impl : public TextGeneratorIntf
859859
};
860860

861861

862-
static bool bindTextParameter(SqlStmt &s,const char *name,const QCString &value, bool _static=FALSE)
862+
static bool bindTextParameter(SqlStmt &s,const char *name,const QCString &value)
863863
{
864864
int idx = sqlite3_bind_parameter_index(s.stmt, name);
865865
if (idx==0) {
866866
err("sqlite3_bind_parameter_index(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
867867
return false;
868868
}
869-
int rv = sqlite3_bind_text(s.stmt, idx, value.data(), -1, _static==TRUE?SQLITE_STATIC:SQLITE_TRANSIENT);
869+
int rv = sqlite3_bind_text(s.stmt, idx, value.data(), -1, SQLITE_TRANSIENT);
870870
if (rv!=SQLITE_OK) {
871871
err("sqlite3_bind_text(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
872872
return false;
@@ -930,7 +930,7 @@ static int insertPath(QCString name, bool local=TRUE, bool found=TRUE, int type=
930930
static void recordMetadata()
931931
{
932932
bindTextParameter(meta_insert,":doxygen_version",getFullVersion());
933-
bindTextParameter(meta_insert,":schema_version","0.2.1",TRUE); //TODO: this should be a constant somewhere; not sure where
933+
bindTextParameter(meta_insert,":schema_version","0.2.1"); //TODO: this should be a constant somewhere; not sure where
934934
bindTextParameter(meta_insert,":generated_at",dateToString(DateTimeType::DateTime));
935935
bindTextParameter(meta_insert,":generated_on",dateToString(DateTimeType::Date));
936936
bindTextParameter(meta_insert,":project_name",Config_getString(PROJECT_NAME));
@@ -2437,7 +2437,7 @@ static void generateSqlite3ForPage(const PageDef *pd,bool isExample)
24372437
// + title
24382438
bindTextParameter(compounddef_insert,":title",title);
24392439

2440-
bindTextParameter(compounddef_insert,":kind", isExample ? "example" : "page",TRUE);
2440+
bindTextParameter(compounddef_insert,":kind", isExample ? "example" : "page");
24412441

24422442
int file_id = insertPath(pd->getDefFileName());
24432443

0 commit comments

Comments
 (0)