[Bugs] [Bug 1641226] New: #define GF_SQL_COMPACT_DEF GF_SQL_COMPACT_INCR makes lots of the code unneeded
bugzilla at redhat.com
bugzilla at redhat.com
Sat Oct 20 04:38:20 UTC 2018
https://bugzilla.redhat.com/show_bug.cgi?id=1641226
Bug ID: 1641226
Summary: #define GF_SQL_COMPACT_DEF GF_SQL_COMPACT_INCR makes
lots of the code unneeded
Product: GlusterFS
Version: mainline
Component: unclassified
Keywords: CodeChange
Severity: low
Assignee: bugs at gluster.org
Reporter: ykaul at redhat.com
CC: bugs at gluster.org
Description of problem:
In gfdb_sqlite3.h, there's the definition:
#define GF_SQL_COMPACT_DEF GF_SQL_COMPACT_INCR
This makes lot of other code, which compares GF_SQL_COMPACT_DEF to other
values, quite useless.
For example, in gfdb_sqlite3.c, the whole switch is useless:
ret = 0;
switch (GF_SQL_COMPACT_DEF) {
case GF_SQL_COMPACT_FULL:
ret = gf_sqlite3_set_pragma(db_conn, "auto_vacuum",
GF_SQL_AV_FULL);
break;
case GF_SQL_COMPACT_INCR:
ret = gf_sqlite3_set_pragma(db_conn, "auto_vacuum",
GF_SQL_AV_INCR);
break;
case GF_SQL_COMPACT_MANUAL:
changing_pragma = _gf_false;
break;
default:
ret = -1;
gf_msg(GFDB_STR_SQLITE3, GF_LOG_ERROR, 0,
LG_MSG_COMPACT_FAILED, "VACUUM type undefined");
goto out;
break;
}
It's quite clear where it'll go. The rest is dead code. As such, the compiler
complains that the initial 'ret = 0' is not needed - this value set to 'ret' is
never read - which is true, as the switch goes to:
ret = gf_sqlite3_set_pragma(db_conn, "auto_vacuum",
GF_SQL_AV_INCR);
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list