Commit dd3657f6 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

close[t:4576] Get rid of c_del in the cxx code. Closes #4576.

git-svn-id: file:///svn/toku/tokudb@40375 c7de825b-a66e-492c-adef-691d508d4ae1
parent e45fdcf7
...@@ -18,4 +18,4 @@ default: ../include/db.h ...@@ -18,4 +18,4 @@ default: ../include/db.h
hfiles: tdb.h hfiles: tdb.h
clean: clean:
rm -f *.o make_tdb rm -f *.o make_tdb make_db_h_?_? sample_offsets sample_offsets_mysql make_tdb_h
...@@ -474,7 +474,7 @@ static void print_dbc_struct (void) { ...@@ -474,7 +474,7 @@ static void print_dbc_struct (void) {
field_counter=0; field_counter=0;
STRUCT_SETUP(DBC, c_close, "int (*%s) (DBC *)"); STRUCT_SETUP(DBC, c_close, "int (*%s) (DBC *)");
STRUCT_SETUP(DBC, c_count, "int (*%s) (DBC *, db_recno_t *, u_int32_t)"); STRUCT_SETUP(DBC, c_count, "int (*%s) (DBC *, db_recno_t *, u_int32_t)");
STRUCT_SETUP(DBC, c_del, "int (*%s) (DBC *, u_int32_t)"); //STRUCT_SETUP(DBC, c_del, "int (*%s) (DBC *, u_int32_t)"); // c_del was removed. See #4576.
STRUCT_SETUP(DBC, c_get, "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)"); STRUCT_SETUP(DBC, c_get, "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)");
STRUCT_SETUP(DBC, dbp, "DB *%s"); STRUCT_SETUP(DBC, dbp, "DB *%s");
const char *extra[]={ const char *extra[]={
......
...@@ -15,6 +15,8 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) { ...@@ -15,6 +15,8 @@ int Dbc::get(Dbt* key, Dbt *data, u_int32_t flags) {
return env->maybe_throw_error(ret); return env->maybe_throw_error(ret);
} }
#if 0
// No longer present (see #4576)
int Dbc::del(u_int32_t flags) { int Dbc::del(u_int32_t flags) {
DBC *dbc = this; DBC *dbc = this;
int ret = dbc->c_del(dbc, flags); int ret = dbc->c_del(dbc, flags);
...@@ -22,6 +24,7 @@ int Dbc::del(u_int32_t flags) { ...@@ -22,6 +24,7 @@ int Dbc::del(u_int32_t flags) {
DbEnv *env = (DbEnv*)dbenv_c->api1_internal; DbEnv *env = (DbEnv*)dbenv_c->api1_internal;
return env->maybe_throw_error(ret); return env->maybe_throw_error(ret);
} }
#endif
int Dbc::count(db_recno_t *count, u_int32_t flags) { int Dbc::count(db_recno_t *count, u_int32_t flags) {
DBC *dbc = this; DBC *dbc = this;
......
...@@ -193,10 +193,13 @@ static void test_dbc_exceptions () { ...@@ -193,10 +193,13 @@ static void test_dbc_exceptions () {
TC(curs->get(&key, &val, DB_FIRST), 0); TC(curs->get(&key, &val, DB_FIRST), 0);
toku_free(key.get_data()); toku_free(key.get_data());
toku_free(val.get_data()); toku_free(val.get_data());
#if 0
// c_del no longer supported. See #4576.
TC(curs->del(DB_DELETE_ANY), 0); TC(curs->del(DB_DELETE_ANY), 0);
TCRET(curs->get(&key, &val, DB_CURRENT), DB_KEYEMPTY); TCRET(curs->get(&key, &val, DB_CURRENT), DB_KEYEMPTY);
TCRET(curs->del(0), DB_KEYEMPTY); TCRET(curs->del(0), DB_KEYEMPTY);
TCRET(curs->del(DB_DELETE_ANY), 0); TCRET(curs->del(DB_DELETE_ANY), 0);
#endif
curs->close(); // no deleting cursors. curs->close(); // no deleting cursors.
} }
......
...@@ -209,6 +209,8 @@ void test_zero_count(Db *db, int n) { ...@@ -209,6 +209,8 @@ void test_zero_count(Db *db, int n) {
Dbt key; key.set_flags(DB_DBT_REALLOC); Dbt key; key.set_flags(DB_DBT_REALLOC);
Dbt val; val.set_flags(DB_DBT_REALLOC); Dbt val; val.set_flags(DB_DBT_REALLOC);
#if 0
// c->del no longer supported. See #4576.
int i; int i;
for (i=1; count > 0; i++) { for (i=1; count > 0; i++) {
r = cursor->del(0); assert(r == 0); r = cursor->del(0); assert(r == 0);
...@@ -222,6 +224,7 @@ void test_zero_count(Db *db, int n) { ...@@ -222,6 +224,7 @@ void test_zero_count(Db *db, int n) {
if (r != 0) break; if (r != 0) break;
} }
assert(i == 2); assert(i == 2);
#endif
if (key.get_data()) toku_free(key.get_data()); if (key.get_data()) toku_free(key.get_data());
if (val.get_data()) toku_free(val.get_data()); if (val.get_data()) toku_free(val.get_data());
r = cursor->close(); assert(r == 0); r = cursor->close(); assert(r == 0);
......
...@@ -373,7 +373,6 @@ struct __toku_dbc { ...@@ -373,7 +373,6 @@ struct __toku_dbc {
DB *dbp; DB *dbp;
int (*c_close) (DBC *); int (*c_close) (DBC *);
int (*c_count) (DBC *, db_recno_t *, u_int32_t); int (*c_count) (DBC *, db_recno_t *, u_int32_t);
int (*c_del) (DBC *, u_int32_t);
int (*c_get) (DBC *, DBT *, DBT *, u_int32_t); int (*c_get) (DBC *, DBT *, DBT *, u_int32_t);
}; };
int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default"))); int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
......
...@@ -227,7 +227,6 @@ class Dbc : protected DBC { ...@@ -227,7 +227,6 @@ class Dbc : protected DBC {
public: public:
int close(void); int close(void);
int get(Dbt *, Dbt *, u_int32_t); int get(Dbt *, Dbt *, u_int32_t);
int del(u_int32_t);
int count(db_recno_t *, u_int32_t); int count(db_recno_t *, u_int32_t);
private: private:
Dbc(); // User may not call it. Dbc(); // User may not call it.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment